help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: flyspell: local abbrev in different languages


From: Stefan Monnier
Subject: Re: flyspell: local abbrev in different languages
Date: Fri, 28 Sep 2007 11:12:13 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

> (define-minor-mode spanish-minor-mode
>   "Switch Spanish minor mode on."
>   nil nil nil
>   (set (make-local-variable 'spanish-minor-mode) t)
>   (unless (memq 'spanish-minor-mode-abbrev-table abbrev-table-name-list)
>     (setq spanish-minor-mode-abbrev-table
>         (copy-abbrev-table text-mode-abbrev-table))
>     (add-to-list 'abbrev-table-name-list 'spanish-minor-mode-abbrev-table))
>   (setq local-abbrev-table spanish-minor-mode-abbrev-table))

> (defun disable-spanish-minor-mode ()
>   " "
>   (interactive)
>   (setq spanish-minor-mode nil)
>   (setq local-abbrev-table text-mode-abbrev-table))

Looks like you slightly misunderstood what define-minor-mode does.
The following might be a good starting point (the spanish-minor-mode
covers both enable and disable, as ):

  (define-minor-mode spanish-minor-mode
    nil nil nil nil
    (setq local-abbrev-table
          (if spanish-minor-mode
              spanish-minor-mode-abbrev-table
            text-mode-abbrev-table)))


-- Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]