From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#16526: 24.3.50; scroll-conservatively & c-mode regression Date: Mon, 27 Jan 2014 09:49:28 -0500 Message-ID: References: <838uu4cq11.fsf@gnu.org> <52E3D131.2090705@gmx.at> <83r47wausm.fsf@gnu.org> <52E3EAC2.2040100@gmx.at> <83lhy4as2l.fsf@gnu.org> <52E4019C.5080905@gmx.at> <83k3dnc3rl.fsf@gnu.org> <83iot7c3bq.fsf@gnu.org> <52E4EF61.3050404@gmx.at> <831tzubqxw.fsf@gnu.org> <20140126204310.GA3937@acm.acm> <52E61704.6050807@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1390834286 32421 80.91.229.3 (27 Jan 2014 14:51:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2014 14:51:26 +0000 (UTC) Cc: Alan Mackenzie , 16526@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jan 27 15:51:33 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W7nX8-0002Yz-2D for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 15:51:30 +0100 Original-Received: from localhost ([::1]:59943 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7nX7-0004LJ-M2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 27 Jan 2014 09:51:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7nVy-0002j8-Gg for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 09:50:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7nVr-0006ys-6V for bug-gnu-emacs@gnu.org; Mon, 27 Jan 2014 09:50:18 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7nVj-0006pk-8b; Mon, 27 Jan 2014 09:50:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1W7nVi-0001j6-6R; Mon, 27 Jan 2014 09:50:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Mon, 27 Jan 2014 14:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16526 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 16526-submit@debbugs.gnu.org id=B16526.13908341716596 (code B ref 16526); Mon, 27 Jan 2014 14:50:02 +0000 Original-Received: (at 16526) by debbugs.gnu.org; 27 Jan 2014 14:49:31 +0000 Original-Received: from localhost ([127.0.0.1]:37533 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7nVC-0001iJ-Ve for submit@debbugs.gnu.org; Mon, 27 Jan 2014 09:49:31 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3889) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W7nVA-0001iB-Uh for 16526@debbugs.gnu.org; Mon, 27 Jan 2014 09:49:29 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EABK/CFHO+IO1/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av8EABK/CFHO+IO1/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="46155646" Original-Received: from 206-248-131-181.dsl.teksavvy.com (HELO pastel.home) ([206.248.131.181]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jan 2014 09:49:28 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 1615860467; Mon, 27 Jan 2014 09:49:28 -0500 (EST) In-Reply-To: <52E61704.6050807@gmx.at> (martin rudalics's message of "Mon, 27 Jan 2014 09:21:24 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 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: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:84111 Archived-At: > IIUC now any call to `forward-comment' with a negative argument will > automatically go to BOB unless it's already there. Actually, that should not always be the case, no. > How else could it determine that it's not called from a position > within a comment? In general, that is true, but back_comment tries to be more clever, e.g, when it scans backward over code like /* toto */ blabla /* titi */ it should not need to scan further than the end of line 1, since the "*/" there will tell it that the "/*" on line 3 can't be within another comment and is hence the one-true comment starter that matches the "*/" on line 3. Of course, reality is more complex because there are also strings and //...\n comments, but at least back_comment tries to avoid scanning from BOB when it can. I think it even tries hard enough to consciously prefer performance over correctness, so that it will incorrectly handle // hello /* there bogus code */ and will jump to "/*" thinking it jumped over a comment. > In any case, please provide an option say > `c-open-paren-in-column-0-is-defun-start' which people can set to avoid > those scans. The doc-string should mention that things like Michael's > commented out code are handled correctly iff this option is nil and that > long delays while working with c-mode can be sometimes avoided by > setting this option to t. The default value could be obviously nil. Another option is to put a syntax-table property on those rare open-paren-in-column-0-inside-comment-or-string, so that open-paren-in-column-0-is-defun-start still works properly. Stefan PS: And yes, back_comment should somehow make use of syntax-ppss-cache to avoid scanning from BOB.