[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Setting up user defined texinfo headlines using outline-heading-alis
From: |
Jean Louis |
Subject: |
Re: Setting up user defined texinfo headlines using outline-heading-alist |
Date: |
Thu, 13 May 2021 21:29:31 +0300 |
User-agent: |
Mutt/2.0.6 (2021-03-06) |
Hello Yuri,
Thank you for insightful explanation.
* Yuri Khan <yuri.v.khan@gmail.com> [2021-05-13 19:12]:
> outline-regexp is a variable defined in ‘outline.el’.
> Its value is (regexp-op "[*^L]+"
Here, not quite sure, but how I see the above regular expression
it will fold on the new line where there is character ^L, is it?
> So let’s change your hook function to set that:
>
> (defun instate-texinfo-hdlevels ()
> (setq-local outline-heading-alist texinfo-hdlevels)
> (setq-local outline-regexp
> (concat (regexp-opt (mapcar 'car texinfo-hdlevels)) "\\>")))
Interesting, I did not know the `regexp-opt' function, that is
very handy. It finds the regular expression that will match the
given list of strings and I find your application smart.
(regexp-opt '("something" "anything")) ⇒ "\\(?:\\(?:any\\|some\\)thing\\)"
(regexp-opt '("TODO" "DONE" "DELEGATED")) ⇒
"\\(?:D\\(?:ELEGATED\\|ONE\\)\\|TODO\\)"
and that may be reused with certainty to work:
(highlight-regexp "\\(?:D\\(?:ELEGATED\\|ONE\\)\\|TODO\\)")
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
Sign an open letter in support of Richard M. Stallman
https://stallmansupport.org/
https://rms-support-letter.github.io/
- outline-heading-alist for elisp using ";; * ", (continued)
- outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/11
- Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/11
- Re: outline-heading-alist for elisp using ";; * ", Stefan Monnier, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ", Yuri Khan, 2021/05/12
- Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/12
- Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist,
Jean Louis <=
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Yuri Khan, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Stefan Monnier, 2021/05/13
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Christopher Dimech, 2021/05/14
- Re: Setting up user defined texinfo headlines using outline-heading-alist, Jean Louis, 2021/05/13
Re: outline-heading-alist for elisp using ";; * ", Christopher Dimech, 2021/05/10
Re: outline-heading-alist for elisp using ";; * ", Jean Louis, 2021/05/11