diff options
| author | Richard M. Stallman | 2007-12-25 22:14:07 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-12-25 22:14:07 +0000 |
| commit | c02a1ee94d36e39d5bae3a22086b9e4e48b4fe37 (patch) | |
| tree | 8c5005f3127948b2f611017c9e1f8c7b784e1ed7 | |
| parent | cb3a9d33b3477fbd29afae84c7e8253051e57d75 (diff) | |
| download | emacs-c02a1ee94d36e39d5bae3a22086b9e4e48b4fe37.tar.gz emacs-c02a1ee94d36e39d5bae3a22086b9e4e48b4fe37.zip | |
(c-indent-line-or-region):
Pass prefix arg to `c-indent-command'. Use `use-region-p'.
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 19 |
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. |
| 3074 | indent the current line syntactically." | 3074 | In Transient Mark mode, when the region is active, reindent the region. |
| 3075 | ;; Emacs has a variable called mark-active, XEmacs uses region-active-p | 3075 | Othewise, with a prefix argument, rigidly reindent the expression |
| 3076 | (interactive) | 3076 | starting on the current line. |
| 3077 | (if (and transient-mark-mode mark-active | 3077 | Otherwise 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) |