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

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

DWIM when yanking strings with leading or trailing spaces - an idea


From: Marcin Borkowski
Subject: DWIM when yanking strings with leading or trailing spaces - an idea
Date: Thu, 03 Mar 2016 20:31:24 +0100
User-agent: mu4e 0.9.13; emacs 25.1.50.6

Hi folks,

take this example:

--8<---------------cut here---------------start------------->8---
Lorem ipsum -!-dolor sit amet.
--8<---------------cut here---------------end--------------->8---

As usual, -!- denotes the point (which can be here because e.g. of an
earlier C-left).

Now press C-backspace, C-right, C-y.

This is the result:

--8<---------------cut here---------------start------------->8---
Lorem doloripsum  sit amet.
--8<---------------cut here---------------end--------------->8---

Some other text processing software, whose name will not be mentioned,
does "the right thing" in such a case, i.e., produces

--8<---------------cut here---------------start------------->8---
Lorem dolor ipsum sit amet.
--8<---------------cut here---------------end--------------->8---

Why couldn't Emacs do this?  Of course, optionally.  I could spend some
time working on this issue, and e.g. submit the result to Elpa.  Would
anyone be interested?

Of course, this particular example is rather bad, since a simple M-t
would do.  But you get the idea, and quite often transposing is not
enough, e.g., when you want to transform

--8<---------------cut here---------------start------------->8---
aaa bbb ccc ddd eee fff
--8<---------------cut here---------------end--------------->8---

into

--8<---------------cut here---------------start------------->8---
aaa ddd eee bbb ccc fff
--8<---------------cut here---------------end--------------->8---

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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