1

I'm using auctex, and trying to make underscores count as part of a word. There are numerous answers to this question, and I've tried the following

(modify-syntax-entry ?_ "w")
(modify-syntax-entry ?_ "w" latex-mode-syntax-table)
(modify-syntax-entry ?_ "w" LaTeX-mode-syntax-table)
(modify-syntax-entry ?_ "w" tex-mode-syntax-table)
(modify-syntax-entry ?_ "w" TeX-mode-syntax-table)

this works for any other mode, but not for my auctex files. I'm not even sure which is the correct syntax table (for example C-h m tells me that I'm in LaTeX/FMP mode, but there is no syntax table called LaTeX/FMP). Any ideas how to proceed?

Using emacs 25.1.1, auctex version 11.90.0.

funklute
  • 153
  • 3
  • What about `(add-hook 'TeX-mode-hook (lambda () (modify-syntax-entry ?_ "w")))` ? – Name Feb 02 '18 at 15:36
  • @Name I actually manually ran all of the above examples, after everything had already loaded, and it had no effect. Which I assume means that there is something within auctex that interferes with the way underscores are usually handled... – funklute Feb 02 '18 at 15:45
  • Have you tried one of the other "numerous answers to this question"? E.g. using `superword-mode`? – Stefan Feb 02 '18 at 16:17
  • I don't know if the solution given in https://emacs.stackexchange.com/a/9584/ can help. – Name Feb 02 '18 at 16:19
  • @Stefan I had in fact not come across `superword-mode`, if you want to post this as an answer I will accept it; it seems to be doing pretty much exactly what I want. – funklute Feb 02 '18 at 16:24
  • Maybe the right answer is here: https://emacs.stackexchange.com/questions/29921/how-can-i-type-simple-underline-in-auctex – Ian Feb 02 '18 at 16:57
  • This question is not a complete duplicate. It could be phrased more specifically, but the answers proposed do not address it in full. The problem is that the suggestion of using "(modify-syntax-entry ?_ "w" ***-mode-syntax-table)", with *** being "latex", "tex", etc, does not work in latex mode. For the specific character "_" this can be circumvented using superword-mode, but for other characters like backslash "\", the problem persists and those answers do not solve it. – pglpm Jan 29 '19 at 10:56

0 Answers0