[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Constructing outline-regexp to include title text
From: |
uzibalqa |
Subject: |
Re: Constructing outline-regexp to include title text |
Date: |
Fri, 16 Jun 2023 08:28:49 +0000 |
Sent with Proton Mail secure email.
------- Original Message -------
On Friday, June 16th, 2023 at 7:32 AM, uzibalqa <uzibalqa@proton.me> wrote:
> I am changing the recognition of headings in outline-minor-mode. Currently
> only the heading
> level is described.
>
> ;;; MN
>
> where N is the level number.
>
> I want to add the possibility of a heading title text and need to change
> outline-minor-mode.
>
> ;;; M1 This is a title for Level 1.
> ;;; M2 This is a title for Level 2.
>
> (defvar elisp-hglevels
> '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
> (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) )
> "Set outline levels for for command shell outline headings.")
>
> (defun elisp-outl ()
> "Set bash headings for outline mode."
> (interactive)
> (setq outline-regexp
> (concat (regexp-opt (mapcar 'car elisp-hglevels)) "\\>"))
>
> (setq outline-heading-alist elisp-hglevels) )
Have been looking at examples of outline-regexp. The pattern looks complicated.
(setq outline-regexp "^[ \t]*\\(.*:\\)\\s-*$")
Am looking for a simpler way to construct outline-regexp. How can introduce
text with
an ending pattern that captures any characters (except newline) followed by
zero or
more whitespace characters at the end of the line ?