emacs-devel
[Top][All Lists]
Advanced

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

Permission requested to merge branch comment-cache into master.


From: Alan Mackenzie
Subject: Permission requested to merge branch comment-cache into master.
Date: Sat, 12 Mar 2016 00:28:37 +0000
User-agent: Mutt/1.5.24 (2015-08-30)

Hello, John.

Could I merge branch comment-cache into master, please?

Background:

in bug #22884, Paul reported a simple edit in config.h taking around 10
seconds to echo.  The cause was an open parenthesis in column zero which
Emacs's low level routines (in syntax.c) wrongly parsed as a start of
defun.

I have reformulated and grossly simplified the routines which scan
comments, now scanning them exclusively in the forward direction (which
is easy) and recording them (and strings) with text properties.  The old
routines attempt (and sometimes fail) to scan comments going backwards.
Parentheses in column zero have entirely ceased to be an issue - there
is no longer even code to handle them.  (OK, the old code is still there
- I haven't removed it yet.)

The new scheme adds a small time overhead (~0.25s to scan xdisp.c on my
6 y.o. machine), and will also use a modest amount of extra storage for
the text properties.  After the initial scan, movement over comments is
lightening fast.

I am confident that the new approach is right, and I am confident the
new code is reliable and ready for prime time, even if, perhaps, not yet
entirely bug-free.

Alternatives:

An alternative approach using the syntax-ppss cache has been discussed
and tried.  For reasons currently being discussed in bug #22983:
(syntax-ppss returns wrong result) and the emacs-devel thread "Problems
with syntax-ppss: Was [... Apply `comment-depth' text properties when
calling `back_comment'.]", this approach cannot work.  It also does
nothing to tame the complexity of the current comment scanning routines.

So, I'd like to merge branch comment-cache, at least on a trial basis.
What do you say?

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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