[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
saved user abbrevs and system abbrevs
From: |
Glenn Morris |
Subject: |
saved user abbrevs and system abbrevs |
Date: |
Wed, 29 Nov 2006 16:05:47 -0500 |
User-agent: |
Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) |
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))
- saved user abbrevs and system abbrevs,
Glenn Morris <=