summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-cmds.el
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-07-10 19:51:27 +0000
committerGerd Moellmann <gerd@gnu.org>2001-07-10 19:51:27 +0000
commit19da29f9b5f2c927ab0988b679f3d9eb7d38c5b6 (patch)
treef8645fa955596f71b9a02b39ef2bd06fef74a41f /lisp/progmodes/cc-cmds.el
parent58f8612a80a720f00c25a024ddc72b9abeb24455 (diff)
downloademacs-19da29f9b5f2c927ab0988b679f3d9eb7d38c5b6.tar.gz
(c-indent-exp): Keep the indentation of the block
itself, i.e. only indent the contents in it.
Diffstat (limited to 'lisp/progmodes/cc-cmds.el')
-rw-r--r--lisp/progmodes/cc-cmds.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 273b7c55652..7e2a0c5acf9 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1541,10 +1541,14 @@ balanced expression is found."
(if (not start)
(unless shutup-p
(error "Cannot find start of balanced expression to indent"))
+ (goto-char start)
+ (forward-line)
+ (setq start (point))
(if (not end)
(unless shutup-p
(error "Cannot find end of balanced expression to indent"))
- (c-indent-region start end))))
+ (if (< start end)
+ (c-indent-region start end)))))
(goto-char here)
(set-marker here nil))))