From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: emacs-devel@gnu.org
Subject: Re: is this possible using the new rectangle mark mode?
Date: Sat, 01 Feb 2014 08:24:16 +0100 [thread overview]
Message-ID: <87r47npa73.fsf@gmail.com> (raw)
In-Reply-To: jwvd2j8yxzv.fsf-monnier+emacs@gnu.org
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
next prev parent reply other threads:[~2014-02-01 7:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r47npa73.fsf@gmail.com \
--to=thierry.volpiatto@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.