Mercurial > emacs
diff lisp/indent.el @ 84840:f4b3c97a692f
* progmodes/cc-mode.el (c-mode-base-map): Use
c-indent-line-or-region instead of c-indent-line.
* indent.el (indent-for-tab-command): First check if the region is
active.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Mon, 24 Sep 2007 17:48:50 +0000 |
parents | d8b9b78eb16c |
children | 3664514f5c60 14c4a6aac623 |
line wrap: on
line diff
--- a/lisp/indent.el Mon Sep 24 15:26:47 2007 +0000 +++ b/lisp/indent.el Mon Sep 24 17:48:50 2007 +0000 @@ -88,6 +88,10 @@ `indent-line-function'." (interactive "P") (cond + ;; The region is active, indent it. + ((and transient-mark-mode mark-active + (not (eq (region-beginning) (region-end)))) + (indent-region (region-beginning) (region-end))) ((or ;; indent-to-left-margin is only meant for indenting, ;; so we force it to always insert a tab here. (eq indent-line-function 'indent-to-left-margin) @@ -99,10 +103,6 @@ ;; indenting, so we can't pass them to indent-according-to-mode. ((memq indent-line-function '(indent-relative indent-relative-maybe)) (funcall indent-line-function)) - ;; The region is active, indent it. - ((and transient-mark-mode mark-active - (not (eq (region-beginning) (region-end)))) - (indent-region (region-beginning) (region-end))) ;; Indent the line. (t (indent-according-to-mode))))