# HG changeset patch # User Richard M. Stallman # Date 1198620847 0 # Node ID 0bcb1aa03dade56690f0c54efd7f62133f055c03 # Parent 06a2cf746b9dc844d114eb0af3562c2bed78cc7b (c-indent-line-or-region): Pass prefix arg to `c-indent-command'. Use `use-region-p'. diff -r 06a2cf746b9d -r 0bcb1aa03dad lisp/progmodes/cc-cmds.el --- a/lisp/progmodes/cc-cmds.el Tue Dec 25 22:12:56 2007 +0000 +++ b/lisp/progmodes/cc-cmds.el Tue Dec 25 22:14:07 2007 +0000 @@ -3069,16 +3069,17 @@ ;; compiled, e.g. in the menus. (c-region-is-active-p)) -(defun c-indent-line-or-region () - "When the region is active, indent it syntactically. Otherwise -indent the current line syntactically." - ;; Emacs has a variable called mark-active, XEmacs uses region-active-p - (interactive) - (if (and transient-mark-mode mark-active - (not (eq (region-beginning) (region-end)))) +(defun c-indent-line-or-region (&optional arg region) + "Indent active region, current line, or block starting on this line. +In Transient Mark mode, when the region is active, reindent the region. +Othewise, with a prefix argument, rigidly reindent the expression +starting on the current line. +Otherwise reindent just the current line." + (interactive + (list current-prefix-arg (use-region-p))) + (if region (c-indent-region (region-beginning) (region-end)) - (c-indent-line))) - + (c-indent-command arg))) ;; for progress reporting (defvar c-progress-info nil)