emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with co


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] scratch/widen-less a4ba846: Replace prog-widen with consolidating widen calls
Date: Mon, 18 Dec 2017 16:50:04 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0

On 12/18/17 2:39 PM, Wedler, Christoph wrote:

I'm attaching a patch with some minor cleanup, though.

To be honest, I am not so sure about the cleanup.  I think it is better
to dynamically bind `syntax-ppss-cache' and `syntax-ppss-last' while
letting python-mode do its thing: neither should python-mode use the
cache state set from the ANTLR syntax, nor should antlr-mode later use
the syntax state set by pathon-mode.  Or do I miss something?

It shouldn't matter much either way, but in Emacs 26 syntax-ppss already checks that point-min has not changed since the last invocation.

And it uses two caches under the hood: one for the "full" buffer, and another for the most recent narrowing.

Please try it with a build of Emacs from the 'widen-less' branch. Do you
know how to build it?

It seems to have worked, even on a MacOS - good!  To do it without much
Additional installation for the moment, I used
     ./configure --with-ns --without-makeinfo --with-gnutls=no

Good.

Did you use the same recipe when testing the widen-less branch, though? I'm pretty sure you can't simply run ./configure when building from development sources (not a pre-built tarball).

Are you sure that you use antlr-mode 3.1.5 (not the one from Emacs)?

Yes.

Everything works for me with Emacs-26.0.90, too – I also tried an empty
init.el…

I'm saying I don't know what to check. Indentation certainly doesn't work the same, e.g. because the examples use a non-default indentation offset. But I'm not sure that's all.

Now to a mode with non-widening indentation function: emacs-lisp mode:
Consider the following code
      (defun foo ()
        (+ 1 3))

I would assume that the indentation of line 2 does not change
when I narrow to line 2 - but Emacs-25.1.1 now deletes the first 2
spaces of line 2...  (yes; I also need to update to a newer Emacs)

Try out the widen-less branch!

Ehem, still the same...

Are you sure you tried the right branch? It works differently over here (namely: doesn't change the indentation).

Yes, using `js-indent-line' is a better example.
`c-indent-line' (c-indent-defun looks like a typo) is tricky - see my
ugly function `antlr-indent-line' (but I have a TODO...)

I've pushed that change. If you have any more comments on the manual entry and it's written now, please let me know.

P.S. I will probably "borrow" (aka "steal") from mhtml-mode.el later...

Sounds good!



reply via email to

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