It looks like the original answer is working for you, but the difficulty I had with it was that abbrevs added in the two modes were added to separate tables. This meant that if I added new autocorrects in org-mode
, they would not be available in latex-mode
. I'm not sure if this is what you want, but I did a two-way merge by setting the local-abbrev-table
in a hook that I configure when I load the abbrev-mode
package. For your case this would be something like:
(use-package abbrev-mode
:init
(setq-default abbrev-mode t)
;; a hook function that sets the abbrev-table to org-mode-abbrev-table
;; whenever the major mode is a text mode
(defun mwp-set-text-mode-abbrev-table ()
(if (derived-mode-p 'org-mode)
(setq local-abbrev-table latex-mode-abbrev-table)))
:commands abbrev-mode
:hook
(abbrev-mode . mwp-set-text-mode-abbrev-table)
See also my similar question here: use a single abbrev-table for multiple modes?