From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Harriss Newsgroups: gmane.emacs.help Subject: using custom emacs abbreviations Date: Fri, 10 Nov 2006 00:09:36 -0600 Message-ID: <1163138976.25107.18.camel@localhost.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1163138866 9651 80.91.229.2 (10 Nov 2006 06:07:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2006 06:07:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 10 07:07:43 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GiPYD-0008Oh-VM for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Nov 2006 07:07:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiPYD-00024Y-8l for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Nov 2006 01:07:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GiPXr-00022S-HR for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 01:07:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GiPXp-0001zt-80 for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 01:07:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GiPXp-0001zg-3B for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 01:07:17 -0500 Original-Received: from [199.232.41.67] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GiPXo-0006DI-Ch for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 01:07:16 -0500 Original-Received: from [64.233.166.183] (helo=py-out-1112.google.com) by mx20.gnu.org with esmtp (Exim 4.52) id 1GiPXn-0002dk-GK for help-gnu-emacs@gnu.org; Fri, 10 Nov 2006 01:07:15 -0500 Original-Received: by py-out-1112.google.com with SMTP id p76so212678pyb for ; Thu, 09 Nov 2006 22:06:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:subject:from:to:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=pQcEfH1C+cDSx9dSo8j+3N2MVMu4JOnGRFDSvE7kdwLIIU5qR01h1lRu8q1guHKiuhgoYFiuh0TdoY4aZqjXjSXl0OgOLZzTM3+yXMuBZMLez2rX/9zG74o0T03kuUt0mX/pizaQ+h39z/bCgJMOATTMjRDypaqIQn/gArdHy54= Original-Received: by 10.35.97.17 with SMTP id z17mr2492707pyl.1163138774530; Thu, 09 Nov 2006 22:06:14 -0800 (PST) Original-Received: from ?198.37.25.184? ( [198.37.25.184]) by mx.google.com with ESMTP id f45sm1937889pyh.2006.11.09.22.06.13; Thu, 09 Nov 2006 22:06:14 -0800 (PST) Original-To: help-gnu-emacs@gnu.org X-Mailer: Evolution 2.8.1.1 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:38610 Archived-At: I am wanting to use a set of custom abbreviation in python-mode for emacs. The layout for my files I have is follows a ~/.emacs, ~/.emacs-dir/abbrevs.el, ~/.emacs-dir/recipe-abbrevs.el. I will post the contents of those files below. When I open a python file with emacs it says that it loads recipe-abbrevs.el but when I do M-x list-abbrevs it only shows the default abbrevs with python-mode, so my custom abbrevs are not being loaded. === ~/.emacs === (setq-default abbrev-mode t) (setq save-abbrevs t) (setq abbrev-file-name "~/.emacs-dir/abbrevs.el") (if (file-readable-p abbrev-file-name) (read-abbrev-file abbrev-file-name)) (setq auto-mode-alist (append '( ("\\.recipe$" . python-mode) ("\\.py$" . python-mode) ) auto-mode-alist)) (add-hook 'python-mode-hook '(lambda() (load-file "~/.emacs-dir/recipe-abbrevs.el"))) === ~/.emacs-dir/abbrevs.el === (define-abbrev-table 'text-mode-abbrev-table '( ("\\a" "\alpha" nil 0) ("\\auto" "" recipe-abbrev-auto 0) ) ) === ~/.emacs-dir/recipe-abbrevs.el === (defun smart-space() (interactive) (if (not (expand-abbrev)) (insert " ") ) ) (local-set-key [(space)] 'smart-space) (defun recipe-abbrevs-auto () (interactive) (insert "class (AutoPackageRecipe):") ) Thanks, Kevin