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

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

Updating outline-regexp and outline-heading-alist for various major mode


From: uzibalqa
Subject: Updating outline-regexp and outline-heading-alist for various major modes
Date: Wed, 21 Jun 2023 10:41:45 +0000

I am setting outline-regexp and outline-heading-alist for various major modes.
As I increase the number of major modes I handle, it would be good not to repeat
things so much. 

  (cond
    ((eq major-mode 'emacs-lisp-mode)
          (let ( (hrklevels elisp-hrklevels) )
            (setq outline-regexp
                  (concat (regexp-opt (mapcar 'car hrklevels)) "\\>"))
            (setq outline-heading-alist hrklevels)))

    ((eq major-mode 'sh-mode)
          (let ( (hrklevels bash-hrklevels) )
            (setq outline-regexp
                  (concat (regexp-opt (mapcar 'car hrklevels)) "\\>"))
            (setq outline-heading-alist hrklevels))) ))







Sent with Proton Mail secure email.



reply via email to

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