summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2010-05-12 11:06:12 +0000
committerAlan Mackenzie <acm@muc.de>2010-05-12 11:06:12 +0000
commit38d93f03c75ddbf853fe9de5444ee2d4e01226a0 (patch)
tree525d7a711a4c8ec6151a4b115e86d01bb070833e
parent706deb23dce31d2af3e672c3f30d0a578c023c12 (diff)
downloademacs-38d93f03c75ddbf853fe9de5444ee2d4e01226a0.tar.gz
emacs-38d93f03c75ddbf853fe9de5444ee2d4e01226a0.tar.bz2
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.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/cc-cmds.el10
2 files changed, 15 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e0cbf007771..39001a369fa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-12 Alan Mackenzie <acm@muc.de>
+
+ * progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun):
+ Push the mark at the start of these functions when appropriate.
+
2010-05-12 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuffer.el (completion-cycle-threshold): New custom var.
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."
(interactive "p")
(or arg (setq arg 1))
+ (or (not (eq this-command 'c-beginning-of-defun))
+ (eq last-command 'c-beginning-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
+
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
(start (point))
@@ -1604,6 +1609,11 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
(interactive "p")
(or arg (setq arg 1))
+ (or (not (eq this-command 'c-end-of-defun))
+ (eq last-command 'c-end-of-defun)
+ (and transient-mark-mode mark-active)
+ (push-mark))
+
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
(start (point))