emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] master 51e7e46: Font-lock elisp macros/special forms d


From: Tassilo Horn
Subject: Re: [Emacs-diffs] master 51e7e46: Font-lock elisp macros/special forms dynamically
Date: Mon, 16 Mar 2015 08:54:57 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Daniel Colascione <address@hidden> writes:

>>> Loading Elisp files should be fairly rare.  But there might be cases
>>> where it can be done repeatedly, but if/when faced with such a
>>> situation we should be able to handle it efficiently e.g. by
>>> checking the load-history (make sure the file did include some
>>> definitions before we bother to scan symbols and rebuild the regexp)
>>> since such "run-time loading" probably won't define new functions.
>> 
>> Like so?
>
> Instead of doing it this way, why not make a font-lock matcher that
> looks at *every* initial sexp atom, calls intern-soft on it, and
> applies a face that depends on properties of the found symbol? This
> way, we'd update fontification not only after load, but also after
> eval-defun, and it'd be easy to make a `declare'-form that provided
> for exceptions from the general rule.

Also sounds good to me, and even simpler implementation-wise.  So I'm
happy to implement it that way if nobody comes up with a reason why
that's not the right way.

And we need to decide if we're opt-in, e.g.,

  (defmacro foo ()
    (declare font-lock-keyword) ...)

makes foo highlighted as a keyword, or if we're opt-out, e.g., all
macros are highlighted by default unless declared as

  (defmacro foo ()
    (declare no-font-lock-keyword) ...)

And I'm open to a better declaration names than the ones above.

Bye,
Tassilo

Attachment: signature.asc
Description: PGP signature


reply via email to

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