From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: harven Newsgroups: gmane.emacs.help Subject: Re: define abbrev for emacs-lisp-mode but not other lisp-mode Date: Tue, 16 Nov 2010 15:54:57 +0100 Organization: http://groups.google.com Message-ID: <8762vx48u6.fsf@ergodik.univ-brest.fr> References: <47506466-243e-4662-a60d-c29d71e675c3@y3g2000vbm.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291889601 25356 80.91.229.12 (9 Dec 2010 10:13:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 10:13:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 11:13:13 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PQdUs-0008As-0n for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 11:13:10 +0100 Original-Received: from localhost ([127.0.0.1]:51936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQdUq-0000pr-LS for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 05:13:08 -0500 Original-Path: usenet.stanford.edu!postnews.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!ircam.fr!freenix!jussieu.fr!crihan.fr!news.univ-brest.fr!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-NNTP-Posting-Host: mathw171.univ-brest.fr Original-X-Trace: news.univ-brest.fr 1289919455 1561 172.19.130.171 (16 Nov 2010 14:57:35 GMT) Original-X-Complaints-To: usenet@news.univ-brest.fr Original-NNTP-Posting-Date: 16 Nov 2010 14:57:35 GMT User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:Li+g6JGjdtgMb+6mKiK5oocKOUw= Original-Xref: usenet.stanford.edu gnu.emacs.help:182458 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 Xref: news.gmane.org gmane.emacs.help:76946 Archived-At: Xah Lee writes: > this is a odd thing. > > when in emacs-lisp-mode, and when you define a abbrev (e.g. call > define-mode-abbrev then “ah” then “add-hook”), then call write-abbrev- > file > > then you get this in your abbrev file (e.g. at 〔~/.emacs.d/ > abbrev_defs〕) > > (define-abbrev-table 'lisp-mode-abbrev-table '( > ("ah" "add-hook" nil 0) > )) > > note that it's lisp-mode-abbrev-table not emacs-lisp-mode-abbrev- > table. > > Why's that? > > (if you change it to the latter, it won't work.) > > i'm wondering because i want the abbrev to be for emacs-lisp-mode > only, not general lisp mode. > It appears that emacs-lisp-mode is defined on top of lisp-mode. Ok, so > my question is, what's the purpose of lisp-mode? Is that supposed to > be the base for other lisp lang modes to be defined on top of? A look > at scheme-mode seems to confirm this, but still, i want my abbrev for > emacs lisp mode only. Is that possible? > > thanks. > > Xah ∑ http://xahlee.org/ ☄ I would try the following in .emacs (define-abbrev-table 'emacs-lisp-mode-abbrev-table '( ("ah" "add-hook" nil 0))) (add-hook 'emacs-lisp-mode-hook (lambda() (setq abbrev-mode t) (setq local-abbrev-table emacs-lisp-mode-abbrev-table))) I think that the nil argument after add-hook is deprecated in emacs ≥ 23.