all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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
[parent not found: <mailman.6655.1457033503.843.help-gnu-emacs@gnu.org>]

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 --
2016-03-03 19:31 DWIM when yanking strings with leading or trailing spaces - an idea Marcin Borkowski
2016-03-03 19:45 ` Kaushal Modi
     [not found] <mailman.6655.1457033503.843.help-gnu-emacs@gnu.org>
2016-03-03 23:25 ` 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.