2

According to this answer, I can make C++ mode think that underscores are not variable delimiters by adding this line to .emacs:

(modify-syntax-entry ?_ "w" c++-mode-syntax-table)

That seems to work well enough. But when I try to do something similar to CSS:

(modify-syntax-entry ?- "w" css-mode-syntax-table)

I get this error:

Symbol's value as variable is void: css-mode-syntax-table

Any ideas on how to fix this?

Community
  • 1
  • 1
wrongusername
  • 18,564
  • 40
  • 130
  • 214

1 Answers1

0

As kindahero said, I had to (load css-mode) before doing the above.

wrongusername
  • 18,564
  • 40
  • 130
  • 214
  • I run into the same error `Symbol's value as variable is void: css-mode-syntax-table` when trying to export to HTML from Orgmode. I can't change to `css-mode`, since I need to export from `org-mode`. `(load css-mode)` in my `emacs.d/init.el` gives me `eval-region: Symbol’s value as variable is void: css-mode`. How can I make sure that `css-mode-syntax-table` is set when starting emacs, so that I can use it even when not in `css-mode`? – AstroFloyd Oct 05 '20 at 12:33
  • I found my solution [here](https://stackoverflow.com/a/9812465/1386750): I had to remove the version of `css-mode` installed by my system in `/usr/share/emacs/site-lisp/css-mode/css-mode.el`, which was preferred over emacs' own version in `/usr/share/emacs/27.2/lisp/textmodes/css-mode.el`. Then it worked. – AstroFloyd Nov 28 '21 at 12:09