[Top][All Lists]

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

Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text

From: Alan Mackenzie
Subject: Re: [Emacs-diffs] comment-cache 223d16f 2/3: Apply `comment-depth' text properties when calling `back_comment'.
Date: Tue, 8 Mar 2016 20:07:53 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello again, Stefan.

On Tue, Mar 08, 2016 at 01:42:28PM -0500, Stefan Monnier wrote:
> >> >     Apply `comment-depth' text properties when calling `back_comment'.
> >> FWIW, I think if you want to speed up back_comment, a simpler approach
> >> is to make it use syntax-ppss, which already implements a cache, and
> >> will usually already have the cache filled for you.
> > My changes might speed up back_comment, but that's not the prime reason
> > for them.  Rather, I want utterly to expunge all the nonsense about
> > parens in column 0.

> Not sure how the two differ.  The main/only real use for this "paren in
> column 0" hack is for back_comment.  IOW my comment also applies to "if
> you want to get rid of all the nonsense about parens in column 0".

syntax-ppss is a lisp level thing, rather loosely defined.  The text
property cache I have built is more rigorous; it is nearly impervious to
anything a non-malicious lisp program might do to it and works better.
For example it reacts to the setting/clearing of the particular
syntax-table text properties it's sensitive to, even when
inhibit-modification-hooks is non-nil (which it _always_ is when text
properties are changed).

> > That a high class editor such as Emacs should have
> > problems with such parens is ludicrous and unacceptable.

> FWIW, I (setq open-paren-in-column-0-is-defun-start nil) in my ~/.emacs.

People (e.g. Martin R.) have complained that this makes CC Mode too slow.
If I understand correctly, you work on a super fast machine, not an
ordinary PC.

> > With my change, open_paren_in_column_0_is_defun_start simply vanishes
> > from syntax.c[*], as does `find_defun_start'.

> Using syntax-ppss would give you the same benefit.

> My point is that instead of creating a new kind of "syntax cache" for
> this specific purpose, we'd be better off using the cache we already have.

Maybe, maybe not.  Special purpose things can have an austere simplicity
which their general purpose equivalents lack.  Think of a high quality
screwdriver, and compare it to using the screwdriver piece of a Swiss
Army knife.

>         Stefan

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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