From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111958: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only
Date: Sat, 09 Mar 2013 05:45:07 +0400 [thread overview]
Message-ID: <513A9423.1000301@yandex.ru> (raw)
In-Reply-To: <jwv62118icg.fsf-monnier+emacs@gnu.org>
On 09.03.2013 5:41, Stefan Monnier wrote:
>> ;; The regular expression itself.
>> "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)")
>> - (2 (string-to-syntax "\"/"))
>> - (3 (string-to-syntax "\"/")))
>> + (3 (unless (nth 3 (syntax-ppss (match-beginning 2)))
>> + (put-text-property (match-beginning 2) (match-end 2)
>> + 'syntax-table (string-to-syntax "\"/"))
>> + (string-to-syntax "\"/"))))
>
> If match n°2 is not inside a string, I think we should not skip all
> that's matched by the regexp (since it's not a string and may hence
> contain other things that need to be syntax-propertized). I.e. The
> `unless' should be turned into an `if' and in the non-string case it
> should move point back to (match-end 2).
`syntax-ppss' moves point, so that's taken care of. See the second test
in the same commit.
I agree that that's not obvious from reading the code, though.
next prev parent reply other threads:[~2013-03-09 1:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1UDJq5-0007SO-Pc@vcs.savannah.gnu.org>
2013-03-09 1:41 ` [Emacs-diffs] /srv/bzr/emacs/trunk r111958: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): Only Stefan Monnier
2013-03-09 1:45 ` Dmitry Gutov [this message]
2013-03-09 3:22 ` Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513A9423.1000301@yandex.ru \
--to=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).