From unknown Sat Aug 16 20:56:29 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8196 <8196@debbugs.gnu.org> To: bug#8196 <8196@debbugs.gnu.org> Subject: Status: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Reply-To: bug#8196 <8196@debbugs.gnu.org> Date: Sun, 17 Aug 2025 03:56:29 +0000 retitle 8196 23.1; Feature request with code: "C-x TAB" to understand tab-s= top-list reassign 8196 emacs submitter 8196 Teemu Likonen severity 8196 wishlist thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 07 13:19:45 2011 Received: (at submit) by debbugs.gnu.org; 7 Mar 2011 18:19:45 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pwf21-0002GE-BM for submit@debbugs.gnu.org; Mon, 07 Mar 2011 13:19:45 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pwf1y-0002G1-WF for submit@debbugs.gnu.org; Mon, 07 Mar 2011 13:19:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pwf1r-0006jB-KV for submit@debbugs.gnu.org; Mon, 07 Mar 2011 13:19:37 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:40598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pwf1r-0006j5-I6 for submit@debbugs.gnu.org; Mon, 07 Mar 2011 13:19:35 -0500 Received: from [140.186.70.92] (port=57829 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pwf1p-0007Hk-Lq for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 13:19:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pwf1o-0006iF-7t for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 13:19:33 -0500 Received: from mta-out.inet.fi ([195.156.147.13]:53638 helo=jenni2.inet.fi) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pwf1n-0006hl-VC for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 13:19:32 -0500 Received: from imladris.arda (84.251.132.215) by jenni2.inet.fi (8.5.133) id 4D061FFC03D13B28 for bug-gnu-emacs@gnu.org; Mon, 7 Mar 2011 20:19:30 +0200 Received: from dtw by imladris.arda with local (Exim 4.69) (envelope-from ) id 1Pwf1W-0002ZB-EO for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2011 20:19:14 +0200 From: Teemu Likonen To: bug-gnu-emacs@gnu.org Subject: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Date: Mon, 07 Mar 2011 20:19:13 +0200 Message-ID: <87d3m2equ6.fsf@imladris.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) I think it would be better if "C-x TAB" (bound to indent-rigidly) advanced the indentation to the next tab stop (as in tab-stop-list) by default, instead of by 1. Similarly, if negative prefix argument were given (with "C-u -") it would change the indentation to the previous tab stop. Only when the prefix argument is actual number, positive or negative integer, it would move the indentation to the left or right by the given count. To demonstrate this I have written the following functions. Function tl-indent-region is a kind of replacement for indent-rigidly, so it can be bound to "C-x TAB". --8<---------------cut here---------------start------------->8--- (global-set-key (kbd "C-x TAB") #'tl-indent-region) (defun tl-region-indentation (beg end) "Return the smallest indentation in range from BEG to END. Blank lines are ignored." (save-excursion (let ((beg (progn (goto-char beg) (line-beginning-position))) indent) (goto-char beg) (while (re-search-forward "^\\s-*[[:print:]]" end t) (setq indent (min (or indent (current-indentation)) (current-indentation)))) indent))) (defun tl-indent-region-engine (beg end arg) "Back-end function for `tl-indent-region'." (interactive "r\nP") (let* ((beg (save-excursion (goto-char beg) (line-beginning-position))) (current (tl-region-indentation beg end)) (indent (cond ((not arg) (- (catch 'answer (dolist (col tab-stop-list (1+ current)) (when (> col current) (throw 'answer col)))) current)) ((eq arg '-) (- (catch 'answer (dolist (col (reverse tab-stop-list) 0) (when (< col current) (throw 'answer col)))) current)) (t (prefix-numeric-value arg))))) (indent-rigidly beg end indent))) (defun tl-indent-region (beg end arg) "Indent region to a tab stop column or to a specified column. Indent the region from BEG to END according to the command's prefix argument ARG. If ARG is nil (i.e., there is no prefix argument) indent the region to the next tab stop column in `tab-stop-list'. With negative prefix ARG (C-u -) indent the region to the previous tab stop column. If ARG is an integer indent the region by ARG columns (just like `indent-rigidly' command). If this command is invoked by a multi-character key sequence, it can be repeated by repeating the final character of the sequence." (interactive "r\nP") (require 'repeat) (let ((repeat-message-function #'ignore)) (setq last-repeatable-command #'tl-indent-region-engine) (repeat nil))) --8<---------------cut here---------------end--------------->8--- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 21 03:42:15 2012 Received: (at submit) by debbugs.gnu.org; 21 Apr 2012 07:42:15 +0000 Received: from localhost ([127.0.0.1]:45049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLUxT-0006Kz-7Y for submit@debbugs.gnu.org; Sat, 21 Apr 2012 03:42:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55441) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SLUxQ-0006Kk-G3 for submit@debbugs.gnu.org; Sat, 21 Apr 2012 03:42:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLUwq-0002sR-S0 for submit@debbugs.gnu.org; Sat, 21 Apr 2012 03:41:37 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:41804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLUwq-0002sM-Ol for submit@debbugs.gnu.org; Sat, 21 Apr 2012 03:41:36 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLUwp-00070G-6x for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 03:41:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SLUwn-0002s9-KH for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 03:41:34 -0400 Received: from moutng.kundenserver.de ([212.227.126.171]:59604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SLUwn-0002rz-Aj for bug-gnu-emacs@gnu.org; Sat, 21 Apr 2012 03:41:33 -0400 Received: from [192.168.178.27] (brln-4dbc45f8.pool.mediaWays.net [77.188.69.248]) by mrelayeu.kundenserver.de (node=mreu4) with ESMTP (Nemesis) id 0LqacI-1RhVV31zm6-00dm4b; Sat, 21 Apr 2012 09:41:31 +0200 Message-ID: <4F9264AA.1050107@easy-emacs.de> Date: Sat, 21 Apr 2012 09:41:30 +0200 From: =?ISO-8859-1?Q?Andreas_R=F6hler?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.2.28) Gecko/20120306 SUSE/3.1.20 Thunderbird/3.1.20 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: Re: bug#8196 References: <87r4vmy7un.fsf@ypig.lip.ens-lyon.fr> <20120417233722.GK3626@xvii.vinc17.org> <20120418004546.GL3626@xvii.vinc17.org> In-Reply-To: <20120418004546.GL3626@xvii.vinc17.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:lLqFevnpmUzmAaSBm8cnzIyDvP9YM2jwK5jsjTZlqSw h9d5fW/l2RzzPj4CQB+Biee3v4CYg+AvTpK2YBUGeopm1bOJ/u SrAmhOxPevIpl50vkGU3anlB+Vd8eNbOViEeZunJAHdzBUqtl7 97YLwPS8o+PdG8xA9bYfXOVg/Ik+smfKKe1fbVC4+ucKGacmsD JfBWV17Am0a2VfAV65w2t7y1P4Hi25WaMBoPAJ+7mPi9WikssJ UqrEEFdjguAe26gALKKGNr772OAkbWi3zjgU1S8A+ahFiNiysI w4jiRMfTZXlGSbCLP4i/KZxFnHDzjjTCBTq+PNvj3yFk8qr4sA V3IFV2SY47FJJcrHJUiOyMVuAD1AjA9C1cSVuiXJv X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) IMO it's an interesting proposal What about binding that at `indent-tabs-mode'? If the default just changes, bug-reports resp. feature requests may drop in from the other side than. Andreas From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 13:19:53 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 17:19:53 +0000 Received: from localhost ([127.0.0.1]:50945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxh0a-0008NM-MU for submit@debbugs.gnu.org; Fri, 12 Jul 2013 13:19:53 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:34693 helo=kirsi1.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxh0X-0008NC-Ic for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 13:19:50 -0400 Received: from mithlond.arda (84.251.134.110) by kirsi1.inet.fi (8.5.140.03) id 51BB5BE3020F99CB for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 20:19:47 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1Uxh0V-0001NV-9y for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 20:19:47 +0300 From: Teemu Likonen To: 8196@debbugs.gnu.org Subject: Re: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: <87d3m2equ6.fsf@imladris.arda> (Teemu Likonen's message of "Mon, 07 Mar 2011 20:19:13 +0200") References: <87d3m2equ6.fsf@imladris.arda> Date: Fri, 12 Jul 2013 20:19:43 +0300 Message-ID: <87oba74rww.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain Teemu Likonen [2011-03-07 20:19:13 +02:00] wrote: > I think it would be better if "C-x TAB" (bound to indent-rigidly) > advanced the indentation to the next tab stop (as in tab-stop-list) by > default, instead of by 1. Similarly, if negative prefix argument were > given (with "C-u -") it would change the indentation to the previous > tab stop. Only when the prefix argument is actual number, positive or > negative integer, it would move the indentation to the left or right > by the given count. Any opinions on this? If you want to use the code in my first message just go on. The copyright assignment paperwork is done. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iQIbBAEBCAAGBQJR4DqvAAoJEHGdadMkU5RQtasP+LyWVa21aoFsTdoTWojxWFjx MSmiescltkRGn/35XJ14w0sj+BLlu3xDekJL01r0daa+yYNxc5dVrJiO69IaFxL7 vBzBjeHNCwt1YvL49g6IDOPq4DD43dSFexbJ3sMlTttC2ECtNtHNmu9lIYhNn/kt cnui1Ut4083dsu4akA5Wnc2Fx91vHw62XFig2Ks+bNxsKIInAWyuSJuZAnaReRvT F+NVFyuJnKTwJEHWOzLFc7LpERTyHto+p/1wEDYT99MvGF5fHmuAIFQS6ccMfT0v beJXijVC6TFY5JAn8/Y3o0hr6oJZdJGsfGn/JRn8/M8yvQdGLyhrK59w2qVoLYI/ d02ywijAnuyXYmLwAKU023JZb/tRW8kSa4rD7ofiw9pMmUBCwD0tJMhLQFZSyQ3c K6Y2uU9llMV4t5XVfY83zsRjlgapbj4tJr+U2B7nqQIcrqZk5qROw1JInzsV4eCz t4+ZyHKtI1/zI86maj5rBQeHr6Wdx1LwtV7pG4sOus99wn65a3PrpfLUevw9Xc7h o7EKt/SkWSGcJugGhSMik+vKigg4ihBIC3oWHkR5HQRUA0h/ldLwP6hW/1JsuAvK Ur5934FSraHSh0Swh0QHZX52bEUD3Sj+9aeWPLRz0cHMalGskFmfL6nI925PWNDb UHbriml5mDLn5xHoBF4= =Dtm/ -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 15:11:45 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 19:11:45 +0000 Received: from localhost ([127.0.0.1]:51127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxikq-0003Ys-G1 for submit@debbugs.gnu.org; Fri, 12 Jul 2013 15:11:44 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:46526) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxikn-0003YU-F4 for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 15:11:42 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6CJBYIQ003074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Jul 2013 19:11:35 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CJBXRa006018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jul 2013 19:11:34 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CJBX90006011; Fri, 12 Jul 2013 19:11:33 GMT MIME-Version: 1.0 Message-ID: <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> Date: Fri, 12 Jul 2013 12:11:31 -0700 (PDT) From: Drew Adams To: Teemu Likonen , 8196@debbugs.gnu.org Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> In-Reply-To: <87oba74rww.fsf@mithlond.arda> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > > I think it would be better if "C-x TAB" (bound to indent-rigidly) > > advanced the indentation to the next tab stop (as in tab-stop-list) by > > default, instead of by 1. Similarly, if negative prefix argument were > > given (with "C-u -") it would change the indentation to the previous > > tab stop. Sorry, that does not make sense to me. What is the "next" or "previous" tab stop? Relative to what/where? `indent-rigidly' is for indenting the lines in the region, all of which might all be currently indented to different columns. Do you pick the indentation of one of those lines to measure the "next" or "previous" tab stop from? If so, which one? Or do you measure from point (in which case it matters which end of the region point is. Even if you abandon the notion of a next/previous tab stop, because there is no good answer to "Next/previous to what?", you still have a problem if you intend to indent to ANY particular tab stop. You cannot indent line= s RIGIDLY to any particular tab stop, unless they all happen to be indented t= o the same column to begin with. Otherwise, "to" any column has no sense. Indenting rigidly is about indenting a particular amount, not indenting to some column. What you can do is indent the region rigidly a certain number of tab stops (either direction). For that, see below. > > Only when the prefix argument is actual number, positive or > > negative integer, it would move the indentation to the left or right > > by the given count. >=20 > Any opinions on this? If you want to use the code in my first message > just go on. The copyright assignment paperwork is done. I am definitely against such a change, regardless of what you might actuall= y mean by the next/previous tab stop. Such a change would not be great for interactive use, and it would certainl= y be bad for Lisp use. Existing code depends on the current behavior. If you want a command that indents rigidly a certain number of tab stops (a= nd not TO a particular tab stop), that is easy enough to define. Here is one such definition. The prefix arg specifies the number of tab stops to inden= t, and a negative number means count backwards from the end of `tab-stop-list'= : (defun indent-rigidly-to-tab-stop (start end nth) "Indent the region rigidly according to the NTH tab stop. `tab-stop-list' defines the available tab stops. NTH is the numeric prefix arg. One means indent rigidly the amount given by the first tab stop. If NTH is negative then indent negatively (outdent)." (interactive "r\np") (unless (zerop nth) (let ((tabstop (nth (mod (1- (abs nth)) (length tab-stop-list)) tab-stop-list))) (indent-rigidly start end (if (natnump nth) tabstop (- tabstop)))))) From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 15:19:02 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 19:19:02 +0000 Received: from localhost ([127.0.0.1]:51134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxirt-0003mc-Lz for submit@debbugs.gnu.org; Fri, 12 Jul 2013 15:19:02 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:30902) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxirr-0003mI-9D for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 15:18:59 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6CJIqcP012285 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Jul 2013 19:18:53 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CJIqqn008853 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jul 2013 19:18:52 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CJIqHl008846; Fri, 12 Jul 2013 19:18:52 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 12 Jul 2013 12:18:50 -0700 (PDT) From: Drew Adams To: Teemu Likonen , 8196@debbugs.gnu.org Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> In-Reply-To: <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > If you want a command that indents rigidly a certain number of tab stops.= .. >=20 > (defun indent-rigidly-to-tab-stop (start end nth) Clearly I used a bad name. Should have used something like `indent-rigidly-tab-stops'. It specifically does NOT try to indent TO any tab stop. Sorry about that. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 16:05:12 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 20:05:12 +0000 Received: from localhost ([127.0.0.1]:51240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxjaZ-0005Ey-Mg for submit@debbugs.gnu.org; Fri, 12 Jul 2013 16:05:12 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:60512 helo=kirsi1.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxjaV-0005Em-MM for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 16:05:09 -0400 Received: from mithlond.arda (84.251.134.110) by kirsi1.inet.fi (8.5.140.03) id 51BB5BE302110459; Fri, 12 Jul 2013 23:05:02 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1UxjaO-0001k6-2r; Fri, 12 Jul 2013 23:05:00 +0300 From: Teemu Likonen To: Drew Adams Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> (Drew Adams's message of "Fri, 12 Jul 2013 12:11:31 -0700 (PDT)") References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> Date: Fri, 12 Jul 2013 23:05:00 +0300 Message-ID: <87k3kv4k9f.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Drew Adams [2013-07-12 12:11:31 -07:00] wrote: >>> I think it would be better if "C-x TAB" (bound to indent-rigidly) >>> advanced the indentation to the next tab stop (as in tab-stop-list) >>> by default, instead of by 1. Similarly, if negative prefix argument >>> were given (with "C-u -") it would change the indentation to the >>> previous tab stop. > > Sorry, that does not make sense to me. First, here's some reference where this came from: http://lists.gnu.org/archive/html/help-gnu-emacs/2011-03/msg00243.html The feature supersedes indent-rigidly. If filed this wishlist bug report because Stefan Monnier suggested so: Indeed, it sounds like a good improvement to the behavior of C-x TAB. Maybe you could propose it for inclusion via M-x report-emacs-bug. Here's a concrete use-case. Let's say my tab-stop-list variable is like (4 8 12 16 20 etc.). I'm in a message-mode buffer writing some email or news message which is about Lisp programming. I copy a piece of code from some other buffer, like this: (defun foo (bar) (setq some-variable some-value) (some-function-call bar) ...) I want to indent it so that it stands out from my normal text. I mark the code piece with M-h and press C-x TAB (which runs my improved indent-rigidly). It results in this: (defun foo (bar) (setq some-variable some-value) (some-function-call bar) ...) The lowest indentation of that paragraph is now column 4. If I had kept repeating TAB key the code would have been indented to columns 8, 12, 16 etc. as the tab-stop-list variable defines. The doc string of that command could be like this: Indent region to a tab stop column or to the specified column. Indent the region from BEG to END according to the command's prefix argument ARG. If ARG is nil (i.e., there is no prefix argument) indent the region to the next tab stop column in `tab-stop-list'. With negative prefix ARG (C-u -) indent the region to the previous tab stop column. If ARG is an integer indent the region by ARG columns (just like `indent-rigidly' command). If this command is invoked by a multi-character key sequence, it can be repeated by repeating the final character of the sequence. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 17:18:40 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 21:18:40 +0000 Received: from localhost ([127.0.0.1]:51285 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxkjf-0007hc-LI for submit@debbugs.gnu.org; Fri, 12 Jul 2013 17:18:40 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:21071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxkjd-0007hK-3P for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 17:18:37 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6CLIUGN018544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 12 Jul 2013 21:18:31 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CLISrQ025051 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Jul 2013 21:18:29 GMT Received: from abhmt108.oracle.com (abhmt108.oracle.com [141.146.116.60]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6CLISNE028546; Fri, 12 Jul 2013 21:18:28 GMT MIME-Version: 1.0 Message-ID: <9e30b1da-e346-420f-9d60-698925e50a59@default> Date: Fri, 12 Jul 2013 14:18:27 -0700 (PDT) From: Drew Adams To: Teemu Likonen Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> <87k3kv4k9f.fsf@mithlond.arda> In-Reply-To: <87k3kv4k9f.fsf@mithlond.arda> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > http://lists.gnu.org/archive/html/help-gnu-emacs/2011-03/msg00243.html OK, so you take as the reference column the indentation of the leftmost line. Without some such specification what you described earlier was incomplete. > Here's a concrete use-case.... My point is that this does not belong in `indent-rigidly'. Create a new command for it. That's all. `indent-rigidly' is a very old function that is used not only interactively but in Lisp code. There's no telling how much existing code out there might use the fact that ARG =3D nil indents one column. > The feature supersedes indent-rigidly. I don't think so. And I hope not. It is a different function. Superseding means nothing useful is lost. In this case what is lost is the default behavior (ARG =3D nil) that you are replacing. Depending on the context and the user, that lost behavior is at least as useful as its replacement. What you can propose instead is that your new command get the traditional binding for `indent-rigidly', `C-x TAB'. What we should not do is replace the current `indent-rigidly' behavior by the proposed behavior in the same command. Steal the key, perhaps, but not the command. A mix would also be possible, but less desirable IMO: modify `indent-rigidly' to provide the new behavior only interactively, never when used in code. That has the disadvantage of not letting code take advantage of the indentation-to-tab-stop behavior. I think it best to provide a separate command. A separate command also lets any user who prefers the current default behavior interactively to bind `indent-rigidly', instead of your command, to `C-x TAB'. You find it handy to indent to a tab stop by default (ARG =3D nil), and then repeat (e.g., C-x z z z z). Someone else might find it handier to indent one column instead of one tab stop by default, and then repeat to indent the region incrementally. FWIW, I would no doubt do that (but that has nothing to do with why I replied to this thread), since I never use tab stops and I do indent regions rigidly and incrementally. Just one opinion. Two separate commands provide more options for users, including Lisp coders. I do not object to your appropriating `C-x TAB' for the new command. But please do not touch the existing command. I would also suggest polling the users wrt the key binding. It's not obvious a priori that more people will want to indent via tab stops. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 12 18:51:46 2013 Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 22:51:46 +0000 Received: from localhost ([127.0.0.1]:51382 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxmBl-0002J9-SC for submit@debbugs.gnu.org; Fri, 12 Jul 2013 18:51:46 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:41959) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxmBi-0002Il-4X for 8196@debbugs.gnu.org; Fri, 12 Jul 2013 18:51:42 -0400 Received: by mail-pb0-f44.google.com with SMTP id uo1so9495157pbc.17 for <8196@debbugs.gnu.org>; Fri, 12 Jul 2013 15:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=A6JogUNaRXwHf4t93DDETrxw36XUxx65E9RXWAjONCc=; b=tHwsG9bRX4WcP/IeZ8pR3wPrdPmkL6NXBhuQGejoeZKBvCLqD+uR8wQvqbv/OY5Gc1 42i+1ovYPPavoOT1+fb869cgJ2Qg4Ii6sHaFWWckuRsz1ToUwBYM4+4DisplZpmX9BYs gHuqvjQhWs8Bw9G9KNEvlLwDVEymnkAkvYzNLtlWZn8IGJlFHWj83mjZpQo0PL952JNW gbqF+vkg3rcivYP5hqAhvF2mZzrVlTsWAZm2tFGDieI1suL60tEcyldWarMpB6Hv/NDS tSZ/r1FpiiiLK2XqeJx2tltMm66E6yTwcghiY6Wk6UXkWnpXr/bhxRbXH1dcQk4NtexQ r4tQ== X-Received: by 10.68.171.99 with SMTP id at3mr44431968pbc.64.1373669496027; Fri, 12 Jul 2013 15:51:36 -0700 (PDT) Received: from debian-6.05 ([115.242.249.161]) by mx.google.com with ESMTPSA id re16sm50231035pac.16.2013.07.12.15.51.30 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Fri, 12 Jul 2013 15:51:35 -0700 (PDT) From: Jambunathan K To: Drew Adams Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> <87k3kv4k9f.fsf@mithlond.arda> <9e30b1da-e346-420f-9d60-698925e50a59@default> Date: Sat, 13 Jul 2013 04:23:00 +0530 In-Reply-To: <9e30b1da-e346-420f-9d60-698925e50a59@default> (Drew Adams's message of "Fri, 12 Jul 2013 14:18:27 -0700 (PDT)") Message-ID: <87mwprl7ar.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 8196 Cc: Teemu Likonen , 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Drew Adams writes: > FWIW, I would no doubt do that (but that has nothing to do with why I > replied to this thread), since I never use tab stops and I do indent > regions rigidly and incrementally. (I have no opinion on the proposed feature though.) My usual invocation is C-4 C-x TAB Sometimes, I just open a rectangle of required width. C-x r o I prefer *not* to rely on tab stops. So I am with Drew on this. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 00:49:44 2013 Received: (at 8196) by debbugs.gnu.org; 13 Jul 2013 04:49:44 +0000 Received: from localhost ([127.0.0.1]:51797 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UxrmB-0007PZ-O0 for submit@debbugs.gnu.org; Sat, 13 Jul 2013 00:49:44 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:35297 helo=jenni2.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxrm8-0007PE-J1 for 8196@debbugs.gnu.org; Sat, 13 Jul 2013 00:49:41 -0400 Received: from mithlond.arda (84.251.134.110) by jenni2.inet.fi (8.5.140.03) id 51BB235B0219F196; Sat, 13 Jul 2013 07:49:37 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1Uxrm3-00017d-Pb; Sat, 13 Jul 2013 07:49:35 +0300 From: Teemu Likonen To: Drew Adams Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: <9e30b1da-e346-420f-9d60-698925e50a59@default> (Drew Adams's message of "Fri, 12 Jul 2013 14:18:27 -0700 (PDT)") References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> <87k3kv4k9f.fsf@mithlond.arda> <9e30b1da-e346-420f-9d60-698925e50a59@default> Date: Sat, 13 Jul 2013 07:49:35 +0300 Message-ID: <87r4f3hxnk.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Drew Adams [2013-07-12 14:18:27 -07:00] wrote: > What you can propose instead is that your new command get the > traditional binding for `indent-rigidly', `C-x TAB'. What we should > not do is replace the current `indent-rigidly' behavior by the > proposed behavior in the same command. Steal the key, perhaps, but not > the command. That's exactly what I'm doing. My command is called "tl-indent-region" (ok, we can drop the tl- prefix) and it relies on indent-rigidly to do the job. My command behaves the same as indent-rigidly when called with a numeric prefix argument. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 00:59:41 2013 Received: (at 8196) by debbugs.gnu.org; 13 Jul 2013 04:59:41 +0000 Received: from localhost ([127.0.0.1]:51805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxrvo-0007pa-T6 for submit@debbugs.gnu.org; Sat, 13 Jul 2013 00:59:41 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:51586) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxrvn-0007pH-00 for 8196@debbugs.gnu.org; Sat, 13 Jul 2013 00:59:39 -0400 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r6D4xVKr023254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 13 Jul 2013 04:59:32 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6D4xVMe026897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 13 Jul 2013 04:59:31 GMT Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r6D4xVFp006742; Sat, 13 Jul 2013 04:59:31 GMT MIME-Version: 1.0 Message-ID: <2f005b97-ff3e-4581-b580-869b77432614@default> Date: Fri, 12 Jul 2013 21:59:31 -0700 (PDT) From: Drew Adams To: Teemu Likonen Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> <87k3kv4k9f.fsf@mithlond.arda> <9e30b1da-e346-420f-9d60-698925e50a59@default> <87r4f3hxnk.fsf@mithlond.arda> In-Reply-To: <87r4f3hxnk.fsf@mithlond.arda> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.7 (607090) [OL 12.0.6668.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > > What you can propose instead is that your new command get the > > traditional binding for `indent-rigidly', `C-x TAB'. What we should > > not do is replace the current `indent-rigidly' behavior by the > > proposed behavior in the same command. Steal the key, perhaps, but not > > the command. >=20 > That's exactly what I'm doing. My command is called "tl-indent-region" > (ok, we can drop the tl- prefix) and it relies on indent-rigidly to do > the job. Great. Sounds good. I misunderstood that you wanted to change `indent-rigidly'; sorry. > My command behaves the same as indent-rigidly when called with > a numeric prefix argument. Yes, that I understood from the code. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 01:43:20 2013 Received: (at 8196) by debbugs.gnu.org; 13 Jul 2013 05:43:20 +0000 Received: from localhost ([127.0.0.1]:51826 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxsc3-0001CE-EG for submit@debbugs.gnu.org; Sat, 13 Jul 2013 01:43:19 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:57817 helo=jenni1.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uxsbz-0001C3-VB for 8196@debbugs.gnu.org; Sat, 13 Jul 2013 01:43:17 -0400 Received: from mithlond.arda (84.251.134.110) by jenni1.inet.fi (8.5.140.03) id 5163EC56069331AD; Sat, 13 Jul 2013 08:43:12 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1Uxsbv-0001Ah-NP; Sat, 13 Jul 2013 08:43:11 +0300 From: Teemu Likonen To: "Jambunathan K." Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: <87mwprl7ar.fsf@gmail.com> (Jambunathan K.'s message of "Sat, 13 Jul 2013 04:23:00 +0530") References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> <87k3kv4k9f.fsf@mithlond.arda> <9e30b1da-e346-420f-9d60-698925e50a59@default> <87mwprl7ar.fsf@gmail.com> Date: Sat, 13 Jul 2013 08:43:11 +0300 Message-ID: <87mwprhv68.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org, Drew Adams X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Jambunathan K. [2013-07-13 04:23:00 +05:30] wrote: > My usual invocation is > > C-4 C-x TAB My command does the same when called with a numeric prefix argument. The difference is when you don't call it with a numeric prefix. indent-rigidly uses the default value of 1. My command uses the next or previous tab stop as the default (as defined in the tab-stop-list variable). My command has all the functionality of indent-rigidly but also added intelligence to understand tab-stop-list. My command relies on indent-rigidly to do the actual job. That's why I'm saying that my command supersedes indent-rigidly. From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 13 16:02:53 2013 Received: (at 8196) by debbugs.gnu.org; 13 Jul 2013 20:02:53 +0000 Received: from localhost ([127.0.0.1]:53241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uy61s-0001qb-C6 for submit@debbugs.gnu.org; Sat, 13 Jul 2013 16:02:52 -0400 Received: from chene.dit.umontreal.ca ([132.204.246.20]:45342) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Uy61p-0001qT-WB for 8196@debbugs.gnu.org; Sat, 13 Jul 2013 16:02:50 -0400 Received: from fmsmemgm.homelinux.net (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r6DK2drQ029627; Sat, 13 Jul 2013 16:02:42 -0400 Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id BA983AE170; Sat, 13 Jul 2013 16:02:35 -0400 (EDT) From: Stefan Monnier To: Teemu Likonen Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Message-ID: References: <87d3m2equ6.fsf@imladris.arda> Date: Sat, 13 Jul 2013 16:02:35 -0400 In-Reply-To: <87d3m2equ6.fsf@imladris.arda> (Teemu Likonen's message of "Mon, 07 Mar 2011 20:19:13 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4638=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4638> : streams <999421> : uri <1476024> X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) > I think it would be better if "C-x TAB" (bound to indent-rigidly) > advanced the indentation to the next tab stop (as in tab-stop-list) by > default, instead of by 1. That sounds reasonable. It can be changed by modifying simply the interactive spec of indent-rigidly. > Similarly, if negative prefix argument were given (with "C-u -") it > would change the indentation to the previous tab stop. Same here. For both changes, there's a risk some users will be annoyed, but they can still get the old behavior with a C-u 1 or C-u - 1 prefix. This said, there's another good default behavior for non-prefixed C-x TAB which is to enter an interactive loop that lets the user move the block left/right with the cursor keys. I think this would be a more useful change. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 14 10:41:23 2013 Received: (at 8196) by debbugs.gnu.org; 14 Jul 2013 14:41:23 +0000 Received: from localhost ([127.0.0.1]:54035 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyNUI-0003Ov-Pk for submit@debbugs.gnu.org; Sun, 14 Jul 2013 10:41:23 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:46839 helo=jenni1.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UyNUE-0003Of-7Z for 8196@debbugs.gnu.org; Sun, 14 Jul 2013 10:41:19 -0400 Received: from mithlond.arda (84.251.134.110) by jenni1.inet.fi (8.5.140.03) id 5163EC5606A47981; Sun, 14 Jul 2013 17:41:15 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1UyNUA-0004AI-D6; Sun, 14 Jul 2013 17:41:14 +0300 From: Teemu Likonen To: Stefan Monnier Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: (Stefan Monnier's message of "Sat, 13 Jul 2013 16:02:35 -0400") References: <87d3m2equ6.fsf@imladris.arda> Date: Sun, 14 Jul 2013 17:41:14 +0300 Message-ID: <87zjtp2ohh.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196 Cc: 8196@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Stefan Monnier [2013-07-13 16:02:35 -04:00] wrote: > This said, there's another good default behavior for non-prefixed C-x > TAB which is to enter an interactive loop that lets the user move the > block left/right with the cursor keys. I think this would be a more > useful change. Sounds good. I wrote a quick example command "tl-edit-indentation". It works like "indent-rigidly" expect that when there is no prefix argument it sets a temporary repeatable overlay keyboard with the cursor keys for editing indentation. Plain and would move by 1 column and and move by tab stops. I like this feature. (defun tl-region-indentation (beg end) "Return the smallest indentation in range from BEG to END. Blank lines are ignored." (save-excursion (save-match-data (let ((beg (progn (goto-char beg) (line-beginning-position))) indent) (goto-char beg) (while (re-search-forward "^\\s-*[[:print:]]" end t) (setq indent (min (or indent (current-indentation)) (current-indentation)))) indent)))) (defun tl-edit-indentation (start end arg) (interactive "r\nP") (if arg (indent-rigidly start end (prefix-numeric-value arg)) (message "Edit region indentation with , , \ and .") (set-temporary-overlay-map (let ((map (make-sparse-keymap))) (define-key map (kbd "") (lambda () (interactive) (indent-rigidly (region-beginning) (region-end) -1))) (define-key map (kbd "") (lambda () (interactive) (indent-rigidly (region-beginning) (region-end) 1))) (define-key map (kbd "") (lambda () (interactive) (let* ((beg (region-beginning)) (end (region-end)) (current (tl-region-indentation beg end)) (next (catch 'answer (dolist (col tab-stop-list (1+ current)) (when (> col current) (throw 'answer col)))))) (indent-rigidly beg end (- next current))))) (define-key map (kbd "") (lambda () (interactive) (let* ((beg (region-beginning)) (end (region-end)) (current (tl-region-indentation beg end)) (next (catch 'answer (dolist (col (reverse tab-stop-list) 0) (when (< col current) (throw 'answer col)))))) (indent-rigidly beg end (- next current))))) map) t))) From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 02:18:42 2013 Received: (at 8196-done) by debbugs.gnu.org; 8 Oct 2013 06:18:42 +0000 Received: from localhost ([127.0.0.1]:33735 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTQd0-0001yg-4H for submit@debbugs.gnu.org; Tue, 08 Oct 2013 02:18:42 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:5921) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTQcx-0001ya-M3 for 8196-done@debbugs.gnu.org; Tue, 08 Oct 2013 02:18:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYBERQYDSSIHgaxH5AOkQoDpHqBXoJqKYFKJA X-IPAS-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLDiYBERQYDSSIHgaxH5AOkQoDpHqBXoJqKYFKJA X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34995991" Received: from 206-248-175-45.dsl.teksavvy.com (HELO pastel.home) ([206.248.175.45]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 08 Oct 2013 02:14:59 -0400 Received: by pastel.home (Postfix, from userid 20848) id 6F38D60E4E; Tue, 8 Oct 2013 02:18:38 -0400 (EDT) From: Stefan Monnier To: Teemu Likonen Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Message-ID: References: <87d3m2equ6.fsf@imladris.arda> <87zjtp2ohh.fsf@mithlond.arda> Date: Tue, 08 Oct 2013 02:18:38 -0400 In-Reply-To: <87zjtp2ohh.fsf@mithlond.arda> (Teemu Likonen's message of "Sun, 14 Jul 2013 17:41:14 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 8196-done Cc: 8196-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Sounds good. I wrote a quick example command "tl-edit-indentation". It > works like "indent-rigidly" expect that when there is no prefix argument > it sets a temporary repeatable overlay keyboard with the cursor keys for > editing indentation. Plain and would move by 1 column and > and move by tab stops. I like this feature. I like it too. Thank you. I just folded it into indent-rigidly. Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 11:12:22 2013 Received: (at 8196-done) by debbugs.gnu.org; 8 Oct 2013 15:12:22 +0000 Received: from localhost ([127.0.0.1]:35011 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTYxS-0007kV-7k for submit@debbugs.gnu.org; Tue, 08 Oct 2013 11:12:22 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:29924) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTYxP-0007kL-Sm for 8196-done@debbugs.gnu.org; Tue, 08 Oct 2013 11:12:20 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r98FCINX004031 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Oct 2013 15:12:18 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r98FCGxw021852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Oct 2013 15:12:17 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r98FCGJN010340; Tue, 8 Oct 2013 15:12:16 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 8 Oct 2013 08:12:16 -0700 (PDT) From: Drew Adams To: Stefan Monnier , Teemu Likonen Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87zjtp2ohh.fsf@mithlond.arda> In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196-done Cc: 8196-done@debbugs.gnu.org, Jambunathan K X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > I just folded it into indent-rigidly. Dunno what that means exactly, but a priori: too bad. Should be a separate command, as previously discussed and agreed. It would be OK to bind `C-x TAB' to a new command by default, but it is not so wise to change the behavior of `indent-rigidly'. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8196#23 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 11:34:16 2013 Received: (at 8196-done) by debbugs.gnu.org; 8 Oct 2013 15:34:16 +0000 Received: from localhost ([127.0.0.1]:35068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTZId-0008Ib-H3 for submit@debbugs.gnu.org; Tue, 08 Oct 2013 11:34:16 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:46001 helo=jenni2.inet.fi) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTZIa-0008IS-Fa for 8196-done@debbugs.gnu.org; Tue, 08 Oct 2013 11:34:13 -0400 Received: from mithlond.arda (84.251.149.21) by jenni2.inet.fi (8.5.140.03) id 51BB235B092B0451; Tue, 8 Oct 2013 18:34:08 +0300 Received: from dtw by mithlond.arda with local (Exim 4.80) (envelope-from ) id 1VTZIV-0001aN-5d; Tue, 08 Oct 2013 18:34:07 +0300 From: Teemu Likonen To: Drew Adams Subject: Re: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list In-Reply-To: (Drew Adams's message of "Tue, 8 Oct 2013 08:12:16 -0700 (PDT)") References: <87d3m2equ6.fsf@imladris.arda> <87zjtp2ohh.fsf@mithlond.arda> Date: Tue, 08 Oct 2013 18:34:07 +0300 Message-ID: <87hacr3hg0.fsf@mithlond.arda> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 8196-done Cc: 8196-done@debbugs.gnu.org, Stefan Monnier , "Jambunathan K." X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Drew Adams [2013-10-08 08:12:16 -07:00] wrote: >> I just folded it into indent-rigidly. > > Dunno what that means exactly, but a priori: too bad. Should be a > separate command, as previously discussed and agreed. The change has effect only when called interactively and when there is no prefix argument. The new feature is more useful. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 08 12:21:35 2013 Received: (at 8196-done) by debbugs.gnu.org; 8 Oct 2013 16:21:35 +0000 Received: from localhost ([127.0.0.1]:35202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTa2Q-00010Q-Dm for submit@debbugs.gnu.org; Tue, 08 Oct 2013 12:21:34 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:45761) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VTa2M-00010E-Ip for 8196-done@debbugs.gnu.org; Tue, 08 Oct 2013 12:21:32 -0400 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r98GLSGJ017207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 8 Oct 2013 16:21:29 GMT Received: from userz7021.oracle.com (userz7021.oracle.com [156.151.31.85]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r98GLR2g018616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 8 Oct 2013 16:21:28 GMT Received: from abhmt109.oracle.com (abhmt109.oracle.com [141.146.116.61]) by userz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r98GLR2Z017024; Tue, 8 Oct 2013 16:21:27 GMT MIME-Version: 1.0 Message-ID: Date: Tue, 8 Oct 2013 09:21:26 -0700 (PDT) From: Drew Adams To: Teemu Likonen Subject: RE: bug#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list References: <87d3m2equ6.fsf@imladris.arda> <87zjtp2ohh.fsf@mithlond.arda> <87hacr3hg0.fsf@mithlond.arda> In-Reply-To: <87hacr3hg0.fsf@mithlond.arda> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 8196-done Cc: 8196-done@debbugs.gnu.org, Stefan Monnier , "Jambunathan K." X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) > >> I just folded it into indent-rigidly. > > > > Dunno what that means exactly, but a priori: too bad. Should be a > > separate command, as previously discussed and agreed. >=20 > The change has effect only when called interactively and when there is > no prefix argument. The new feature is more useful. Yes, we know that. Please read the thread. Remember this part, for instance? > > > What you can propose instead is that your new command get the > > > traditional binding for `indent-rigidly', `C-x TAB'. What we > > > should not do is replace the current `indent-rigidly' behavior > > > by the proposed behavior in the same command. Steal the key, > > > perhaps, but not the command. > > > > That's exactly what I'm doing. My command is called=20 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > "tl-indent-region" (ok, we can drop the tl- prefix) and it relies > > on indent-rigidly to do the job. >=20 > Great. Sounds good. I misunderstood that you wanted to change > `indent-rigidly'; sorry. >=20 > > My command behaves the same as indent-rigidly when called with > > a numeric prefix argument. >=20 > Yes, that I understood from the code. Changing the key binding but not the command itself, as you said you were doing, would be fine. There is no reason to change `indent-rigidly' itself. "My command" should have remained just that: a separate command. The fact that without a prefix arg it behaves the same as `indent-rigidly' is irrelevant, except as a (weak) argument for someone wanting to replace `indent-rigidly'. It means nothing for someone truly intending to add a new command and bind it by default to `C-x TAB'. What is important is to keep two separate functions, and not screw `indent-rigidly'. This portion of the thread is also relevant, as it seems to be what has now been implemented, in spite of the discussion: d> A mix would also be possible, but less desirable IMO: modify d> `indent-rigidly' to provide the new behavior only interactively, d> never when used in code. That has the disadvantage of not letting ^^^^^^^^^^^ d> code take advantage of the indentation-to-tab-stop behavior. d> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ d> I think it best to provide a separate command. d>=20 d> A separate command also lets any user who prefers the current default d> behavior interactively to bind `indent-rigidly', instead of your d> command, to `C-x TAB'. You find it handy to indent to a tab stop by d> default (ARG =3D nil), and then repeat (e.g., C-x z z z z). Someone d> else might find it handier to indent one column instead of one tab d> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ d> stop by default, and then repeat to indent the region incrementally. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The simplest approach is the best one, for these and other reasons discussed: Provide the new command. Even make it the new default binding for `C-x TAB'. But keep `indent-rigidly' as it has been. Simple, sane, no downside, wise. From unknown Sat Aug 16 20:56:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 06 Nov 2013 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator