aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/progmodes/cc-cmds.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 06c0946290b..2b80f455e55 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -3069,16 +3069,17 @@ non-nil."
3069 ;; compiled, e.g. in the menus. 3069 ;; compiled, e.g. in the menus.
3070 (c-region-is-active-p)) 3070 (c-region-is-active-p))
3071 3071
3072(defun c-indent-line-or-region () 3072(defun c-indent-line-or-region (&optional arg region)
3073 "When the region is active, indent it syntactically. Otherwise 3073 "Indent active region, current line, or block starting on this line.
3074indent the current line syntactically." 3074In Transient Mark mode, when the region is active, reindent the region.
3075 ;; Emacs has a variable called mark-active, XEmacs uses region-active-p 3075Othewise, with a prefix argument, rigidly reindent the expression
3076 (interactive) 3076starting on the current line.
3077 (if (and transient-mark-mode mark-active 3077Otherwise reindent just the current line."
3078 (not (eq (region-beginning) (region-end)))) 3078 (interactive
3079 (list current-prefix-arg (use-region-p)))
3080 (if region
3079 (c-indent-region (region-beginning) (region-end)) 3081 (c-indent-region (region-beginning) (region-end))
3080 (c-indent-line))) 3082 (c-indent-command arg)))
3081
3082 3083
3083;; for progress reporting 3084;; for progress reporting
3084(defvar c-progress-info nil) 3085(defvar c-progress-info nil)