From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#6100: c-beginning-of-defun doesn't push mark Date: Thu, 6 May 2010 10:54:33 +0000 Message-ID: <20100506105433.GA1366__40931.241963017$1273161149$gmane$org@muc.de> References: <87mxwf942y.fsf@mail.jurta.org> <87k4rimcdr.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1273161149 16725 80.91.229.12 (6 May 2010 15:52:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 May 2010 15:52:29 +0000 (UTC) Cc: 6100@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 06 17:52:28 2010 connect(): No such file or directory Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OA3ND-0006IB-1s for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 May 2010 17:52:27 +0200 Original-Received: from localhost ([127.0.0.1]:60328 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OA3NC-0007MD-Fh for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 May 2010 11:52:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O9ykd-0004FJ-W9 for bug-gnu-emacs@gnu.org; Thu, 06 May 2010 06:56:20 -0400 Original-Received: from [140.186.70.92] (port=57321 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9ykc-0004CM-2n for bug-gnu-emacs@gnu.org; Thu, 06 May 2010 06:56:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9ykZ-00006r-O6 for bug-gnu-emacs@gnu.org; Thu, 06 May 2010 06:56:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48042) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9ykT-00005H-Gv; Thu, 06 May 2010 06:56:09 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O9ybe-0000kW-0C; Thu, 06 May 2010 06:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 06 May 2010 10:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6100 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 6100-submit@debbugs.gnu.org id=B6100.12731427752867 (code B ref 6100); Thu, 06 May 2010 10:47:01 +0000 Original-Received: (at 6100) by debbugs.gnu.org; 6 May 2010 10:46:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9yas-0000kC-K9 for submit@debbugs.gnu.org; Thu, 06 May 2010 06:46:14 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9yaq-0000k7-3e for 6100@debbugs.gnu.org; Thu, 06 May 2010 06:46:13 -0400 Original-Received: (qmail 78649 invoked by uid 3782); 6 May 2010 10:46:05 -0000 Original-Received: from acm.muc.de (pD9E2229E.dip.t-dialin.net [217.226.34.158]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Thu, 06 May 2010 12:45:22 +0200 Original-Received: (qmail 4791 invoked by uid 1000); 6 May 2010 10:54:33 -0000 Content-Disposition: inline In-Reply-To: <87k4rimcdr.fsf@mail.jurta.org> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 06 May 2010 06:47:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36742 Archived-At: Hi, Juri, On Wed, May 05, 2010 at 09:28:32PM +0300, Juri Linkov wrote: > >> There is one annoying difference between `beginning-of-defun' > >> and `c-beginning-of-defun': > >> `beginning-of-defun' and `end-of-defun' pushes the mark for the > >> old point location to the mark ring with this code: > >> (or (not (eq this-command 'beginning-of-defun)) > >> (eq last-command 'beginning-of-defun) > >> (and transient-mark-mode mark-active) > >> (push-mark)) > >> but `c-beginning-of-defun' doesn't do that. > >> This patch add the same code to `c-beginning-of-defun' and `c-end-of-defun': > > Of course, I'd argue that the right fix is to use `beginning-of-defun'. > Do you mean cc-mode should use `beginning-of-defun-function'? This would be OK. Unfortunately, end-of-defun-function isn't called cleanly. With a C-M-e, {beginning,end}-of-defun-function are often called 4 times. c-end-of-defun, however, already does the Right Thing on its own. c-{beginning,end}-of-defun have a heavy overhead in determining the type of starting position (inside the brace block, inside the function header, etc.) and in locating a top-level brace (at the start) and the start of the header (at the end). This overhead dominates the speed of the functions, which work essentially as fast regardless of how big ARG is. The speed of c-{beginning,end}-of-defun have presented problems from time to time. Quadrupling CC Mode's end-of-defun's runtime doesn't seem a good idea. I want to keep the handling of c-{beginning,end}-of-defun symmetrical for ease of maintenance. I would favour your patch to these defuns which pushes the marks. > Juri Linkov -- Alan Mackenzie (Nuremberg, Germany).