From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Leo Liu <sdl.web@gmail.com>
Cc: 14303@debbugs.gnu.org
Subject: bug#14303: 24.3; Bug in comment-search-backward
Date: Fri, 17 May 2013 11:52:54 -0400 [thread overview]
Message-ID: <jwvppwpip17.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m1li7dlobu.fsf@gmail.com> (Leo Liu's message of "Fri, 17 May 2013 21:37:25 +0800")
>> 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
next prev parent reply other threads:[~2013-05-17 15:52 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-29 13:27 bug#14303: 24.3; Bug in comment-search-backward Leo Liu
2013-05-15 11:33 ` Leo Liu
2013-05-15 16:13 ` Andreas Röhler
2013-05-16 4:02 ` Leo Liu
2013-05-16 7:12 ` Andreas Röhler
2013-05-17 10:47 ` Leo Liu
2013-05-17 11:14 ` Andreas Röhler
2013-05-17 11:34 ` Leo Liu
2013-05-17 12:39 ` Andreas Röhler
2013-05-17 13:18 ` Leo Liu
2013-05-17 13:28 ` Stefan Monnier
2013-05-17 13:37 ` Leo Liu
2013-05-17 14:27 ` Andreas Röhler
2013-05-17 22:52 ` Leo Liu
2013-05-18 5:23 ` Andreas Röhler
2013-05-21 1:55 ` Stefan Monnier
2013-05-22 10:58 ` Andreas Röhler
2013-05-22 15:58 ` Stefan Monnier
2013-05-22 16:53 ` Andreas Röhler
2013-05-17 15:52 ` Stefan Monnier [this message]
2013-05-17 22:54 ` Leo Liu
2013-05-16 13:28 ` Stefan Monnier
2013-05-16 15:50 ` Leo Liu
2013-05-16 17:38 ` Stefan Monnier
2013-05-17 0:35 ` Leo Liu
2013-05-17 13:26 ` Stefan Monnier
2013-05-17 22:51 ` Leo Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvppwpip17.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=14303@debbugs.gnu.org \
--cc=sdl.web@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.