0

Have noticed that abbrev-mode only works for the current buffer. Thus using the following configuration does not enable abbrev-mode when I load an org-mode file.

(require 'toro)
(toro-abbrev)

Here is the file that provides the toro-abbrev feature.

(defconst tablet2 
   '( ("is" "s")      ("it" "t")       ("know" "no")
      ("like" "lk")   ("little" "ll")  ("more" "mo")

(defun toro-abbrev ()
  "Enables words to be expanded as one types."
  (interactive)
  (abbrev-mode 1)
  (kill-all-abbrevs)
  (define-abbrev-table 'global-abbrev-table tablet2))

(provide 'toro)

How could I turn on abbrev-mode globally or for buffers with a specific major mode?

7
  • 1
    I don't know if there is a global minor mode for abbrev but for the major-mode part of the question (which I added - you are welcome!), you use the major-mode hook.
    – NickD
    Aug 3 at 23:04
  • So I can do (add-hook 'org-mode-hook #'abbrev-mode). But then how can I disable?
    – Ephram
    Aug 3 at 23:35
  • Or just do (M-x abbrev-mode)?
    – Ephram
    Aug 3 at 23:37
  • All of your questions are answered here, I believe: Abbrevs.
    – Drew
    Aug 4 at 0:21
  • Maybe, but there are no examples as usual. Simply commands that never end.
    – Ephram
    Aug 4 at 0:24

0

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.