[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 0c2ea36 2/2: * lisp/abbrev.el (define-abbrev-table)
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 0c2ea36 2/2: * lisp/abbrev.el (define-abbrev-table): Treat a non-string "docstring" as |
Date: |
Thu, 02 Apr 2015 14:01:05 +0000 |
branch: master
commit 0c2ea36d2032ef47a0d6520b3e513459e072a553
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* 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 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 96732ec..38e45d0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2015-04-02 Stefan Monnier <address@hidden>
+ * 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 <address@hidden>
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 7aa46e0..424d9c4 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))))