summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-cmds.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r--lisp/progmodes/cc-cmds.el3
1 files changed, 2 insertions, 1 deletions
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)))