emacs-devel
[Top][All Lists]
Advanced

[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 18:30:11 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, Stefan.

On Tue, Mar 08, 2016 at 09:19:46AM -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.  That a high class editor such as Emacs should have
problems with such parens is ludicrous and unacceptable.

The amount of time I have lost investigating reported bugs, only to
realise that an open paren in column 0 was the cause, would exceed any
reasonable person's guess.  Bug #22884, reported by Paul last week, is
only the latest in a long list.

With my change, open_paren_in_column_0_is_defun_start simply vanishes
from syntax.c[*], as does `find_defun_start'.  Users can freely write
parens in their strings and comments.  Comments are scanned only in the
forward direction, getting rid of all the nastiness about mixed quote
characters, and the like.  It doesn't appear to cause undue delay
anywhere (on my machine, scanning the entirety of xdisp.c for literals
takes about 0.25 seconds).

[*] OK, it stays in as a declaration for Lisp programs, but isn't used
in syntax.c.

[ .... ]

>       Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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