emacs-devel
[Top][All Lists]
Advanced

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

Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-pp


From: Stefan Monnier
Subject: Re: /srv/bzr/emacs/trunk r101338: * lisp/emacs-lisp/syntax.el (syntax-ppss): More sanity check to catch
Date: Mon, 10 Feb 2014 11:18:41 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>> -                     ;; Simple sanity check.
>> +                     ;; Simple sanity checks.
>> +                         (< (point) pos) ; backward-paragraph can fail here.

> Why `<' and not `<='?

IIRC the reason was so that (syntax-ppss) called from a place like
a "column-0 just before an open paren" can correctly indicate if this
open paren is within a string/comment while at the same time parsing the
subsequent text assuming that this open paren was outside of any
string/comment.

Maybe there is another reason, but that's the one I remember.
Not a terribly strong reason, admittedly.

> In mmm-mode, we call the default font-lock-fontify-region function with
> bounds of each subregion as arguments, and we also try to limit
> `syntax-ppss' to these regions, so the `syntax-begin-function' brings
> point to the beginning of the current subregion.

But there's no guarantee syntax-begin-function will be used at
all, so I'm not sure how important changing this test is.
Is it really sufficient to make syntax-ppss understand mmm's sub-modes?


        Stefan



reply via email to

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