emacs-devel
[Top][All Lists]
Advanced

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

Re: problem whith abbrevs in message-mode


From: Matt Armstrong
Subject: Re: problem whith abbrevs in message-mode
Date: Wed, 30 Jan 2002 11:20:36 -0700
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-debian-linux-gnu)

Richard Stallman <address@hidden> writes:

> Mailabbrevs is something different; those abbrevs use a special
> abbrev table.
>
> Message mode ought to use text-mode-abbrev-table for its ordinary
> abbrev table.  It should set local-abbrev-table to
> text-mode-abbrev-table.

[Note: I've also sent a copy of this to address@hidden

I attempted to implement this change, but mailabbrev clobbers the
value of local-abbrev-table (and the message mode syntax table).

It turns out that mailabbrev does not restore the previous values of
the syntax-table and local-abbrev-table after it is done.  Instead, it
restores the mail-* versions of those variables.  Since there is no
mail-mode-abbrev-table variable, it *always* sets local-abbrev-table
to nil.  It also always sets the syntax table back to
mail-mode-syntax-table, which is not desirable for message mode.

The offending function is sendmail-pre-abbrev-expand-hook in
mailabbrev.el.

    (defun sendmail-pre-abbrev-expand-hook ()

    [...]

         (if (or (not mail-abbrevs-only)
                 (eq this-command 'expand-abbrev))
             (progn
               ;; We're not in a mail header where mail aliases should
               ;; be expanded, then use the normal mail-mode abbrev table
               ;; (if any) and the normal mail-mode syntax table.

               (setq local-abbrev-table (and (boundp 'mail-mode-abbrev-table)
                                             mail-mode-abbrev-table))
               (set-syntax-table mail-mode-syntax-table))

    [...]

Maybe sendmail-pre-abbrev-expand-hook needs to always restore
local-abbrev-table and the syntax table to whatever they were before
it was called?

-- 
matt



reply via email to

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