From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: saved user abbrevs and system abbrevs Date: Wed, 29 Nov 2006 16:05:47 -0500 Message-ID: <2godqqnetw.fsf@fencepost.gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1164834551 12934 80.91.229.2 (29 Nov 2006 21:09:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 29 Nov 2006 21:09:11 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 29 22:09:10 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GpWfy-0006dv-3P for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2006 22:09:06 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpWfx-0007cS-Ll for ged-emacs-devel@m.gmane.org; Wed, 29 Nov 2006 16:09:05 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GpWct-00059A-7y for emacs-devel@gnu.org; Wed, 29 Nov 2006 16:05:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GpWcn-000538-O8 for emacs-devel@gnu.org; Wed, 29 Nov 2006 16:05:50 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GpWcn-00052i-EO for emacs-devel@gnu.org; Wed, 29 Nov 2006 16:05:49 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GpWcm-00071s-Pw for emacs-devel@gnu.org; Wed, 29 Nov 2006 16:05:48 -0500 Original-Received: from localhost ([127.0.0.1]) by fencepost.gnu.org with esmtp (Exim 4.52) id 1GpWcm-0008BU-6I; Wed, 29 Nov 2006 16:05:48 -0500 Original-To: emacs-devel@gnu.org X-Spook: csim Audiotel Medco world domination Mantis AMW Mafia X-Ran: aCxBC@s_`kNt%AB{RQ?x?`qYYTH^O\r2!lSC-G#l4Qb9q&5EWT?v51PnexN5UBGU/yx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63080 Archived-At: Emacs 22 will introduce the concept of "user" and "system" abbrevs. Only user abbrevs get saved into the abbrev-file. Reading the abbrev file (happens at startup now) defines any saved abbrev-tables, and populates them with the saved user abbrevs. Most (all?) modes that define (system) abbrevs do it this way: (defvar foo-abbrev-table (define-abbrev-table 'foo-abbrev-table nil) (define-abbrev foo-abbrev-table "foo" "foobar" nil 0 t) ...) If foo-abbrev-table is already defined when the mode is loaded, the system abbrevs don't get added. The net result of this is that if a user saves an abbrev, when they restart Emacs and load the appropriate mode, the system abbrevs do not get defined. Does anyone see a better fix than changing each mode that defines abbrevs to use something like this: (defvar foo-abbrev-table nil) ;; Do not override any user abbrev for "foo". (unless (abbrev-expansion "foo" foo-abbrev-table) (define-abbrev foo-abbrev-table "foo" "foobar" nil 0 t))