[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Allowing spaces in the regexp for outlines
From: |
Heime |
Subject: |
Re: Allowing spaces in the regexp for outlines |
Date: |
Thu, 21 Mar 2024 06:40:56 +0000 |
On Thursday, March 21st, 2024 at 5:08 PM, Heime <heimeborgia@protonmail.com>
wrote:
> On Thursday, March 21st, 2024 at 7:45 AM, Emanuel Berg incal@dataswamp.org
> wrote:
>
> > Heime wrote:
> >
> > > (defvar el-hglevels
> > > '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4) )
> > > "Outline levels for elisp major mode.")
> >
> > You can also use `comment-start' instead of hardcoding ';',
> > and use explicit repitition instead of hardcoding 3 - see
> >
> > (info "(elisp) Regexp Backslash")
> >
> > - and then also not hardcode the 1s, 2s, 3s, and 4s in pairs
> > but inserting them as integers into the string.
> >
> > So yes, you can improve a lot! And spend all weekend on it.
>
>
> Have attempted the following without success
>
> (";;;\\[[:space:]]+H1" . 1)
>
> (";;;\[[:space:]]+H1" . 1)
>
> (";;;[[:space:]]+H1" . 1)
And now as well with
(";;;\\([[:space:]]+\\)H1" . 1)