aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2015-04-02 10:00:48 -0400
committerStefan Monnier2015-04-02 10:00:48 -0400
commit0c2ea36d2032ef47a0d6520b3e513459e072a553 (patch)
treeb21dbe2bb967d25c5f74a64835e27782f3353e28
parent5e41a51e5cc45ca7289fc120f26ad90f45eb2682 (diff)
downloademacs-0c2ea36d2032ef47a0d6520b3e513459e072a553.tar.gz
emacs-0c2ea36d2032ef47a0d6520b3e513459e072a553.zip
* lisp/abbrev.el (define-abbrev-table): Treat a non-string "docstring" as
part of the "props" arguments rather than silently ignoring it.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/abbrev.el4
2 files changed, 6 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 96732ec37ef..38e45d063a4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12015-04-02 Stefan Monnier <monnier@iro.umontreal.ca> 12015-04-02 Stefan Monnier <monnier@iro.umontreal.ca>
2 2
3 * abbrev.el (define-abbrev-table): Treat a non-string "docstring" as
4 part of the "props" arguments rather than silently ignoring it.
5
3 * emacs-lisp/lisp-mnt.el (lm-version): Don't burp in a non-file buffer. 6 * emacs-lisp/lisp-mnt.el (lm-version): Don't burp in a non-file buffer.
4 7
52015-04-01 Alan Mackenzie <acm@muc.de> 82015-04-01 Alan Mackenzie <acm@muc.de>
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 7aa46e0073e..424d9c4f30b 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -976,7 +976,8 @@ Properties with special meaning:
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 (eval `(defvar ,tablename nil ,@(if (stringp docstring) (list docstring)
980 (when props (push docstring props) nil))))
980 (let ((table (if (boundp tablename) (symbol-value tablename)))) 981 (let ((table (if (boundp tablename) (symbol-value tablename))))
981 (unless table 982 (unless table
982 (setq table (make-abbrev-table)) 983 (setq table (make-abbrev-table))
@@ -987,6 +988,7 @@ Properties with special meaning:
987 ;; if the table was pre-existing as is the case if it was created by 988 ;; if the table was pre-existing as is the case if it was created by
988 ;; loading the user's abbrev file. 989 ;; loading the user's abbrev file.
989 (while (consp props) 990 (while (consp props)
991 (unless (cdr props) (error "Missing value for property %S" (car props)))
990 (abbrev-table-put table (pop props) (pop props))) 992 (abbrev-table-put table (pop props) (pop props)))
991 (dolist (elt definitions) 993 (dolist (elt definitions)
992 (apply 'define-abbrev table elt)))) 994 (apply 'define-abbrev table elt))))