diff options
| author | Stefan Monnier | 2015-04-10 02:47:44 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2015-04-10 02:47:44 -0400 |
| commit | 3638632f0bde06aac848655e28e28d188b48cd64 (patch) | |
| tree | 3cbf42571894ba3de991ba4a156adde40aff0f22 | |
| parent | 26f8a384978c6b1d1db1c6b091fa1e51d9ff5a5b (diff) | |
| download | emacs-3638632f0bde06aac848655e28e28d188b48cd64.tar.gz emacs-3638632f0bde06aac848655e28e28d188b48cd64.zip | |
* abbrev.el (define-abbrev-table): Refine last change.
| -rw-r--r-- | lisp/abbrev.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 424d9c4f30b..f9f078b5777 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el | |||
| @@ -953,7 +953,6 @@ Abbrevs marked as \"system abbrevs\" are omitted." | |||
| 953 | (insert " ))\n\n"))) | 953 | (insert " ))\n\n"))) |
| 954 | nil))) | 954 | nil))) |
| 955 | 955 | ||
| 956 | (put 'define-abbrev-table 'doc-string-elt 3) | ||
| 957 | (defun define-abbrev-table (tablename definitions | 956 | (defun define-abbrev-table (tablename definitions |
| 958 | &optional docstring &rest props) | 957 | &optional docstring &rest props) |
| 959 | "Define TABLENAME (a symbol) as an abbrev table name. | 958 | "Define TABLENAME (a symbol) as an abbrev table name. |
| @@ -973,11 +972,15 @@ Properties with special meaning: | |||
| 973 | - `:enable-function' can be set to a function of no argument which returns | 972 | - `:enable-function' can be set to a function of no argument which returns |
| 974 | non-nil if and only if the abbrevs in this table should be used for this | 973 | non-nil if and only if the abbrevs in this table should be used for this |
| 975 | instance of `expand-abbrev'." | 974 | instance of `expand-abbrev'." |
| 975 | (declare (doc-string 3)) | ||
| 976 | ;; We used to manually add the docstring, but we also want to record this | 976 | ;; We used to manually add the docstring, but we also want to record this |
| 977 | ;; location as the definition of the variable (in load-history), so we may | 977 | ;; location as the definition of the variable (in load-history), so we may |
| 978 | ;; as well just use `defvar'. | 978 | ;; as well just use `defvar'. |
| 979 | (eval `(defvar ,tablename nil ,@(if (stringp docstring) (list docstring) | 979 | (if (and docstring props (symbolp docstring)) |
| 980 | (when props (push docstring props) nil)))) | 980 | ;; There is really no docstring, instead the docstring arg |
| 981 | ;; is a property name. | ||
| 982 | (push docstring props) (setq docstring nil)) | ||
| 983 | (eval `(defvar ,tablename nil ,@(if docstring (list docstring)))) | ||
| 981 | (let ((table (if (boundp tablename) (symbol-value tablename)))) | 984 | (let ((table (if (boundp tablename) (symbol-value tablename)))) |
| 982 | (unless table | 985 | (unless table |
| 983 | (setq table (make-abbrev-table)) | 986 | (setq table (make-abbrev-table)) |