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
  2008-10-17 21:35   ` bug#1194: marked as done (define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook) Emacs bug Tracking System
  0 siblings, 1 reply; 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

* bug#1194: marked as done (define-abbrev with EXPANSION equal to  nil doesn't run the abbrev hook)
  2008-10-17 19:25 ` bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook Francis Litterio
@ 2008-10-17 21:35   ` Emacs bug Tracking System
  0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2008-10-17 21:35 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 900 bytes --]


Your message dated Fri, 17 Oct 2008 17:27:36 -0400
with message-id <87r66e6hfb.fsf@cyd.mit.edu>
and subject line Re: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
has caused the Emacs bug report #1194,
regarding define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
1194: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1194
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 3669 bytes --]

From: Francis Litterio <email@not.available>
To: gnu-emacs-bug@moderators.isc.org
Subject: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
Date: Fri, 17 Oct 2008 15:25:59 -0400
Message-ID: <i5i6y70ngedn.fsf@not.available>

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




[-- Attachment #3: Type: message/rfc822, Size: 1937 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: 1194-done@emacsbugs.donarmstrong.com
Subject: Re: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook
Date: Fri, 17 Oct 2008 17:27:36 -0400
Message-ID: <87r66e6hfb.fsf@cyd.mit.edu>

> 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.

When EXPANSION is nil, that undefines the abbrev.  This is mentioned
earlier in the docstring of define-abbrev.  I made a small change to the
docstring to make this clearer.


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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87r66e6hfb.fsf@cyd.mit.edu>
2008-10-17 19:25 ` bug#1194: define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook Francis Litterio
2008-10-17 21:35   ` bug#1194: marked as done (define-abbrev with EXPANSION equal to nil doesn't run the abbrev hook) Emacs bug Tracking System

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).