From 38d93f03c75ddbf853fe9de5444ee2d4e01226a0 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Wed, 12 May 2010 11:06:12 +0000 Subject: [PATCH] * progmodes/cc-cmds.el (c-beginning-of-defun, c-end-of-defun): Push the mark at the start of these functions when appropriate. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-cmds.el | 10 ++++++++++ 2 files changed, 15 insertions(+) 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 + + * 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 * 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)) -- 2.11.4.GIT