[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r111958: * lisp/progmodes/ruby-mo

From: Dmitry Gutov
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
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3

On 09.03.2013 5:41, Stefan Monnier wrote:
              ;; The regular expression itself.
-           (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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]