From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Prefix Argument to indent-line-function Date: 02 Nov 2002 20:48:29 -0700 Sender: emacs-devel-admin@gnu.org Message-ID: <1036295309.11508.28.camel@slider> References: <1036280611.10181.17.camel@slider> <200211030231.gA32VXP10722@rum.cs.yale.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1036296191 17764 80.91.224.249 (3 Nov 2002 04:03:11 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 3 Nov 2002 04:03:11 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 188Byf-0004cI-00 for ; Sun, 03 Nov 2002 05:03:09 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 188C5X-00008O-00 for ; Sun, 03 Nov 2002 05:10:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 188Byy-0002vA-00; Sat, 02 Nov 2002 23:03:28 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 188Bl9-0003Mm-00 for emacs-devel@gnu.org; Sat, 02 Nov 2002 22:49:11 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 188Bkd-00035J-00 for emacs-devel@gnu.org; Sat, 02 Nov 2002 22:49:10 -0500 Original-Received: from pcp01310099pcs.sabrna01.az.comcast.net ([68.63.194.204] helo=localhost.localdomain) by monty-python.gnu.org with esmtp (Exim 4.10) id 188Bkc-00034O-00 for emacs-devel@gnu.org; Sat, 02 Nov 2002 22:48:38 -0500 Original-Received: (from jdsmith@localhost) by localhost.localdomain (8.11.6/8.11.6) id gA33mTP15552; Sat, 2 Nov 2002 20:48:29 -0700 X-Authentication-Warning: localhost.localdomain: jdsmith set sender to jdsmith@as.arizona.edu using -f Original-To: Stefan Monnier In-Reply-To: <200211030231.gA32VXP10722@rum.cs.yale.edu> X-Mailer: Ximian Evolution 1.0.3 (1.0.3-6) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9081 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9081 On Sat, 2002-11-02 at 19:31, Stefan Monnier wrote: > > Prior versions of emacs passed any prefix argument to [Tab] through > > `indent-for-tab-command' to `indent-line-function'. Now, in Emacs 21.x, > > that prefix argument is trapped and not passed. > > Yes: many indent-line-functions don't expect an argument and crashed > when you did C-u TAB. So we removed it. Aha. My mode expects it... > > > The variable `current-prefix-arg' does me no good, since the line-function > > is called recursively. > > I don't understand what you mean here. You can use this variable, if I understand it correctly, to find the prefix arg of the initial function called interactively in a stack of function calls. My indent-line-function looks for a prefix, and if it finds it, calls code which calls itself again (non-interactively). If you test for current-prefix-arg, the purposefully non-interactive invocations are confused, and an infinite loop ensues. I suppose I could set current-prefix-arg to nil on the first run-through. > > > Any suggestions for a workaround to get [C-u TAB] to behave like before? > > Depends on the context. > In lisp-mode, what we did was to rebind TAB to lisp-indent-line. > I don't like this approach, admittedly, because it then disregards > tab-always-indent. I may resort to that. I suppose there's no clever way to test if a prefix argument is taken and only pass it then... Thanks, JD