From 0c2ea36d2032ef47a0d6520b3e513459e072a553 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 2 Apr 2015 10:00:48 -0400 Subject: [PATCH] * lisp/abbrev.el (define-abbrev-table): Treat a non-string "docstring" as part of the "props" arguments rather than silently ignoring it. --- lisp/ChangeLog | 3 +++ lisp/abbrev.el | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 96732ec37ef..38e45d063a4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2015-04-02 Stefan Monnier + * abbrev.el (define-abbrev-table): Treat a non-string "docstring" as + part of the "props" arguments rather than silently ignoring it. + * emacs-lisp/lisp-mnt.el (lm-version): Don't burp in a non-file buffer. 2015-04-01 Alan Mackenzie 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: ;; 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)))) + (eval `(defvar ,tablename nil ,@(if (stringp docstring) (list docstring) + (when props (push docstring props) nil)))) (let ((table (if (boundp tablename) (symbol-value tablename)))) (unless table (setq table (make-abbrev-table)) @@ -987,6 +988,7 @@ Properties with special meaning: ;; if the table was pre-existing as is the case if it was created by ;; loading the user's abbrev file. (while (consp props) + (unless (cdr props) (error "Missing value for property %S" (car props))) (abbrev-table-put table (pop props) (pop props))) (dolist (elt definitions) (apply 'define-abbrev table elt)))) -- 2.11.4.GIT