From 62035afde20c85cbc7aa53f8f0eccf67e555434c Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Wed, 26 Sep 2007 03:18:21 +0000 Subject: [PATCH] (c-indent-line-or-region): Only indent the region if in transient-mark-mode. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-cmds.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c621d257a44..40319a3bb1c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-09-26 Dan Nicolaescu + + * progmodes/cc-cmds.el (c-indent-line-or-region): Only indent the + region if in transient-mark-mode. + 2007-09-26 Juanma Barranquero * calc/calc-ext.el (calc-init-extensions, calc-reset): diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 48fa7d99f5a..860893bcfa6 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -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))) -- 2.39.5