aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Nicolaescu2007-09-24 17:48:50 +0000
committerDan Nicolaescu2007-09-24 17:48:50 +0000
commit17ee46255fade92111505295c38c29a0865f32ce (patch)
treefaeca187045aa9245efd8600944b3ec2603fea6a
parent9f7e1e6ed92f9c10c7f85fa60c24b0957875619f (diff)
downloademacs-17ee46255fade92111505295c38c29a0865f32ce.tar.gz
emacs-17ee46255fade92111505295c38c29a0865f32ce.zip
* progmodes/cc-mode.el (c-mode-base-map): Use
c-indent-line-or-region instead of c-indent-line. * indent.el (indent-for-tab-command): First check if the region is active.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/indent.el8
-rw-r--r--lisp/progmodes/cc-mode.el4
3 files changed, 15 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c2d80dc0644..c9875cfdcca 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12007-09-24 Dan Nicolaescu <dann@ics.uci.edu>
2
3 * progmodes/cc-mode.el (c-mode-base-map): Use
4 c-indent-line-or-region instead of c-indent-line.
5
6 * indent.el (indent-for-tab-command): First check if the region is
7 active.
8
12007-09-24 Micha,Ak(Bl Cadilhac <michael@cadilhac.name> 92007-09-24 Micha,Ak(Bl Cadilhac <michael@cadilhac.name>
2 10
3 * whitespace.el (whitespace-tickle-timer): Don't install the timer if 11 * whitespace.el (whitespace-tickle-timer): Don't install the timer if
diff --git a/lisp/indent.el b/lisp/indent.el
index 2108b340f1b..db8958bd1ca 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -88,6 +88,10 @@ The function actually called to indent the line is determined by the value of
88`indent-line-function'." 88`indent-line-function'."
89 (interactive "P") 89 (interactive "P")
90 (cond 90 (cond
91 ;; The region is active, indent it.
92 ((and transient-mark-mode mark-active
93 (not (eq (region-beginning) (region-end))))
94 (indent-region (region-beginning) (region-end)))
91 ((or ;; indent-to-left-margin is only meant for indenting, 95 ((or ;; indent-to-left-margin is only meant for indenting,
92 ;; so we force it to always insert a tab here. 96 ;; so we force it to always insert a tab here.
93 (eq indent-line-function 'indent-to-left-margin) 97 (eq indent-line-function 'indent-to-left-margin)
@@ -99,10 +103,6 @@ The function actually called to indent the line is determined by the value of
99 ;; indenting, so we can't pass them to indent-according-to-mode. 103 ;; indenting, so we can't pass them to indent-according-to-mode.
100 ((memq indent-line-function '(indent-relative indent-relative-maybe)) 104 ((memq indent-line-function '(indent-relative indent-relative-maybe))
101 (funcall indent-line-function)) 105 (funcall indent-line-function))
102 ;; The region is active, indent it.
103 ((and transient-mark-mode mark-active
104 (not (eq (region-beginning) (region-end))))
105 (indent-region (region-beginning) (region-end)))
106 ;; Indent the line. 106 ;; Indent the line.
107 (t 107 (t
108 (indent-according-to-mode)))) 108 (indent-according-to-mode))))
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 8669a41c2f0..f234404e81d 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -269,7 +269,9 @@ control). See \"cc-mode.el\" for more info."
269 'c-indent-new-comment-line 269 'c-indent-new-comment-line
270 c-mode-base-map global-map) 270 c-mode-base-map global-map)
271 (substitute-key-definition 'indent-for-tab-command 271 (substitute-key-definition 'indent-for-tab-command
272 'c-indent-command 272 ;; XXX Is this the right thing to do
273 ;; here?
274 'c-indent-line-or-region
273 c-mode-base-map global-map) 275 c-mode-base-map global-map)
274 (when (fboundp 'comment-indent-new-line) 276 (when (fboundp 'comment-indent-new-line)
275 ;; indent-new-comment-line has changed name to 277 ;; indent-new-comment-line has changed name to