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

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

Ways to change the outline search patterns


From: Heime
Subject: Ways to change the outline search patterns
Date: Mon, 25 Mar 2024 12:23:14 +0000

Calling "re-search-forward", I am able to identify lines starting  with ;;; 
followed by
an number of spaces.

(re-search-forward ";;; *H1"))

My task is to use this for outline headings at level 1.

But the following has not worked for me

(defvar el-hglevels '( (";;; H1" . 1) (";;; H2" . 2)))
;;; H2 (defun tematika-outlhg-regexp ()

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

What might I be doing wrong ?  Is there an alternative way to change the
outline search patterns ?







reply via email to

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