From: Gerd Moellmann Date: Thu, 30 Dec 1999 12:26:53 +0000 (+0000) Subject: (Fexpand_abbrev): If expanding an abbrev which has only X-Git-Tag: emacs-pretest-21.0.90~5590 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=79d2af9c26e04a6094c593eb03262d3cb9f4c0e5;p=emacs.git (Fexpand_abbrev): If expanding an abbrev which has only a hook, and the hook has a non-nil `no-self-insert' property, let the return value of the hook specify whether an expansion took place. If it returns nil, no expansion has been performed. --- diff --git a/src/abbrev.c b/src/abbrev.c index e3ee9e039b2..f5586f5c4d7 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -364,7 +364,20 @@ Returns the abbrev symbol, if expansion took place.") hook = XSYMBOL (sym)->function; if (!NILP (hook)) - call0 (hook); + { + Lisp_Object expanded, prop; + + /* If expanding an abbrev which has only a hook, and the hook + has a non-nil `no-self-insert' property, let the return value + of the hook specify whether an expansion took place. If it + returns nil, no expansion has been done. */ + expanded = call0 (hook); + if (SYMBOLP (hook) + && NILP (expanded) + && (prop = Fget (hook, intern ("no-self-insert")), + !NILP (prop))) + value = Qnil; + } return value; }