* Constructing outline-regexp to include title text
@ 2023-06-15 19:32 uzibalqa
2023-06-16 8:28 ` uzibalqa
0 siblings, 1 reply; 2+ messages in thread
From: uzibalqa @ 2023-06-15 19:32 UTC (permalink / raw)
To: uzibalqa via Users list for the GNU Emacs text editor
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) )
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Constructing outline-regexp to include title text
2023-06-15 19:32 Constructing outline-regexp to include title text uzibalqa
@ 2023-06-16 8:28 ` uzibalqa
0 siblings, 0 replies; 2+ messages in thread
From: uzibalqa @ 2023-06-16 8:28 UTC (permalink / raw)
To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor
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 ?
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-06-16 8:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 19:32 Constructing outline-regexp to include title text uzibalqa
2023-06-16 8:28 ` uzibalqa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).