[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 05:08:54 +0000 |
Sent with Proton Mail secure email.
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)