2009/8/14 Xah Lee <address@hidden>:
> i share this view.> [snip code]
> though, in my experiment, i find that there are often situations where
> shrinking all whitespaces including EOL is not convenient. Here's a example:
> for couple in findreplace:
> c numRep += s.count(couple)
> 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:
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?
i think that'd bring the next non-whitespace line to the current line, right?
but in general, considering this thread in whole, i share your view with merging just-one-space with delete-blank-lines, and the behavior be depending on context. Something like a shrink-whitespace-dwim.
I feel there are too many small functions on shrinking white spaces, esp those with a shortcut.
e.g. C-x C-o for delete-blank-lines and just-one-space with M-SPC.
i think that these can be merged into a single dwim version with a single shortcut, because i think most of the time context can correctly guess the desired behavior.
i think this applies to few other emacs editing functions for user convenience. One example i came to is about the 9 or so commands on letter case changing. Some work on word, some on region... with transient-mark-mode on now, the region versions could be merged. The lower case and upper case and cap first versions can also be merged, i think, into one dwim version that just cycles.