1

I have (human-)language-specific abbrev-tables named like lang-francais-mode-abbrev-table, lang-castellano8-mode-abbrev-table backed by my ~/.emacs.d/abbrev_defs file. The language names are the ispell dictionary names.

I can't just load all the abbreviations into memory in global-abbrev, because I then have "collisions", e.g. "dont" stays "dont" in French, but should become "don't" for English. And "ten" and "men" should stay as is in English, but become "m'en" and "t'en" for French.

To cycle between flyspell languages, I use this function from the emacs flyspell wiki page:

(let ((langs '("american" "francais" "deutsch8" "castellano8")))
  (setq lang-ring (make-ring (length langs)))
  (dolist (elem langs) (ring-insert lang-ring elem)))

(defun cycle-ispell-languages ()
  (interactive)
  (let ((lang (ring-ref lang-ring -1)))
    (ring-insert lang-ring lang)
    (ispell-change-dictionary lang)))

I would like to change cycle-ispell-languages to also cycle the active language table for this buffer. How would I do that?

I know, I can setq local-abbrev-table lang-francais-mode-abbrev-table, but that then removes(?) the other active abbrev-tables, that other (major) modes might add, or does it?

Note: I edited out a significant portion describing me at an earlier point of the same problem.

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.