unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Allowing spaces in the regexp for outlines
@ 2024-03-20 19:24 Heime
  2024-03-20 19:45 ` Emanuel Berg
  2024-03-21  4:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 13+ messages in thread
From: Heime @ 2024-03-20 19:24 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

Have made a regexp for outlines to use ';;;' followed by 'H' and a number.

I would like to allow any number of spaces between the ';;;' and the letter 'H'.
How can I change the regexp to allow such a capability ?

(defvar el-hglevels
  '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4) )
  "Outline levels for elisp major mode.")

(defun outlhg-regexp ()

  (cond

    ((memq major-mode '(emacs-lisp-mode lisp-interaction-mode))
       (let ( (hglevels el-hglevels) )
         (setq outline-regexp
               (concat (regexp-opt (mapcar 'car hglevels)) "\\>"))
         (setq outline-heading-alist hglevels)
         (setq-local outline-level 'outline-level))) ))





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

end of thread, other threads:[~2024-03-27 19:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-20 19:24 Allowing spaces in the regexp for outlines Heime
2024-03-20 19:45 ` Emanuel Berg
2024-03-21  4:44   ` Heime
2024-03-21  4:59     ` Emanuel Berg
2024-03-21  5:08   ` Heime
2024-03-21  6:40     ` Heime
2024-03-21 19:52       ` Emanuel Berg
2024-03-21  4:32 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-03-21  4:49   ` Emanuel Berg
2024-03-22 12:56     ` Arash Esbati
2024-03-22 15:39       ` Heime
2024-03-27 19:12   ` Christopher Dimech
2024-03-27 19:32     ` 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).