all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Level of headings not recognised
@ 2024-08-10 15:07 Heime
  2024-08-10 17:49 ` Heime
  0 siblings, 1 reply; 5+ messages in thread
From: Heime @ 2024-08-10 15:07 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-11  0:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-10 15:07 Level of headings not recognised Heime
2024-08-10 17:49 ` Heime
2024-08-10 20:30   ` Heime
2024-08-10 22:08     ` Christopher Dimech
2024-08-11  0:02       ` Heime

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.