unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Setting up new patterns for outline-minor-mode
@ 2024-03-30 21:13 Heime
  0 siblings, 0 replies; only message in thread
From: Heime @ 2024-03-30 21:13 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


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) ))



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-30 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-30 21:13 Setting up new patterns for outline-minor-mode Heime

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).