emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch to change just-one-space


From: Deniz Dogan
Subject: Re: Patch to change just-one-space
Date: Fri, 14 Aug 2009 01:30:10 +0200

2009/8/14 Xah Lee <address@hidden>:
> i share this view.
> though, in my experiment, i find that there are often situations where
> shrinking all whitespaces including EOL is not convenient. Here's a example:
> -----------------------------
>    numRep=0
>    for couple in findreplace:
> c    numRep += s.count(couple[0])
>       outtext=s.replace(couple[0],couple[1])
>       s=outtext
> -----------------------------
> where the c is the cursor point.
> If you shrink all whitespaces including EOL, the the current line becomes
> joined with previous line.
> what i find more ideal is this:
> when the current line contain non-whitespace chars, then shrink just spaces
> and tabs, but if the current line does not contain non-whitespace chars
> (it's all white space), then shrink all all spaces, tab, EOL.
> the code i've been using is this:
> [snip code]

Not a bad idea. I'd like to take your idea and revise it a bit: If
there are only whitespace characters characters between point and EOL,
nuke including newlines. Otherwise, nuke excluding newlines.

What do you think?

-- 
Deniz Dogan




reply via email to

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