From 19da29f9b5f2c927ab0988b679f3d9eb7d38c5b6 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 10 Jul 2001 19:51:27 +0000 Subject: (c-indent-exp): Keep the indentation of the block itself, i.e. only indent the contents in it. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-cmds.el | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 924c35dae6c..7121f7a6a37 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -6,6 +6,11 @@ * startup.el (normal-top-level): Don't operate on the initial frame if we failed to create one. +2001-07-10 Martin Stjernholm + + * cc-cmds.el (c-indent-exp): Keep the indentation of the block + itself, i.e. only indent the contents in it. + 2001-07-10 Markus Rost * mail/rmail.el (rmail-show-message): Show beginning of message in 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)))) -- cgit v1.2.3