I want to set - as a word character for all reStructuredText files. In order to do this, I acted according to the wiki and added the following to my .emacs file:

(require 'misc)
(defvar my-restructuredtext-syntax-table
    ((table (make-syntax-table)))
    (modify-syntax-entry ?- "w" table)

(add-hook 'text-mode-hook
  (lambda ()
    (set-syntax-table my-restructuredtext-syntax-table)))

This loads without errors on emacs startup, but as soon as I switch to my reStructuredText containing buffer, I have 30 seconds 100 CPU usage on one core. After that emacs behaves normal and the dashes or minuses are part of words. Also when I switch buffer away from rst and back to my rst buffer it does not repeat this high CPU load behavior. Nevertheless this behavior of 30 seconds lag is quite annoying.

When I tried to hook into rst-mode the result was the same lag.

How can I add - to the word characters without this lag?


  • GNU Emacs 24.5.1
  • Xubuntu 16.04.1 using XFCE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.