I am using abbrev-mode
to perform the reverse process, writing a perfectly written word, and an abbreviation gets inserted instead. I want a quick way to disable the replacement when I want to. During a normal session I would be enabling and disabling abbrev-mode several times.
This is my current setup
(defun roto-abbrev ()
"Enables words to be expanded as one types."
(interactive)
(dolist
(hook '(lisp-interaction-mode-hook
emacs-lisp-mode-hook
text-mode-hook
org-mode-hook
prog-mode-hook))
(add-hook hook #'abbrev-mode))
(kill-all-abbrevs)
(define-abbrev-table 'global-abbrev-table
(apply #'append
(mapcar #'tablet-name (number-sequence 1 56)))))
abbrev-mode
will be enabled automatically. Isn't that what you want? Why would you want to enable it again? As for disabling,C-- M-x abbrev-mode
disables it interactively. What more do you want?abbrev-mode
to maybe a function key. Every time you press the key, it will toggleabbrev-mode
fromon
tooff
toon
...(global-set-key [f12] #'abbrev-mode)
to bind it tof12
. Note BTW, how much clearer your comment is than the original question (and how quickly a solution can be given when the question is clear). I'd suggest that you edit your question and put the comment in its place.global-abbrev-table
a global variable? Meaning that once it is setup, doing(abbrev-mode -1)
would not kill or flush the table?