changeset 84932:b10f8731b217

(c-indent-line-or-region): Only indent the region if in transient-mark-mode.
author Dan Nicolaescu <dann@ics.uci.edu>
date Wed, 26 Sep 2007 03:18:21 +0000
parents 5d29309fb351
children d6e2d9d9924a
files lisp/ChangeLog lisp/progmodes/cc-cmds.el
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Sep 26 00:39:23 2007 +0000
+++ b/lisp/ChangeLog	Wed Sep 26 03:18:21 2007 +0000
@@ -1,3 +1,8 @@
+2007-09-26  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* progmodes/cc-cmds.el (c-indent-line-or-region): Only indent the
+	region if in transient-mark-mode.
+
 2007-09-26  Juanma Barranquero  <lekktu@gmail.com>
 
 	* calc/calc-ext.el (calc-init-extensions, calc-reset):
--- a/lisp/progmodes/cc-cmds.el	Wed Sep 26 00:39:23 2007 +0000
+++ b/lisp/progmodes/cc-cmds.el	Wed Sep 26 03:18:21 2007 +0000
@@ -3074,7 +3074,8 @@
 indent the current line syntactically."
   ;; Emacs has a variable called mark-active, XEmacs uses region-active-p
   (interactive)
-  (if (c-region-is-active-p)
+  (if (and transient-mark-mode mark-active
+	   (not (eq (region-beginning) (region-end))))
       (c-indent-region (region-beginning) (region-end))
     (c-indent-line)))