;;; abbrev.el --- abbrev mode commands for Emacs -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1987, 1992, 2001-2015 Free Software Foundation,
+;; Copyright (C) 1985-1987, 1992, 2001-2016 Free Software Foundation,
;; Inc.
;; Maintainer: emacs-devel@gnu.org
(buffer-substring-no-properties
(save-excursion (forward-word -1) (point))
pnt)))
- (if (or noquery (y-or-n-p (format "Expand `%s'? " string)))
+ (if (or noquery (y-or-n-p (format-message "Expand `%s'? " string)))
(expand-abbrev)))))))
;;; Abbrev properties.
,@(if (cadr props) (list :system (cadr props))))))
(unless (plist-get props :count)
(setq props (plist-put props :count 0)))
+ (setq props (plist-put props :abbrev-table-modiff
+ (abbrev-table-get table :abbrev-table-modiff)))
(let ((system-flag (plist-get props :system))
(sym (intern name table)))
;; Don't override a prior user-defined abbrev with a system abbrev,
(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.
- `: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))