unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* saved user abbrevs and system abbrevs
@ 2006-11-29 21:05 Glenn Morris
  2006-11-30 19:48 ` Richard Stallman
  2006-12-01 20:50 ` Stuart D. Herring
  0 siblings, 2 replies; 6+ messages in thread
From: Glenn Morris @ 2006-11-29 21:05 UTC (permalink / raw)



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))

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-12-02  0:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-29 21:05 saved user abbrevs and system abbrevs Glenn Morris
2006-11-30 19:48 ` Richard Stallman
2006-12-01  2:54   ` Glenn Morris
2006-12-01 22:02     ` Richard Stallman
2006-12-01 20:50 ` Stuart D. Herring
2006-12-02  0:04   ` Glenn Morris

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).