[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Introducing face in comments for various modes
From: |
Heime |
Subject: |
Re: Introducing face in comments for various modes |
Date: |
Tue, 13 Dec 2022 09:46:50 +0000 |
------- Original Message -------
On Tuesday, December 13th, 2022 at 9:35 AM, Thibaut Verron
<thibaut.verron@gmail.com> wrote:
> On 13/12/2022 09:30, Heime wrote:
>
> > ------- Original Message -------
> > On Tuesday, December 13th, 2022 at 8:04 AM, Heime
> > heimeborgia@protonmail.com wrote:
> >
> > > ------- Original Message -------
> > > On Tuesday, December 13th, 2022 at 7:52 AM, Jean Louis bugs@gnu.support
> > > wrote:
> > >
> > > > Heime, I like the idea of highlighting comments, though I do it this
> > > > way to specify (syntax comment-start) as that works for multiple
> > > > modes.
> > > >
> > > > ; one
> > > > ;; two
> > > > ;;; three
> > > > ;;;; and more
> > > >
> > > > ;;; Highlighting comments
> > > >
> > > > (setq rcd-regexp-comment (rx line-start
> > > > (one-or-more (syntax comment-start))
> > > > (one-or-more space)
> > > > (group (one-or-more not-newline))
> > > > line-end))
> > > >
> > > > ;; (highlight-regexp regexp nil 1)
> > > > ;; (unhighlight-regexp regexp)
> > > >
> > > > Jean
> > > > I would like to introduce (syntax comment-start) in place
> > > > of ";;" in "^;;\s+\\[.+\\].*$".
>
>
> It's not something you can "introduce" in your regexp, it only makes
> sense within the context of a regexp built with rx:
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Rx-Notation.html
>
> Rewriting your regexp as an rx regexp would not be too difficult if you
> want to go that route, Jean's example is a good template.
>
> Otherwise, as an approximation of that feature, you could built your
> regex string using the value of the variable comment-start ( ";" in
> emacs-lisp-mode) instead of hardcoding ;; .
How can one specify two comment characters next to each other?
> To be clear, the variable comment-start happens to have the same name as
> the symbol in (syntax comment-start), but they are not the same thing,
> the syntax classification can in theory be a lot smarter than simply
> regexp matching.
- Re: Introducing face in comments for various modes, (continued)
- Re: Introducing face in comments for various modes, Thibaut Verron, 2022/12/12
- Re: Introducing face in comments for various modes, Christopher Dimech, 2022/12/12
- Re: Introducing face in comments for various modes, Christopher Dimech, 2022/12/12
- Re: Introducing face in comments for various modes, Stefan Monnier, 2022/12/12
- Re: Introducing face in comments for various modes, Christopher Dimech, 2022/12/13
- Re: Introducing face in comments for various modes, Stefan Monnier, 2022/12/12
- Re: Introducing face in comments for various modes, Jean Louis, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Thibaut Verron, 2022/12/13
- Re: Introducing face in comments for various modes,
Heime <=
- Re: Introducing face in comments for various modes, Thibaut Verron, 2022/12/13
- Re: Introducing face in comments for various modes, Christopher Dimech, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Thibaut Verron, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Jean Louis, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13
- Re: Introducing face in comments for various modes, Jean Louis, 2022/12/13
- Re: Introducing face in comments for various modes, Heime, 2022/12/13