emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TAB when the region is active


From: Dan Nicolaescu
Subject: Re: TAB when the region is active
Date: Wed, 19 Sep 2007 18:54:29 -0700

Stefan Monnier <address@hidden> 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? 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]