emacs-diffs
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112522: * lisp/progmodes/ruby-mo


From: Dmitry Gutov
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r112522: * lisp/progmodes/ruby-mode.el: First cut at SMIE support.
Date: Thu, 23 May 2013 02:10:26 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6

On 23.05.2013 1:58, Stefan Monnier wrote:
Huh, I didn't know that.  I don't think there can be a way to do the same for
syntax highlighting, though.

No, indeed.  It does mostly work to test the syntax-ppss behavior, tho,
because a bug in it will typically cause bugs in indentation as well.
IOW it does largely test syntax-table and syntax-propertize, but it
doesn't test the font-lock-keywords part.

That's largely true, with the exception that some syntax-propertization is mostly performed for the sake of appearance. An unpropertized regexp literal without unpaired parens or quotes inside is unlikely to fail the test.

We could potentially test it by calling htmlfontify-buffer.

So, there would be a reference html file everyone would have to update after making a change in indent/ruby.rb?

Speaking of SMIE and indentation, though, don't you find it inconvenient
that to run the tests with it enabled, you have to put (setq ruby-use-smie
t) in your init file, and then maybe remove it later and rerun the tests, to
see that some changes did't break anything in the default algorithm?

No, I just do something like

      make ruby.rb.test EMACS="emacs -Q --eval '(setq ruby-use-smie t)'"

I see, that's better.

ruby-mode also has customization variables that change indentation behavior
(at least one, for now, and we should add more). How do you propose to
test that?

Indeed, that's a widespread limitation with the current system.

I suppose we could set the variables via file-local vars mechanism, but that'll require us to have multiple files, one per combination of variables.

Or introduce some new kind of preprocessing, say, treat the same kind of comment in the middle of the file as an indication to stop, change the values, and indent the part of the file below with new values applied.



reply via email to

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