* is this possible using the new rectangle mark mode?
@ 2014-01-31 13:39 Darren Hoo
2014-01-31 15:28 ` Stefan Monnier
2014-01-31 19:50 ` Tim Visher
0 siblings, 2 replies; 7+ messages in thread
From: Darren Hoo @ 2014-01-31 13:39 UTC (permalink / raw)
To: emacs-devel
kill a rectangle marked region ending with a line that is not the
longest line like:
aaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbb
ccccccccc
and yank it to these lines:
1
2
3
and I want it to be either this:
aaaaaaaaaaaaaaaaaaaaa1
bbbbbbbbbbbbbbbb2
ccccccccc3
or this one:
aaaaaaaaaaaaaaaaaaaaa1
bbbbbbbbbbbbbbbb 2
ccccccccc 3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: is this possible using the new rectangle mark mode?
2014-01-31 13:39 is this possible using the new rectangle mark mode? Darren Hoo
@ 2014-01-31 15:28 ` Stefan Monnier
2014-02-01 7:24 ` Thierry Volpiatto
2014-01-31 19:50 ` Tim Visher
1 sibling, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2014-01-31 15:28 UTC (permalink / raw)
To: Darren Hoo; +Cc: emacs-devel
> kill a rectangle marked region ending with a line that is not the
> longest line like:
> aaaaaaaaaaaaaaaaaaaaa
> bbbbbbbbbbbbbbbb
> ccccccccc
The "new rectangle-mark-mode" just provides a different UI to the
same old rectangle commands available since forever. So yes for the
above: put point before the first "c" then C-x SPC then move cursor to
after the last "a" and finally C-w.
> and yank it to these lines:
> 1
> 2
> 3
Yup: put point before "1" and hit C-y.
> and I want it to be either this:
> aaaaaaaaaaaaaaaaaaaaa1
> bbbbbbbbbbbbbbbb2
> ccccccccc3
No, this is not a rectangle.
> or this one:
> aaaaaaaaaaaaaaaaaaaaa1
> bbbbbbbbbbbbbbbb 2
> ccccccccc 3
Yes, that's the one you should get.
And yes, the first question's answer would have been "no" if the longest
line was the "bbb" one.
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: is this possible using the new rectangle mark mode?
2014-01-31 13:39 is this possible using the new rectangle mark mode? Darren Hoo
2014-01-31 15:28 ` Stefan Monnier
@ 2014-01-31 19:50 ` Tim Visher
1 sibling, 0 replies; 7+ messages in thread
From: Tim Visher @ 2014-01-31 19:50 UTC (permalink / raw)
To: Darren Hoo; +Cc: Emacs Development List
On Fri, Jan 31, 2014 at 8:39 AM, Darren Hoo <darren.hoo@gmail.com> wrote:
> kill a rectangle marked region ending with a line that is not the
> longest line like:
>
> aaaaaaaaaaaaaaaaaaaaa
> bbbbbbbbbbbbbbbb
> ccccccccc
>
> and yank it to these lines:
>
> 1
> 2
> 3
>
> and I want it to be either this:
>
> aaaaaaaaaaaaaaaaaaaaa1
> bbbbbbbbbbbbbbbb2
> ccccccccc3
>
> or this one:
>
> aaaaaaaaaaaaaaaaaaaaa1
> bbbbbbbbbbbbbbbb 2
> ccccccccc 3
You might want to check out multiple-cursors. I think it does this
sort of thing.
--
In Christ,
Timmy V.
http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: is this possible using the new rectangle mark mode?
2014-01-31 15:28 ` Stefan Monnier
@ 2014-02-01 7:24 ` Thierry Volpiatto
2014-02-01 20:54 ` Rasmus
0 siblings, 1 reply; 7+ messages in thread
From: Thierry Volpiatto @ 2014-02-01 7:24 UTC (permalink / raw)
To: emacs-devel
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> kill a rectangle marked region ending with a line that is not the
>> longest line like:
>
>> aaaaaaaaaaaaaaaaaaaaa
>> bbbbbbbbbbbbbbbb
>> ccccccccc
>
> The "new rectangle-mark-mode" just provides a different UI to the
> same old rectangle commands available since forever. So yes for the
> above: put point before the first "c" then C-x SPC then move cursor to
> after the last "a" and finally C-w.
>
>> and yank it to these lines:
>
>> 1
>> 2
>> 3
>
> Yup: put point before "1" and hit C-y.
>
>> and I want it to be either this:
>
>> aaaaaaaaaaaaaaaaaaaaa1
>> bbbbbbbbbbbbbbbb2
>> ccccccccc3
>
> No, this is not a rectangle.
>
>> or this one:
>
>> aaaaaaaaaaaaaaaaaaaaa1
>> bbbbbbbbbbbbbbbb 2
>> ccccccccc 3
>
> Yes, that's the one you should get.
>
> And yes, the first question's answer would have been "no" if the longest
> line was the "bbb" one.
Just tried the new rectangle-mark-mode and I like it.
For the above what you need is a `extend-rectangle-to-end' function:
Mark a small rectangle on the first characters and
extend it to end (bound here to C-x r e):
bbbbbbbbbbbbbbbb
aaaaaaaaaaaaaaaaaaaaa
ccccccccc
now you have (marked):
bbbbbbbbbbbbbbbb
aaaaaaaaaaaaaaaaaaaaa
ccccccccc
Hit C-x r k
Go to 1 and C-x r y
bbbbbbbbbbbbbbbb 1
aaaaaaaaaaaaaaaaaaaaa2
ccccccccc 3
You can find this function at:
https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/rectangle-utils.el
--
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997
^ permalink raw reply [flat|nested] 7+ messages in thread
* is this possible using the new rectangle mark mode?
@ 2014-02-01 8:30 Barry OReilly
0 siblings, 0 replies; 7+ messages in thread
From: Barry OReilly @ 2014-02-01 8:30 UTC (permalink / raw)
To: darren.hoo; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 46 bytes --]
See also: http://stackoverflow.com/a/14046463
[-- Attachment #2: Type: text/html, Size: 125 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: is this possible using the new rectangle mark mode?
2014-02-01 7:24 ` Thierry Volpiatto
@ 2014-02-01 20:54 ` Rasmus
2014-02-02 1:10 ` Stefan Monnier
0 siblings, 1 reply; 7+ messages in thread
From: Rasmus @ 2014-02-01 20:54 UTC (permalink / raw)
To: emacs-devel
Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:
>> And yes, the first question's answer would have been "no" if the longest
>> line was the "bbb" one.
>
> Just <tried the new rectangle-mark-mode and I like it.
>
> For the above what you need is a `extend-rectangle-to-end' function:
> [...]
> You can find this function at:
>
> https://github.com/thierryvolpiatto/emacs-tv-config/blob/master/rectangle-utils.el
That's nice. I usually have long middle lines. I really miss
something like cua-resize-rectangle-right in 'normal' rectangle mode,
which I otherwise prefer, but perhaps extend-rectangle-to-end is all I
need.
–Rasmus
--
Summon the Mothership!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: is this possible using the new rectangle mark mode?
2014-02-01 20:54 ` Rasmus
@ 2014-02-02 1:10 ` Stefan Monnier
0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2014-02-02 1:10 UTC (permalink / raw)
To: Rasmus; +Cc: emacs-devel
> That's nice. I usually have long middle lines. I really miss
> something like cua-resize-rectangle-right in 'normal' rectangle mode,
> which I otherwise prefer, but perhaps extend-rectangle-to-end is all I
> need.
FWIW, as part of the rectangle-mark-mode changes, I've made a few
changes to cua-rect to fix some interactions with the new code, which
also made it take advantage of some of the infrastructure introduced for
rectangle-mark-mode.
And AFAICT, cua-rect.el is now pretty close to being usable on its own
(without cua-mode).
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-02-02 1:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-31 13:39 is this possible using the new rectangle mark mode? Darren Hoo
2014-01-31 15:28 ` Stefan Monnier
2014-02-01 7:24 ` Thierry Volpiatto
2014-02-01 20:54 ` Rasmus
2014-02-02 1:10 ` Stefan Monnier
2014-01-31 19:50 ` Tim Visher
-- strict thread matches above, loose matches on Subject: below --
2014-02-01 8:30 Barry OReilly
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.