From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#18977: 25.0.50; Enhance (fix) incremental `indent-rigidly' Date: Thu, 6 Nov 2014 10:36:27 -0800 (PST) Message-ID: <3394deee-e886-4428-9491-2286fcbbcce2@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1415299114 3478 80.91.229.3 (6 Nov 2014 18:38:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Nov 2014 18:38:34 +0000 (UTC) To: 18977@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 06 19:38:26 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1XmRww-0006cT-EZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Nov 2014 19:38:26 +0100 Original-Received: from localhost ([::1]:55565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRwv-0002i4-VW for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Nov 2014 13:38:25 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52997) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRwj-0002gh-6B for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:38:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmRwY-0005Eh-RH for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:38:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRwY-0005Ed-OB for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XmRwY-0000ll-Eu for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:38:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 Nov 2014 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18977 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14152990232883 (code B ref -1); Thu, 06 Nov 2014 18:38:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 6 Nov 2014 18:37:03 +0000 Original-Received: from localhost ([127.0.0.1]:52057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmRva-0000kO-Cl for submit@debbugs.gnu.org; Thu, 06 Nov 2014 13:37:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:51032) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XmRvY-0000k1-Nr for submit@debbugs.gnu.org; Thu, 06 Nov 2014 13:37:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmRvO-0004ri-2f for submit@debbugs.gnu.org; Thu, 06 Nov 2014 13:37:00 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:44511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRvN-0004re-Vr for submit@debbugs.gnu.org; Thu, 06 Nov 2014 13:36:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRvF-0002d1-4H for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:36:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XmRv6-0004TH-CK for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:36:41 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:24723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XmRv6-0004Sk-4v for bug-gnu-emacs@gnu.org; Thu, 06 Nov 2014 13:36:32 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sA6IaUaY001413 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Nov 2014 18:36:30 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sA6IaRiV025764 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 6 Nov 2014 18:36:28 GMT Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sA6IaRX8004250 for ; Thu, 6 Nov 2014 18:36:27 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95627 1. Please consider adding this binding, so you can simply do `C-x TAB TAB...': (define-key indent-rigidly-map "\t" 'indent-rigidly-right). And update the doc string and prompt, of course. 2. You cannot currently provide a numeric prefix arg to `indent-rigidly' for incremental use. The incremental indentation you get is either 1=20 column (for ) or to the next tab stop (for ). It would be good to be able to use a numeric prefix arg interactively to indent not only once, but each time you hit . Ironically, this was possible before the Emacs 24.4 change to `indent-rigidly' which provided for incremental indenting, by just doing something like this: (defun repeat-command (command) "Repeat COMMAND." (let ((repeat-message-function 'ignore)) (setq last-repeatable-command command) (repeat nil))) (defun indent-rigidly-repeat (start end arg &optional interactive) "Indent all lines that start in the region. You can repeat this by hitting the last key (e.g., `TAB') again... A numeric prefix arg you provide to the command is used as the indentation increment." (interactive "r\nP\np") (require 'repeat nil t) (repeat-command 'indent-rigidly)) (global-set-key [remap indent-rigidly] 'indent-rigidly-repeat) Then `C-3 C-x TAB TAB...' indents 3 columns each time you hit `TAB'; `C-x TAB TAB...' indents 1 column for each `TAB'; and `C- 2 C-x TAB TAB...' outdents 2 columns for each `TAB'. Very handy. This design is simple, and it lets you use the same key, `TAB', to indent or outdent incrementally (outdent by using a negative prefix arg). As written above, this does not, however, provide the useful feature of a single undo for all repeated indenting, as does the current implementation of `indent-rigidly'. And it does not provide for indentation to tab stops. I am not proposing such a simple implementation as a replacement for the current one. This is the request: Could you please adapt `indent-rigidly' to provide similar behavior to that shown above: Instead of using a numeric prefix arg *only* for a single indentation, let users repeat indenting (or outdenting) in prefix-arg steps. 3. A related improvement would be to provide also the other advantage of the above code: Indenting/outdenting is *immediate* for `C-x TAB'. Currently, no indentation is done until you hit (or you use a prefix arg, which turns off incremental indenting). This means that currently you must hit at least 3 keys, `C-x TAB ' or `C-1 C-x TAB', to indent. You cannot hit just `C-x TAB', as you could prior to Emacs 24.4. (This is thus a minor regression in behavior.) The best behavior is for `C-x TAB' to indent by the numerical prefix number of columns, and to continue to do so as long as you continue to hit or `TAB'. should similarly outdent by the prefix arg. A negative prefix arg, and Bidi, should of course flip the direction. (Yes, if `C-x TAB' itself indents immediately then you will need to hit twice to outdent once. Not a big deal, IMO - outweighed by the convenience of not needing to hit 3 keys for the common case of indenting.) I started to take a stab at this myself, but I found no good way to propagate the prefix arg using the current implementation, which does (set-transient-map indent-rigidly-map t). In GNU Emacs 25.0.50.1 (i686-pc-mingw32) of 2014-10-20 on LEG570 Bzr revision: 118168 rgm@gnu.org-20141020195941-icp42t8ttcnud09g Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --enable-checking=3Dyes,glyphs CPPFLAGS=3D-DGLYPH_DEBUG=3D1'