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#8196: 23.1; Feature request with code: "C-x TAB" to understand tab-stop-list Date: Fri, 12 Jul 2013 12:11:31 -0700 (PDT) Message-ID: <2b9b23f3-8622-4a4e-847f-a2f751c2c881@default> References: <87d3m2equ6.fsf@imladris.arda> <87oba74rww.fsf@mithlond.arda> 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 1373656333 836 80.91.229.3 (12 Jul 2013 19:12:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 12 Jul 2013 19:12:13 +0000 (UTC) To: Teemu Likonen , 8196@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 12 21:12:10 2013 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 1UxilE-00020w-Gr for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 21:12:08 +0200 Original-Received: from localhost ([::1]:53488 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxilD-0007w4-TY for geb-bug-gnu-emacs@m.gmane.org; Fri, 12 Jul 2013 15:12:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UxilA-0007vx-1j for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 15:12:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uxil9-00013u-1m for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 15:12:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uxil8-00013I-UT for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 15:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Uxil8-0003ZV-Df for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2013 15:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jul 2013 19:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8196 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8196-submit@debbugs.gnu.org id=B8196.137365630513701 (code B ref 8196); Fri, 12 Jul 2013 19:12:02 +0000 Original-Received: (at 8196) by debbugs.gnu.org; 12 Jul 2013 19:11:45 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 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)] X-Source-IP: ucsinet21.oracle.com [156.151.31.93] 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:76297 Archived-At: > > 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))))))