summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2021-10-28 17:04:06 +0000
committerAlan Mackenzie <acm@muc.de>2021-10-28 17:04:06 +0000
commit09f3ac60cc99dcb56632c55f0dfd0fbeadc60dc0 (patch)
tree91772a797dcee770b5f3fe90843df6610076b122 /lisp/progmodes
parent9c95a4fa55a4b6956a16dee9144a68db571d7e2c (diff)
downloademacs-09f3ac60cc99dcb56632c55f0dfd0fbeadc60dc0.tar.gz
Put missing c-keep-region-active's into the source code
* lisp/progmodes/cc-cmds.el (c-beginning-of-defun): Insert c-keep-region-active when (< arg 0). (c-forward-conditional): Insert c-keep-region-active.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/cc-cmds.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index a9a52636b78..50249728048 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1896,16 +1896,18 @@ defun."
(if (< arg 0)
(c-while-widening-to-decl-block
(< (setq arg (- (c-forward-to-nth-EOF-\;-or-} (- arg) where))) 0)))
- ;; Move forward to the next opening brace....
- (when (and (= arg 0)
- (progn
- (c-while-widening-to-decl-block
- (not (c-syntactic-re-search-forward "{" nil 'eob)))
- (eq (char-before) ?{)))
- (backward-char)
- ;; ... and backward to the function header.
- (c-beginning-of-decl-1)
- t))
+ (prog1
+ ;; Move forward to the next opening brace....
+ (when (and (= arg 0)
+ (progn
+ (c-while-widening-to-decl-block
+ (not (c-syntactic-re-search-forward "{" nil 'eob)))
+ (eq (char-before) ?{)))
+ (backward-char)
+ ;; ... and backward to the function header.
+ (c-beginning-of-decl-1)
+ t)
+ (c-keep-region-active)))
;; Move backward to the opening brace of a function, making successively
;; larger portions of the buffer visible as necessary.
@@ -3413,7 +3415,8 @@ to call `c-scan-conditionals' directly instead."
(interactive "p")
(let ((new-point (c-scan-conditionals count target-depth with-else)))
(push-mark)
- (goto-char new-point)))
+ (goto-char new-point))
+ (c-keep-region-active))
(defun c-scan-conditionals (count &optional target-depth with-else)
"Scan forward across COUNT preprocessor conditionals.