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

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

Re: add-mode-abbrev writes to fundamental table only


From: Kevin Rodgers
Subject: Re: add-mode-abbrev writes to fundamental table only
Date: Mon, 28 Feb 2005 12:19:25 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

rgb wrote:
>>I'm finding when I have entered any mode (Here we use sh-mode) that
>>running `add-mode-abbrev' will only write my new abbrev to the
>>Fundamental-mode-abbrev-table.
>
> I just had this problem in a mode I'm writing.  I found that
> it occurs when local-abbrev-table is not set.
> local-abbrev-table is buffer local when set but if it's not
> set the default is usually fundamental-mode.

What version of Emacs doesn't set local-abbrev-table?  If I run
emacs-21.3 -q --no-site-file -f sh-mode, `C-h f local-abbrev-table'
displays

| local-abbrev-table's value is
| [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
|
| Local in buffer redstone_build; global value is
| [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
|
|
| Documentation:
| Local (mode-specific) abbrev table of current buffer.

And `M-: (eq local-abbrev-table (default-value 'local-abbrev-table))'
returns nil.

I guess the workaround for OP is something like:

(add-hook 'sh-mode-hook
          (lambda ()
            (or local-abbrev-table
                (setq local-abbrev-table (make-abbrev-table)))))

--
Kevin Rodgers

reply via email to

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