bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbr


From: Francis Litterio
Subject: bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
Date: Fri, 17 Oct 2008 15:25:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (windows-nt)

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]