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

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

Re: Level of headings not recognised


From: Heime
Subject: Re: Level of headings not recognised
Date: Sat, 10 Aug 2024 17:49:03 +0000

On Sunday, August 11th, 2024 at 3:07 AM, Heime <heimeborgia@protonmail.com> 
wrote:

> What is wrong in setting heading levels this way ?
> 
> When I apply the following code, Level H1 is considered at same hierarchy as
> other levels. This means that if I do "Hide Sublevels" headings at levels 2,
> 3 etc still get displayed.
> 
> (defvar mast-elisp-levels
> '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
> (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) ))
> 
> (defun mast-regexp ()
> 
> (let ( (hrklevels nil) )
> 
> (cond
> ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode))
> (setq hrklevels mast-elisp-levels)))
> 
> (when hrklevels
> (setq outline-regexp
> (concat (regexp-opt (mapcar 'car hrklevels)) "\\>"))
> 
> (setq outline-heading-alist hrklevels)) ))
> 
> (defun mast-regexp-hooks (actm)
> 
> (let ( (kmdalit '(emacs-lisp-mode-hook
> lisp-interaction-mode-hook) )
> 
> (hook-fn (cond
> ((eq actm 'add) #'add-hook)
> ((eq actm 'remove) #'remove-hook)
> (t (error "ACTM %s is invalid" actm)))) )
> 
> (dolist (mdhk kmdalit)
> (funcall hook-fn mdhk #'mast-regexp)) ))

Should one use setq, setq-local, steq-default.  Cannot get headings to
work from level 2 to 8




reply via email to

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