unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Change the regexp for outline-minor-mode
@ 2024-08-07 20:23 Heime
  2024-08-08  7:17 ` Heime
  0 siblings, 1 reply; 2+ messages in thread
From: Heime @ 2024-08-07 20:23 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I want to change the regexp for outline-minor-mode to use 3 semicolons,
followed by an H and the level number.

Have done the following but the settings are not taking effect.  Have
I done some mistake or are there other things that I have to do?

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

(defun mast-regexp ()

  (let ( (hlevels nil) )

    (cond
      ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode))
       (setq hlevels mast-elisp-hlevels)))

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





Sent with Proton Mail secure email.



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

end of thread, other threads:[~2024-08-08  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 20:23 Change the regexp for outline-minor-mode Heime
2024-08-08  7:17 ` 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).