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

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

Setting up new patterns for outline-minor-mode


From: Heime
Subject: Setting up new patterns for outline-minor-mode
Date: Sat, 30 Mar 2024 21:13:17 +0000

How can I change outline-minor-mode with new heading patterns using 
HN where N is the heading level.  

Allowing Zero or more spaces before ;;;
Allowing one or more spaces between ;;; and HN.  
Allowing one or more spaces between HN and TITLE

;;; H1 TITLE LEVEL 1
;;; H2 TITLE LEVEL 2

Have done the following, which works well 

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

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

But as soon as I apply this variation

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



reply via email to

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