changeset 85991:dd802e6c104e

(define-abbrev-table): Record the variable definition.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 Nov 2007 16:07:18 +0000
parents f1e0811b8c83
children b4725893986c
files lisp/ChangeLog lisp/abbrev.el
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 09 16:02:09 2007 +0000
+++ b/lisp/ChangeLog	Fri Nov 09 16:07:18 2007 +0000
@@ -1,5 +1,7 @@
 2007-11-09  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* abbrev.el (define-abbrev-table): Record the variable definition.
+
 	* emacs-lisp/bytecomp.el (byte-compile-file-form-define-abbrev-table):
 	New function.
 
--- a/lisp/abbrev.el	Fri Nov 09 16:02:09 2007 +0000
+++ b/lisp/abbrev.el	Fri Nov 09 16:07:18 2007 +0000
@@ -895,13 +895,15 @@
 - `:enable-function' can be set to a function of no argument which returns
   non-nil iff the abbrevs in this table should be used for this instance
   of `expand-abbrev'."
+  ;; We used to manually add the docstring, but we also want to record this
+  ;; location as the definition of the variable (in load-history), so we may
+  ;; as well just use `defvar'.
+  (eval `(defvar ,tablename nil ,@(if (stringp docstring) (list docstring))))
   (let ((table (if (boundp tablename) (symbol-value tablename))))
     (unless table
       (setq table (make-abbrev-table props))
       (set tablename table)
       (push tablename abbrev-table-name-list))
-    (when (stringp docstring)
-      (put tablename 'variable-documentation docstring))
     (dolist (elt definitions)
       (apply 'define-abbrev table elt))))