help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Allowing spaces in the regexp for outlines


From: Emanuel Berg
Subject: Re: Allowing spaces in the regexp for outlines
Date: Wed, 20 Mar 2024 20:45:22 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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.

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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