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

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

Re: Running just-one-space after expand-abbrev


From: Ian Eure
Subject: Re: Running just-one-space after expand-abbrev
Date: Wed, 12 Nov 2008 15:59:46 -0800

On Nov 12, 2008, at 2:28 PM, aartist wrote:

On Nov 12, 12:49 pm, Ian Eure <i...@digg.com> wrote:
I have abbrevs for public/protected/private: pub/prot/pri.

I often find that I'm editing something like:

public function foo();

And I want to change it from public to protected. My first thought is:
C-a M-d prot SPC

The problem is that the M-d leaves the whitespace to the left of
"function," and the SPC to expand the abbrev gives another, so now I
have two spaces.

Is it possible to run (just-one-space) after an abbrev is expanded? I
tried advising (expand-abbrev), but that didn't work. I don't see any
hooks for that function, either.

Ideas?
Are you sure?
I couldn't repeat it..
Can you explain what you did to make it work?

This is what I tried, and I just confirmed it does not work:

(defadvice abbrev-expand (after one-space activate)
  "Run just-one-space after expanding an abbrev"
  (just-one-space))

To be clear: This works if I hit C-x '. It does not work if I'm using the abbrev minor mode and something is automatically expanded when I hit SPC.

 - Ian





reply via email to

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