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

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

Changing the definition of headings for outline-minor-mode


From: uzibalqa
Subject: Changing the definition of headings for outline-minor-mode
Date: Sun, 18 Jun 2023 17:07:42 +0000

I want to change the recognition of outlines in the following manner

;;; H1 Title at Level 1
;;; H2 Title at Level 2
;;; H3 Title at Level 3

rather than 

;;; Title at Level 1
;;;; Title at Level 2
;;;;; Title at Level 3

Have done the following, but need to allow the use of text for the heading.


(defvar elisp-hglevels
  '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
     (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) )

  "Set outline levels for standard (canonical) headings.")


(defun elisp-hgptn ()
  "Set the elisp heading patterns defining outlines.

Set the patterns for the recognition of outline headings by
'outline-minor-mode', determined via 'outline-regexp'.  Heading
levels are determined through an association between a heading
and its hierarchical level."

  (interactive)

  (let ( (hglevels elisp-hglevels) )

    (setq outline-regexp
           (concat (regexp-opt (mapcar 'car hglevels)) "\\>"))
    (setq outline-heading-alist hglevels)) )



reply via email to

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