From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: add-mode-abbrev writes to fundamental table only Date: Mon, 28 Feb 2005 12:19:25 -0700 Message-ID: <38h95vF5nvi4iU1@individual.net> References: <1109358818.758581.83330@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1109618325 1608 80.91.229.2 (28 Feb 2005 19:18:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2005 19:18:45 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 28 20:18:45 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D5qNY-0001c4-RI for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Feb 2005 20:16:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D5qfx-0003bL-O4 for geh-help-gnu-emacs@m.gmane.org; Mon, 28 Feb 2005 14:35:29 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!newsmi-eu.news.garr.it!NewsITBone-GARR!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-X-Trace: individual.net xBvhGtJMIqLALCfywmaYpwwD8DC2FDdMich0h6SgntJr76o6M= User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <1109358818.758581.83330@l41g2000cwc.googlegroups.com> Original-Xref: shelby.stanford.edu gnu.emacs.help:128894 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24436 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24436 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