From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: C-u prefix behavior of TAB broken Date: Thu, 20 Dec 2007 19:20:28 -0500 Message-ID: References: <874peijnu4.fsf@catnip.gol.com> <47667010.40209@gmx.at> <87tzmhs8g8.fsf@catnip.gol.com> <4766C7F7.5060504@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1198196457 7374 80.91.229.12 (21 Dec 2007 00:20:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Dec 2007 00:20:57 +0000 (UTC) Cc: emacs-devel@gnu.org, Miles Bader To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 21 01:21:09 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 1J5VdJ-0002sz-F3 for ged-emacs-devel@m.gmane.org; Fri, 21 Dec 2007 01:20:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J5Vcz-0006Tu-G3 for ged-emacs-devel@m.gmane.org; Thu, 20 Dec 2007 19:20:37 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J5Vcv-0006RC-Bj for emacs-devel@gnu.org; Thu, 20 Dec 2007 19:20:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J5Vcu-0006P2-JZ for emacs-devel@gnu.org; Thu, 20 Dec 2007 19:20:32 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J5Vcu-0006Oc-3Z for emacs-devel@gnu.org; Thu, 20 Dec 2007 19:20:32 -0500 Original-Received: from bas-flu-bbcs-dynip-199-119.vtx.ch ([83.228.199.119] helo=ceviche.home) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J5Vcq-0001Sy-Vu; Thu, 20 Dec 2007 19:20:29 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 1370AB40F3; Thu, 20 Dec 2007 19:20:28 -0500 (EST) In-Reply-To: <4766C7F7.5060504@gmx.at> (martin rudalics's message of "Mon, 17 Dec 2007 20:03:19 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:85320 Archived-At: >> I'm not sure what you mean... maybe my explanation was poor, but the >> above is what I'm referring to. > I thought you had a less rigid version of that. >> Anyway, that feature is now broken. > FWIW in lisp-mode it's due to that change: > 2007-09-19 Stefan Monnier > ... > * emacs-lisp/lisp-mode.el (lisp-mode-shared-map): Use the default TAB > binding, so tab-always-indent works right. It may be the superficial reason for it, but it shouldn't be the root cause for it: indent-for-tab-command used to pass the C-u prefix to the indent-line-function. This said, IMNSHO the feature we're talking about shouldn't be implement in lisp-mode and c-mode but directly generically in indent-for-tab-command. I use the following code in my local version of indent-for-tab-command for that purpose: (cond [...] (arg (let ((old-indent (current-indentation))) (if (eq (indent-according-to-mode) 'noindent) (funcall (default-value 'indent-line-function))) (let ((new-indent (current-indentation)) (beg (line-beginning-position 2)) (end (save-excursion (beginning-of-line) (forward-sexp 1) (point)))) (when (and (> end beg) (/= new-indent old-indent)) (indent-code-rigidly beg end (- new-indent old-indent)))))) [...]) Stefan