[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 3638632f0: * abbrev.el (define-abbrev-table): Refin
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 3638632f0: * abbrev.el (define-abbrev-table): Refine last change. |
Date: |
Fri, 10 Apr 2015 06:47:56 +0000 |
branch: master
commit 3638632f0bde06aac848655e28e28d188b48cd64
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* abbrev.el (define-abbrev-table): Refine last change.
---
lisp/abbrev.el | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/abbrev.el b/lisp/abbrev.el
index 424d9c4..f9f078b 100644
--- a/lisp/abbrev.el
+++ b/lisp/abbrev.el
@@ -953,7 +953,6 @@ Abbrevs marked as \"system abbrevs\" are omitted."
(insert " ))\n\n")))
nil)))
-(put 'define-abbrev-table 'doc-string-elt 3)
(defun define-abbrev-table (tablename definitions
&optional docstring &rest props)
"Define TABLENAME (a symbol) as an abbrev table name.
@@ -973,11 +972,15 @@ Properties with special meaning:
- `:enable-function' can be set to a function of no argument which returns
non-nil if and only if the abbrevs in this table should be used for this
instance of `expand-abbrev'."
+ (declare (doc-string 3))
;; 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)
- (when props (push docstring props) nil))))
+ (if (and docstring props (symbolp docstring))
+ ;; There is really no docstring, instead the docstring arg
+ ;; is a property name.
+ (push docstring props) (setq docstring nil))
+ (eval `(defvar ,tablename nil ,@(if docstring (list docstring))))
(let ((table (if (boundp tablename) (symbol-value tablename))))
(unless table
(setq table (make-abbrev-table))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 3638632f0: * abbrev.el (define-abbrev-table): Refine last change.,
Stefan Monnier <=