unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* suppress insertion of SPC after SPC expands abbrev
@ 2004-06-23 13:26 Benjamin Rutt
  2004-06-23 19:14 ` Kevin Rodgers
  2004-06-23 22:17 ` Sandip Chitale
  0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Rutt @ 2004-06-23 13:26 UTC (permalink / raw)


I want to prevent the SPC from getting inserted when an abbrev is
expanded, much like C-x ' does.

The following thread from 1992 discusses this:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=WMESARD.92Sep4121833%40tofu.oracle.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3Demacs%2Babbrev%2Bsuppress%2Bspace%26btnG%3DSearch

None of those solutions looked very clean.  Is there any way in
current emacs to do this?
-- 
Benjamin Rutt

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

* Re: suppress insertion of SPC after SPC expands abbrev
  2004-06-23 13:26 suppress insertion of SPC after SPC expands abbrev Benjamin Rutt
@ 2004-06-23 19:14 ` Kevin Rodgers
  2004-06-23 21:10   ` Benjamin Rutt
  2004-06-23 22:17 ` Sandip Chitale
  1 sibling, 1 reply; 5+ messages in thread
From: Kevin Rodgers @ 2004-06-23 19:14 UTC (permalink / raw)


Benjamin Rutt wrote:
 > I want to prevent the SPC from getting inserted when an abbrev is
 > expanded, much like C-x ' does.
 >
 > The following thread from 1992 discusses this:
 >
 > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=WMESARD.92Sep4121833%40tofu.oracle.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3Demacs%2Babbrev%2Bsuppress%2Bspace%26btnG%3DSearch
 >
 > None of those solutions looked very clean.  Is there any way in
 > current emacs to do this?

Why not bound SPC to something like:

(defun expand-abbrev-or-self-insert ()
   (interactive)
   (or (expand-abbrev) (insert last-command-char)))

-- 
Kevin Rodgers

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

* Re: suppress insertion of SPC after SPC expands abbrev
  2004-06-23 19:14 ` Kevin Rodgers
@ 2004-06-23 21:10   ` Benjamin Rutt
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Rutt @ 2004-06-23 21:10 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> writes:

> Why not bound SPC to something like:
>
> (defun expand-abbrev-or-self-insert ()
>    (interactive)
>    (or (expand-abbrev) (insert last-command-char)))

Thanks, that works nicely.
-- 
Benjamin Rutt

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

* Re: suppress insertion of SPC after SPC expands abbrev
  2004-06-23 13:26 suppress insertion of SPC after SPC expands abbrev Benjamin Rutt
  2004-06-23 19:14 ` Kevin Rodgers
@ 2004-06-23 22:17 ` Sandip Chitale
  2004-06-27 16:18   ` Benjamin Rutt
  1 sibling, 1 reply; 5+ messages in thread
From: Sandip Chitale @ 2004-06-23 22:17 UTC (permalink / raw)


Benjamin Rutt <rutt.4+news@osu.edu> wrote in message news:<87vfhi4d8s.fsf@osu.edu>...
> I want to prevent the SPC from getting inserted when an abbrev is
> expanded, much like C-x ' does.
> 
> The following thread from 1992 discusses this:
> 
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=WMESARD.92Sep4121833%40tofu.oracle.com&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3Demacs%2Babbrev%2Bsuppress%2Bspace%26btnG%3DSearch
> 
> None of those solutions looked very clean.  Is there any way in
> current emacs to do this?

Look into:

The 'no-self-insert property of the tempo-template-* defuns. Does that help?

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

* Re: suppress insertion of SPC after SPC expands abbrev
  2004-06-23 22:17 ` Sandip Chitale
@ 2004-06-27 16:18   ` Benjamin Rutt
  0 siblings, 0 replies; 5+ messages in thread
From: Benjamin Rutt @ 2004-06-27 16:18 UTC (permalink / raw)


sandipchitale@yahoo.com (Sandip Chitale) writes:

> Benjamin Rutt <rutt.4+news@osu.edu> wrote in message news:<87vfhi4d8s.fsf@osu.edu>...
>> I want to prevent the SPC from getting inserted when an abbrev is
>> expanded, much like C-x ' does.
>> 
> Look into:
>
> The 'no-self-insert property of the tempo-template-* defuns. Does that help?

Yes, that helps a great deal.  I simply define my abbrev functions by
name (rather than anonymous) and give them the 'no-self-insert
property.  I think this is the cleanest solution, thanks.
-- 
Benjamin Rutt

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

end of thread, other threads:[~2004-06-27 16:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-23 13:26 suppress insertion of SPC after SPC expands abbrev Benjamin Rutt
2004-06-23 19:14 ` Kevin Rodgers
2004-06-23 21:10   ` Benjamin Rutt
2004-06-23 22:17 ` Sandip Chitale
2004-06-27 16:18   ` Benjamin Rutt

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