]> code.delx.au - gnu-emacs/commitdiff
(c-indent-line-or-region): Only indent the
authorDan Nicolaescu <dann@ics.uci.edu>
Wed, 26 Sep 2007 03:18:21 +0000 (03:18 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Wed, 26 Sep 2007 03:18:21 +0000 (03:18 +0000)
region if in transient-mark-mode.

lisp/ChangeLog
lisp/progmodes/cc-cmds.el

index c621d257a44e14db34c4a2f4c24ad4635281d553..40319a3bb1ca51600e8309323ef95fc41a4fdb05 100644 (file)
@@ -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):
index 48fa7d99f5a792b66720d6671a2c921a1efdafa5..860893bcfa64f3d252ea3eecfb60e31940e2aed8 100644 (file)
@@ -3074,7 +3074,8 @@ non-nil."
 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)))