diff options
| author | Alan Mackenzie | 2021-10-28 17:04:06 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2021-10-28 17:04:06 +0000 |
| commit | 09f3ac60cc99dcb56632c55f0dfd0fbeadc60dc0 (patch) | |
| tree | 91772a797dcee770b5f3fe90843df6610076b122 | |
| parent | 9c95a4fa55a4b6956a16dee9144a68db571d7e2c (diff) | |
| download | emacs-09f3ac60cc99dcb56632c55f0dfd0fbeadc60dc0.tar.gz emacs-09f3ac60cc99dcb56632c55f0dfd0fbeadc60dc0.zip | |
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.
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 25 |
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." | |||
| 1896 | (if (< arg 0) | 1896 | (if (< arg 0) |
| 1897 | (c-while-widening-to-decl-block | 1897 | (c-while-widening-to-decl-block |
| 1898 | (< (setq arg (- (c-forward-to-nth-EOF-\;-or-} (- arg) where))) 0))) | 1898 | (< (setq arg (- (c-forward-to-nth-EOF-\;-or-} (- arg) where))) 0))) |
| 1899 | ;; Move forward to the next opening brace.... | 1899 | (prog1 |
| 1900 | (when (and (= arg 0) | 1900 | ;; Move forward to the next opening brace.... |
| 1901 | (progn | 1901 | (when (and (= arg 0) |
| 1902 | (c-while-widening-to-decl-block | 1902 | (progn |
| 1903 | (not (c-syntactic-re-search-forward "{" nil 'eob))) | 1903 | (c-while-widening-to-decl-block |
| 1904 | (eq (char-before) ?{))) | 1904 | (not (c-syntactic-re-search-forward "{" nil 'eob))) |
| 1905 | (backward-char) | 1905 | (eq (char-before) ?{))) |
| 1906 | ;; ... and backward to the function header. | 1906 | (backward-char) |
| 1907 | (c-beginning-of-decl-1) | 1907 | ;; ... and backward to the function header. |
| 1908 | t)) | 1908 | (c-beginning-of-decl-1) |
| 1909 | t) | ||
| 1910 | (c-keep-region-active))) | ||
| 1909 | 1911 | ||
| 1910 | ;; Move backward to the opening brace of a function, making successively | 1912 | ;; Move backward to the opening brace of a function, making successively |
| 1911 | ;; larger portions of the buffer visible as necessary. | 1913 | ;; larger portions of the buffer visible as necessary. |
| @@ -3413,7 +3415,8 @@ to call `c-scan-conditionals' directly instead." | |||
| 3413 | (interactive "p") | 3415 | (interactive "p") |
| 3414 | (let ((new-point (c-scan-conditionals count target-depth with-else))) | 3416 | (let ((new-point (c-scan-conditionals count target-depth with-else))) |
| 3415 | (push-mark) | 3417 | (push-mark) |
| 3416 | (goto-char new-point))) | 3418 | (goto-char new-point)) |
| 3419 | (c-keep-region-active)) | ||
| 3417 | 3420 | ||
| 3418 | (defun c-scan-conditionals (count &optional target-depth with-else) | 3421 | (defun c-scan-conditionals (count &optional target-depth with-else) |
| 3419 | "Scan forward across COUNT preprocessor conditionals. | 3422 | "Scan forward across COUNT preprocessor conditionals. |