]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun):
authorAlan Mackenzie <acm@muc.de>
Wed, 12 May 2010 11:06:12 +0000 (11:06 +0000)
committerAlan Mackenzie <acm@muc.de>
Wed, 12 May 2010 11:06:12 +0000 (11:06 +0000)
Push the mark at the start of these functions when appropriate.

lisp/ChangeLog
lisp/progmodes/cc-cmds.el

index e0cbf007771cf544bc6667b8769f72e6ac1c6da8..39001a369fa31092816b4016e102ff1eeca9ef55 100644 (file)
@@ -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.
index 56fc80325412c5b675087dee794ae280b9bc178e..10267a6b2dc27fd6426da9f3ffbd98bb653e8db5 100644 (file)
@@ -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))