unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* DWIM when yanking strings with leading or trailing spaces - an idea
@ 2016-03-03 19:31 Marcin Borkowski
  2016-03-03 19:45 ` Kaushal Modi
  0 siblings, 1 reply; 8+ messages in thread
From: Marcin Borkowski @ 2016-03-03 19:31 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-04 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.6655.1457033503.843.help-gnu-emacs@gnu.org>
2016-03-03 23:25 ` DWIM when yanking strings with leading or trailing spaces - an idea Joost Kremers
2016-03-04  6:06   ` Marcin Borkowski
     [not found]   ` <mailman.6683.1457071595.843.help-gnu-emacs@gnu.org>
2016-03-04  8:50     ` Joost Kremers
2016-03-04  9:11       ` Marcin Borkowski
     [not found]       ` <mailman.6691.1457083030.843.help-gnu-emacs@gnu.org>
2016-03-04  9:45         ` Joost Kremers
2016-03-04 12:57           ` Marcin Borkowski
2016-03-03 19:31 Marcin Borkowski
2016-03-03 19:45 ` Kaushal Modi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).