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#14303: 24.3; Bug in comment-search-backward Date: Fri, 17 May 2013 11:52:54 -0400 Message-ID: References: <5193B43B.8070007@easy-emacs.de> <519486DD.1040505@easy-emacs.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368807013 6191 80.91.229.3 (17 May 2013 16:10:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 May 2013 16:10:13 +0000 (UTC) Cc: 14303@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 17 18:10:12 2013 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 1UdNEP-00085r-4I for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2013 18:10:09 +0200 Original-Received: from localhost ([::1]:39476 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdNEO-0001B1-Kc for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2013 12:10:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdNEL-00019E-Bs for bug-gnu-emacs@gnu.org; Fri, 17 May 2013 12:10:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdMyZ-0000Zr-VL for bug-gnu-emacs@gnu.org; Fri, 17 May 2013 11:53:59 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdMyZ-0000ZE-P8 for bug-gnu-emacs@gnu.org; Fri, 17 May 2013 11:53:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UdMyo-00045p-DG for bug-gnu-emacs@gnu.org; Fri, 17 May 2013 11:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 May 2013 15:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 14303-submit@debbugs.gnu.org id=B14303.136880599715643 (code B ref 14303); Fri, 17 May 2013 15:54:02 +0000 Original-Received: (at 14303) by debbugs.gnu.org; 17 May 2013 15:53:17 +0000 Original-Received: from localhost ([127.0.0.1]:49165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdMy4-00044C-HV for submit@debbugs.gnu.org; Fri, 17 May 2013 11:53:17 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:53458) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UdMy0-00043w-Ax for 14303@debbugs.gnu.org; Fri, 17 May 2013 11:53:14 -0400 Original-Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r4HFqsNI013132; Fri, 17 May 2013 11:52:54 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id B3B9EB4161; Fri, 17 May 2013 11:52:54 -0400 (EDT) In-Reply-To: (Leo Liu's message of "Fri, 17 May 2013 21:37:25 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4582=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4582> : streams <962436> : uri <1422823> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:74373 Archived-At: >> I don't understand when that can happen (when inside a string (nth >> 8 ppss) is also non-nil). > I have > (defvar octave-comment-start-skip "\\(^\\|\\S<\\)\\(?:%!\\|\\s<+\\)\\s-*" > "Octave-specific `comment-start-skip' (which see).") > and this could find "#abc" as comment start where BEG is outside of > strings and comments but END is in a string. Ah, I see. That's easy to fix: just check the syntax-ppss state at the position about which you care, i.e. (or (match-end 1) (match-beginning 0)), rather than at the position at which re-search-backward puts you. > Maybe this is due to setting octave-comment-start-skip incorrectly. > I looked at comment-normalize-vars and see it uses: > \\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\) > as anchor but I don't understand fully. No, this is to try and avoid mis-recognizing \# (and \\\#, but not \\#) as a comment starter when \ is an escape character. Stefan