[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 5c70ff9: New user option 'font-lock-ignore'
From: |
Eli Zaretskii |
Subject: |
Re: master 5c70ff9: New user option 'font-lock-ignore' |
Date: |
Sat, 02 Apr 2022 14:58:35 +0300 |
> From: Augusto Stoffel <arstoffel@gmail.com>
> Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
> Date: Sat, 02 Apr 2022 13:18:40 +0200
>
> >> The intention is that the user can write, for instance
> >>
> >> (setq font-lock-ignore '((prog-mode font-lock-*-face)))
> >>
> >> and this will be equivalent to
> >>
> >> (setq font-lock-ignore '((prog-mode (pred (lambda (obj)
> >> (and (symbolp obj)
> >> (string-match-p
> >>
> >> "\\`font-lock-.*-face\\'"
> >> (symbol-name
> >> obj))))))))
> >>
> >> Do you agree this is a sensible and convenient mini-language? I guess
> >> Stefan liked the idea, at least :-).
> >
> > I understand the intent. I'm saying that we should document this
> > "mini-language" in sufficient detail, so that Lisp programmers knew
> > how to use it.
>
> Strictly speaking the docstring of 'font-lock-ignore' provides a
> complete specification of the mini-language; if not, it's a bug in the
> docstring.
So you want to support only the "*" wildcard and nothing else?
> >> Hum, I'm not sure I understand the fine-grained distinction your are
> >> making here. font-lock.el speaks of "font lock keywords"; the thing
> >> that fontifies variable names with font-lock-variable-face would be a
> >> "font lock keyword" in that terminology. I'm just following along the
> >> terminology.
> >
> > That terminology (if this is how you perceive it) is wrong, and I'm
> > about to change it to make that more clear. font-lock-keywords are
> > not just keywords, they are rules for fontification.
>
> I certainly agree that font-lock.el's use of "font-lock keyword" as a
> term for "rules for fontification" is a bit odd. OTOH it's an
> established use.
That's a historic accident, AFAICT: originally we didn't support there
anything but keywords.
- Re: master 5c70ff9: New user option 'font-lock-ignore', Eli Zaretskii, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Augusto Stoffel, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Eli Zaretskii, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Augusto Stoffel, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore',
Eli Zaretskii <=
- Re: master 5c70ff9: New user option 'font-lock-ignore', Augusto Stoffel, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Eli Zaretskii, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Augusto Stoffel, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Eli Zaretskii, 2022/04/02
- Re: master 5c70ff9: New user option 'font-lock-ignore', Augusto Stoffel, 2022/04/02
Re: master 5c70ff9: New user option 'font-lock-ignore', Stefan Monnier, 2022/04/02
RE: [External] : Re: master 5c70ff9: New user option 'font-lock-ignore', Drew Adams, 2022/04/02