unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
@ 2008-10-17 19:25 Francis Litterio
  0 siblings, 0 replies; 2+ messages in thread
From: Francis Litterio @ 2008-10-17 19:25 UTC (permalink / raw)
  To: gnu-emacs-bug

The docstring for define-abbrev says:

  (define-abbrev table name expansion &optional hook &rest props)

  Define an abbrev in table named name, to expand to expansion and call hook.
  [...]
  If expansion is not a string, the abbrev is a special one,
   which does not expand in the usual way but only runs hook.

It seems that EXPANSION must be the empty string for the special
behavior described in the docstring to happen.  To reproduce this,
evaluate this form:

  (progn
    (define-abbrev global-abbrev-table "zzz" nil '(lambda () (message "Hello")))
    (define-abbrev global-abbrev-table "yyy" "" '(lambda () (message "Hello")))
    (switch-to-buffer "temp"))

and then type " zzz yyy ".  The "zzz" abbrev does cause the hook to run,
but the "yyy" abbrev causes the hook to run.
--
Fran







^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-18 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1417.1224301722.25473.bug-gnu-emacs@gnu.org>
2008-10-18 17:25 ` bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook Francis Litterio
2008-10-17 19:25 Francis Litterio

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).