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

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

mailabbrev clobbers local-abbrev-table, syntax table


From: Matt Armstrong
Subject: mailabbrev clobbers local-abbrev-table, syntax table
Date: Wed, 30 Jan 2002 11:20:41 -0700

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.1.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2001-12-06 on raven, modified by Debian
configured using `configure  i386-debian-linux-gnu --prefix=/usr 
--sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib 
--infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes 
--with-x-toolkit=athena --without-gif'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

This is a courtesy copy of a problem I found while looking into abbrev
issues for Gnus' message mode.  It is part of a thread that took place
on address@hidden and address@hidden

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.

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?



Recent input:
a b l e ) . M-q C-n C-n C-n C-n C-n C-n C-p M-b M-b 
M-b M-d f o r M-q C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-l M-q M-f M-f M-f M-f M-f M-f M-f <right> C-n C-a 
M-f M-f M-f <right> M-q M-f M-f M-f M-f M-f M-f M-f 
M-f M-f M-f M-f M-f M-f M-f M-f M-f M-f M-f M-f C-x 
C-s <switch-frame> C-x 1 M-x b u <tab> <backspace> 
<backspace> C-g <help-echo> <help-echo> <help-echo> 
<help-echo> <help-echo> <menu-bar> <help-menu> <re
port-emacs-bug>

Recent messages:
Mark set
Wrote /home/matt/.emacs-keyolution/emacs-keyolution1145.data
Auto-saving...done
Wrote /home/matt/g/News/drafts/drafts/20
Auto-saving...done
Wrote /home/matt/.emacs-keyolution/emacs-keyolution1146.data
Wrote /home/matt/g/News/drafts/drafts/20
Making completion list...
call-interactively: Quit
Loading emacsbug...done

-- 
matt



reply via email to

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