From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: C-u prefix behavior of TAB broken Date: Sun, 23 Dec 2007 10:39:39 +0900 Message-ID: <87hcia6vfo.fsf@catnip.gol.com> References: <874peijnu4.fsf@catnip.gol.com> <47667010.40209@gmx.at> <87tzmhs8g8.fsf@catnip.gol.com> <4766C7F7.5060504@gmx.at> <87fxxvbnbv.fsf@catnip.gol.com> <476CD8CF.4060108@gmx.at> <874peac02g.fsf@catnip.gol.com> <476D4C5D.7020202@gmx.at> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1198374007 3567 80.91.229.12 (23 Dec 2007 01:40:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Dec 2007 01:40:07 +0000 (UTC) Cc: martin rudalics , rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 23 02:40:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1J6FpC-0001xv-Px for ged-emacs-devel@m.gmane.org; Sun, 23 Dec 2007 02:40:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J6Fos-00008i-Nm for ged-emacs-devel@m.gmane.org; Sat, 22 Dec 2007 20:39:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J6Fop-000083-6o for emacs-devel@gnu.org; Sat, 22 Dec 2007 20:39:55 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J6Fom-00004w-Os for emacs-devel@gnu.org; Sat, 22 Dec 2007 20:39:53 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J6Fom-0008WJ-Hj for emacs-devel@gnu.org; Sat, 22 Dec 2007 20:39:52 -0500 Original-Received: from smtp02.dentaku.gol.com ([203.216.5.72]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J6Foe-0001NC-U6; Sat, 22 Dec 2007 20:39:45 -0500 Original-Received: from 203-216-96-195.dsl.gol.ne.jp ([203.216.96.195] helo=catnip.gol.com) by smtp02.dentaku.gol.com with esmtpa (Dentaku) id 1J6Fob-0005kR-1X; Sun, 23 Dec 2007 10:39:41 +0900 Original-Received: by catnip.gol.com (Postfix, from userid 1000) id AF3422FF7; Sun, 23 Dec 2007 10:39:39 +0900 (JST) System-Type: i686-pc-linux-gnu In-Reply-To: (Stefan Monnier's message of "Sat, 22 Dec 2007 19:55:03 -0500") Original-Lines: 85 X-Abuse-Complaints: abuse@gol.com X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:85397 Archived-At: Stefan Monnier writes: >>> Can't indent-for-tab-command simply, if there's a prefix argument given, >>> rigidly indent the following sexp by the change in indentation? That >>> doesn't seem hard at all, and matches the behavior I remember (perhaps >>> there are corner cases where it would differ, but I don't think I know >>> about them...). > >> For `tab-always-indent' t it might make sense to do `beginning-of-line' >> before the `forward-sexp'. Otherwise it should work wherever >> `forward-sexp' behaves reasonably. BTW, isn't > >> ((memq indent-line-function '(indent-relative indent-relative-maybe)) >> (funcall indent-line-function)) >> ;; Indent the line. >> (t >> (indent-according-to-mode)) > >> semantically equivalent to > >> (t >> (funcall indent-line-function)) > > No, it's not: check the definition of indent-according-to-mode. > > The difference is to distinguish between the case where the user hits > TAB (and hence wants some kind of effect) as opposed to when > line-indentation is done non-interactively (e.g. by skeleton). > > Stefan But indent-according-to-mode is defined like this: (defun indent-according-to-mode () .... (if (memq indent-line-function '(indent-relative indent-relative-maybe)) ... do some stuff ... ;; The normal case. (funcall indent-line-function))) So this: (cond ... ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) ;; Indent the line. (t (indent-according-to-mode)) Is equivalent to this: (cond ... ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) ;; Indent the line. (t (if (memq indent-line-function '(indent-relative indent-relative-maybe)) ... do some stuff ... ;; The normal case. (funcall indent-line-function))) and since the first cond branch catches the same cases that the `if' catches, it will always use the `else' part, meaning it's actually: (cond ... ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) ;; Indent the line. (t (funcall indent-line-function))) Which of course is the same as: (funcall indent-line-function) -Miles -- Occam's razor split hairs so well, I bought the whole argument!