From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: TAB when the region is active Date: Wed, 19 Sep 2007 18:54:29 -0700 Message-ID: <200709200154.l8K1sX2u011202@oogie-boogie.ics.uci.edu> References: <200709142159.l8ELxFpE029330@oogie-boogie.ics.uci.edu> <200709170409.l8H49nmZ022542@oogie-boogie.ics.uci.edu> <46EF0242.1080806@gmail.com> <200709172328.l8HNSCK9001067@oogie-boogie.ics.uci.edu> <200709190342.l8J3gpHQ020774@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1190253330 31675 80.91.229.12 (20 Sep 2007 01:55:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 20 Sep 2007 01:55:30 +0000 (UTC) Cc: "Lennart Borgman \(gmail\)" , rms@gnu.org, Drew Adams , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 20 03:55:29 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 1IYBGL-0004WX-3O for ged-emacs-devel@m.gmane.org; Thu, 20 Sep 2007 03:55:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYBGJ-00021m-9d for ged-emacs-devel@m.gmane.org; Wed, 19 Sep 2007 21:55:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IYBGF-00020R-DG for emacs-devel@gnu.org; Wed, 19 Sep 2007 21:55:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IYBGE-00020F-Td for emacs-devel@gnu.org; Wed, 19 Sep 2007 21:55:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IYBGE-00020C-OO for emacs-devel@gnu.org; Wed, 19 Sep 2007 21:55:22 -0400 Original-Received: from oogie-boogie.ics.uci.edu ([128.195.1.41]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IYBG9-0001X7-Ao; Wed, 19 Sep 2007 21:55:17 -0400 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by oogie-boogie.ics.uci.edu (8.13.6/8.13.6) with ESMTP id l8K1sX2u011202; Wed, 19 Sep 2007 18:54:33 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Wed\, 19 Sep 2007 09\:45\:01 -0400") Original-Lines: 36 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.84, required 5, autolearn=disabled, ALL_TRUSTED -1.44, J_CHICKENPOX_62 0.60) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-Detected-Kernel: Solaris 9 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:79346 Archived-At: Stefan Monnier writes: > > Here's my first try at doing this. > > The change should not be in indent-according-to-mode, but in > indent-for-tab-command. If I do it like this: *** indent.el 26 Jul 2007 10:17:33 -0700 1.68 --- indent.el 19 Sep 2007 18:29:56 -0700 *************** *** 98,104 **** ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) (t ;; The normal case. ! (indent-according-to-mode)))) (defun insert-tab (&optional arg) (let ((count (prefix-numeric-value arg))) --- 101,110 ---- ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) (t ;; The normal case. ! (if (and transient-mark-mode mark-active ! (not (eq (region-beginning) (region-end)))) ! (indent-region (region-beginning) (region-end)) ! (indent-according-to-mode))))) (defun insert-tab (&optional arg) (let ((count (prefix-numeric-value arg))) then indenting the region by pressing TAB does not work in c-mode anymore (it did work in my first try). Should c-mode also not bind TAB?