Function: abbrev--possibly-save
abbrev--possibly-save is a byte-compiled function defined in
abbrev.el.gz.
Signature
(abbrev--possibly-save QUERY &optional ARG)
Documentation
Hook function for use by save-some-buffers-functions.
Maybe save abbrevs, and record whether we either saved them or asked to.
Source Code
;; Defined in /usr/src/emacs/lisp/abbrev.el.gz
(defun abbrev--possibly-save (query &optional arg)
"Hook function for use by `save-some-buffers-functions'.
Maybe save abbrevs, and record whether we either saved them or asked to."
;; Query mode.
(if (eq query 'query)
(and save-abbrevs abbrevs-changed)
(and save-abbrevs
abbrevs-changed
(prog1
(if (or arg
(eq save-abbrevs 'silently)
(y-or-n-p (format "Save abbrevs in %s? " abbrev-file-name)))
(progn
(write-abbrev-file nil)
nil)
;; Inhibit message in `save-some-buffers'.
t)
;; Don't ask again whether saved or user said no.
(setq abbrevs-changed nil)))))