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

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

bug#19267: 25.0.50; Enhance cycle-spacing with a state where only whites


From: Lars Ingebrigtsen
Subject: bug#19267: 25.0.50; Enhance cycle-spacing with a state where only whitespace after point is deleted
Date: Thu, 12 May 2022 04:16:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Tassilo Horn <tsdh@gnu.org> writes:

> I like the new `cycle-spacing' command but I frequently would like to
> have an additional space where only the whitespace after point is
> deleted.  That'd be useful when manually formatting text (code) where
> auto-indentation isn't available.  My prime use-case is laying out
> example code snippets in comments and docstrings which I copied & pasted
> from somewhere else.  E.g., I start with a docstring
>
>   "Example:
>
>      (let [x :something]
>        |                  (foo x)
>                           (bar x))"
>
> where | is the position of point.  In that case, I'd like if M-SPC would
> change the text to
>
>   "Example:
>
>      (let [x :something]
>        |(foo x)
>                           (bar x))"
>
> instead of
>
>   "Example:
>
>      (let [x :something]
>  |(foo x)
>                           (bar x))"
>
> i.e., it first M-SPC only deletes whitespace after point but not before.
> I don't really care if that's the first state (although that would be
> plausible, i.e., states are cycled from more space to less spaces), but
> at least it should be a reachable state.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

I think that sounds like a good feature -- we don't have any other
commands for "delete all whitespace after point", do we?

We could implement this as a new third state for `cycle-spacing', and
move the "restore" to the fourth state.  Does anybody think that will be
annoying for people?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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