From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.help Subject: Re: Is it possible to move a column where column on right is variable width Date: Tue, 16 May 2017 19:32:33 +0000 Message-ID: References: <0b6f7632-f4c0-47c9-b3fb-b5d554c358c1@googlegroups.com> <87lgpwliqa.fsf@fastmail.fm> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494963201 15570 195.159.176.226 (16 May 2017 19:33:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 16 May 2017 19:33:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Joost Kremers Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 16 21:33:15 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dAiDX-0003mX-DA for geh-help-gnu-emacs@m.gmane.org; Tue, 16 May 2017 21:33:11 +0200 Original-Received: from localhost ([::1]:43651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAiDc-0007TM-Sw for geh-help-gnu-emacs@m.gmane.org; Tue, 16 May 2017 15:33:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dAiDA-0007T6-3I for help-gnu-emacs@gnu.org; Tue, 16 May 2017 15:32:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dAiD9-0004DH-1V for help-gnu-emacs@gnu.org; Tue, 16 May 2017 15:32:48 -0400 Original-Received: from mail-lf0-x22f.google.com ([2a00:1450:4010:c07::22f]:34919) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dAiD8-0004Bg-LU for help-gnu-emacs@gnu.org; Tue, 16 May 2017 15:32:46 -0400 Original-Received: by mail-lf0-x22f.google.com with SMTP id j1so25478833lfh.2 for ; Tue, 16 May 2017 12:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=W5rcdo4lhYJnQv+2ZYiSk1SZlnwizy2qXAASPqPVl9M=; b=IzLFjMvWJlWIRnOVrALp1T7I7DhYFS3yIBFZUM2lQo6kz4V55D9hMwcc/y1OY+V6zl 0/F+KzKep+DO/LNcWySTN+RnnShjNjvJym2cvNKJuAZuLilGA2swmVb2+hdBhHLFCdwS glT6k71drg5AJVAxzjqCqoXOKU2ubgZoCOKPiiKqTP41YdshBX5FP/q2huUl9fjxyWXp ZYuZxGElW+OnQJX3kxh4QlDZn2IQzw4IqVrvzPPrsM5GzJrsp07UgfX3UxBrkCjhfx+d Yv6P1OFMBzNiNdpWrgnvsdCZtuyI9OzolpSKuJToUAed9eTj+TDEshjmc+5fvvyc9coK 790g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=W5rcdo4lhYJnQv+2ZYiSk1SZlnwizy2qXAASPqPVl9M=; b=VHJtQ448PIomTH0Y1HdJXkSQ2o8gM3ppIGgH8wjNS8eZPmFlGieore9yLriFC86uAJ L/vVpW6fSO0ACQeTPEjPZ+7h3GoVkVXN4tz25mWmytQG8e718kB8hbgb93AfzK1X5m01 Q5mskp6ht2LlP+siTpeN2ldfTLPDa3WsSIIaL/70vqV2WkN5FdcbEkm//j3z/Rg3Fsf1 5I35P1PmQYcCBsGB8D0g1fI1786d+iuGuYVp49NvNby8jMjZit7/ogkK06WfzxPQnQ1p v2P9hPXJ1LDDHNb8Ly8k7cFfXqra970mPkuR9ElarHI3UpXb9OxUZ8anfiMlvgNJOL7a lLlQ== X-Gm-Message-State: AODbwcB/Wzjhijsnyjdvn9gdEHALh6t/p3DGMTXXhg6eLvck04M68fph W8BqC/rzwZw6XGUUPJwnArMaLNenwA== X-Received: by 10.46.84.94 with SMTP id y30mr3909278ljd.114.1494963165180; Tue, 16 May 2017 12:32:45 -0700 (PDT) In-Reply-To: <87lgpwliqa.fsf@fastmail.fm> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22f X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113039 Archived-At: On Tue, May 16, 2017 at 3:11 PM Joost Kremers wrote: > > As the Description portion of the data is not of equal width, > > using > > rectanges gets tricky. > > Unless you do the totally uncool thing of adding enough spaces to > the final line so that you can create a rectangle of the > appropriate size. It'll cost you some geek points, but it gets the > job done. ;-) > I had ended up doing a "thesis" on that topic a while back. The resultant solution adds the right number of spaces temporarily to get the widest required rectangle without modifying the buffer :) https://github.com/kaushalmodi/.emacs.d/blob/df25c8cd0d84ec2af647e92db2c0c1= 9e3097d035/setup-files/setup-editing.el#L507-L630 The main logic is inside modi/extend-rectangle--core, but then I apply it to different function to "do the right thing". >From the doc-string of modi/advice-select-rectangle-to-end in that code: "Extract the rectangle so that the longest line of region is completely included when the prefix \\[universal-argument] is used. In the below example, =E2=96=AF is the mark and =E2=96=AE is the point. a =3D=E2=96=AF12345; b =3D 6;=E2=96=AE If that region is selected and if we do \\[copy-rectangle-as-kill], the following rectangle gets copied: 12 6; .. which was not the intention. But with this advice, \\[universal-argument] \\[copy-rectangle-as-kill] on that same region will copy the below rectangle: 12345; 6; .. which obviously was the actual intention. Similar rectangle extension behavior is applied when using the prefix \\[universal-argument] with similarly advised functions too." --=20 Kaushal Modi