From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: is this possible using the new rectangle mark mode? Date: Sat, 01 Feb 2014 08:24:16 +0100 Organization: Emacs Helm Message-ID: <87r47npa73.fsf@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1391239482 22410 80.91.229.3 (1 Feb 2014 07:24:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Feb 2014 07:24:42 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 01 08:24:50 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W9Uwa-0001JT-IZ for ged-emacs-devel@m.gmane.org; Sat, 01 Feb 2014 08:24:48 +0100 Original-Received: from localhost ([::1]:60520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Uwa-0000lV-4G for ged-emacs-devel@m.gmane.org; Sat, 01 Feb 2014 02:24:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9UwR-0000kP-Ut for emacs-devel@gnu.org; Sat, 01 Feb 2014 02:24:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9UwJ-0007AT-1o for emacs-devel@gnu.org; Sat, 01 Feb 2014 02:24:39 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:44076) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9UwI-00079k-RR for emacs-devel@gnu.org; Sat, 01 Feb 2014 02:24:30 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W9UwG-00016q-34 for emacs-devel@gnu.org; Sat, 01 Feb 2014 08:24:28 +0100 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Feb 2014 08:24:28 +0100 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 01 Feb 2014 08:24:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 74 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:vL10BRGWmZjCO9noihHfvUk0UZ0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:169314 Archived-At: Stefan Monnier 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