diff options
| author | Alan Mackenzie | 2010-05-12 11:06:12 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2010-05-12 11:06:12 +0000 |
| commit | 38d93f03c75ddbf853fe9de5444ee2d4e01226a0 (patch) | |
| tree | 525d7a711a4c8ec6151a4b115e86d01bb070833e /lisp/progmodes | |
| parent | 706deb23dce31d2af3e672c3f30d0a578c023c12 (diff) | |
| download | emacs-38d93f03c75ddbf853fe9de5444ee2d4e01226a0.tar.gz emacs-38d93f03c75ddbf853fe9de5444ee2d4e01226a0.zip | |
* progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun):
Push the mark at the start of these functions when appropriate.
Diffstat (limited to 'lisp/progmodes')
| -rw-r--r-- | lisp/progmodes/cc-cmds.el | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 56fc8032541..10267a6b2dc 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el | |||
| @@ -1501,6 +1501,11 @@ defun." | |||
| 1501 | (interactive "p") | 1501 | (interactive "p") |
| 1502 | (or arg (setq arg 1)) | 1502 | (or arg (setq arg 1)) |
| 1503 | 1503 | ||
| 1504 | (or (not (eq this-command 'c-beginning-of-defun)) | ||
| 1505 | (eq last-command 'c-beginning-of-defun) | ||
| 1506 | (and transient-mark-mode mark-active) | ||
| 1507 | (push-mark)) | ||
| 1508 | |||
| 1504 | (c-save-buffer-state | 1509 | (c-save-buffer-state |
| 1505 | (beginning-of-defun-function end-of-defun-function | 1510 | (beginning-of-defun-function end-of-defun-function |
| 1506 | (start (point)) | 1511 | (start (point)) |
| @@ -1604,6 +1609,11 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." | |||
| 1604 | (interactive "p") | 1609 | (interactive "p") |
| 1605 | (or arg (setq arg 1)) | 1610 | (or arg (setq arg 1)) |
| 1606 | 1611 | ||
| 1612 | (or (not (eq this-command 'c-end-of-defun)) | ||
| 1613 | (eq last-command 'c-end-of-defun) | ||
| 1614 | (and transient-mark-mode mark-active) | ||
| 1615 | (push-mark)) | ||
| 1616 | |||
| 1607 | (c-save-buffer-state | 1617 | (c-save-buffer-state |
| 1608 | (beginning-of-defun-function end-of-defun-function | 1618 | (beginning-of-defun-function end-of-defun-function |
| 1609 | (start (point)) | 1619 | (start (point)) |