diff options
| author | Stefan Monnier | 2007-11-09 16:07:18 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2007-11-09 16:07:18 +0000 |
| commit | 4eebd7fe045c50c8dcd3faf6ea87f2c1197df565 (patch) | |
| tree | c600a9bfb50eececc6f0e04de3a8f57bc8d816ea /lisp | |
| parent | 0713128329924c857a7cb04f55d27b274d401a0d (diff) | |
| download | emacs-4eebd7fe045c50c8dcd3faf6ea87f2c1197df565.tar.gz emacs-4eebd7fe045c50c8dcd3faf6ea87f2c1197df565.zip | |
(define-abbrev-table): Record the variable definition.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/abbrev.el | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cbd685727bd..c9917d36ba3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2007-11-09 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2007-11-09 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * abbrev.el (define-abbrev-table): Record the variable definition. | ||
| 4 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-file-form-define-abbrev-table): | 5 | * emacs-lisp/bytecomp.el (byte-compile-file-form-define-abbrev-table): |
| 4 | New function. | 6 | New function. |
| 5 | 7 | ||
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 145ec223951..0c140a84159 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -895,13 +895,15 @@ Properties with special meaning: | |||
| 895 | - `:enable-function' can be set to a function of no argument which returns | 895 | - `:enable-function' can be set to a function of no argument which returns |
| 896 | non-nil iff the abbrevs in this table should be used for this instance | 896 | non-nil iff the abbrevs in this table should be used for this instance |
| 897 | of `expand-abbrev'." | 897 | of `expand-abbrev'." |
| 898 | ;; We used to manually add the docstring, but we also want to record this | ||
| 899 | ;; location as the definition of the variable (in load-history), so we may | ||
| 900 | ;; as well just use `defvar'. | ||
| 901 | (eval `(defvar ,tablename nil ,@(if (stringp docstring) (list docstring)))) | ||
| 898 | (let ((table (if (boundp tablename) (symbol-value tablename)))) | 902 | (let ((table (if (boundp tablename) (symbol-value tablename)))) |
| 899 | (unless table | 903 | (unless table |
| 900 | (setq table (make-abbrev-table props)) | 904 | (setq table (make-abbrev-table props)) |
| 901 | (set tablename table) | 905 | (set tablename table) |
| 902 | (push tablename abbrev-table-name-list)) | 906 | (push tablename abbrev-table-name-list)) |
| 903 | (when (stringp docstring) | ||
| 904 | (put tablename 'variable-documentation docstring)) | ||
| 905 | (dolist (elt definitions) | 907 | (dolist (elt definitions) |
| 906 | (apply 'define-abbrev table elt)))) | 908 | (apply 'define-abbrev table elt)))) |
| 907 | 909 | ||