emacs-devel
[Top][All Lists]
Advanced

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

Re: html, css, and js modes working together


From: Stefan Monnier
Subject: Re: html, css, and js modes working together
Date: Tue, 07 Feb 2017 09:33:43 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Stefan> As pointed out by Clément, these regexps are a bad idea.
Stefan> Better do something like:
> This seems reasonable but I don't understand where to check for the end
> of the element.  Don't I still need a search forward in the
> html-syntax-propertize function?  Or in your example were you supposing
> that this would be done by "html--syntax-propertize-submode"?

Yes, html--syntax-propertize-submode would search for the end of the
sub-region (only up to `end`, of course), mark the found area with
a text-property, and then call the sub-mode's syntax-propertize-function
on that area.

Stefan> (defun html--get-mode-vars (mode)
Stefan> (with-temp-buffer
Stefan> (funcall mode)
Stefan> (buffer-local-variables)))

> Tricky!  I looked at the buffer-local-variables here though and there is
> a lot of stuff that I think either isn't relevant or is potentially
> harmful.  So I think for the time being I will stick to a more explicit
> approach.

Yes, you need to filter out the elements you don't want, or pick the few
elements you do want.  But I think you're better off manually
maintaining a list of relevant variables, than manually maintaining not
only which variables are relevant but also the values used by each of the
sub-modes (which in turns causes circular dependencies between the
packages).


        Stefan



reply via email to

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