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: Thu, 13 Nov 2008 11:52:28 -0800

On Nov 13, 2008, at 11:33 AM, Nikolaj Schumacher wrote:

Ian Eure <ian@digg.com> wrote:

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.

This has annoyed me as well in the past.  I took a different route in
the solution.  just-one-space would collide with my finger memory when
inserting something in the middle. Instead I chose to give the tab key
an additional function

(defun tab-command ()
 "Do the right thing for the tab key."
 (interactive)
 (or (expand-abbrev)
     (indent-according-to-mode)))

My tab-command does in fact do many more things depending on context.
This is the abridged version. :)

Alas, this doesn't solve the case I illustrated, since I want to eliminate extra whitespace from the middle of the line, rather than fix whitespace at the beginning.

I think I may need to disable the global abbrev mode and rebind SPC to (self-insert-command) (and (expand-abbrev) (just-one-space)).

Thanks for the suggestion, though.

 - Ian




reply via email to

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