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

* Change the regexp for outline-minor-mode
  2024-08-07 20:23 Change the regexp for outline-minor-mode Heime
@ 2024-08-08  7:17 ` Heime
  0 siblings, 0 replies; 2+ messages in thread
From: Heime @ 2024-08-08  7:17 UTC (permalink / raw)
  To: Heime; +Cc: Heime via Users list for the GNU Emacs text editor

On Thursday, August 8th, 2024 at 8:23 AM, Heime <heimeborgia@protonmail.com> wrote:

> 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)) ))
 
I have been able to change the regexp patterns for headings provided by
outline-minor-mode.

But cannot change the their foreground colours.  I have this function,
but cannot get the colours to activate.

(defun elfacets ()

  (let* ( (nuit '("#4fafff" "#4fe42f" "#f0dd60" "#fba849"
                  "#ff62d4" "#9f80ff" "#fe6060" "#FFFFFF"))

          (sole '("#1f1fce" "#005f88" "#006800" "#b60000"
                  "#605b00" "#a8007f" "#904200" "#7f10d0"))
          (pigments
            (if (eq (frame-parameter nil 'background-mode) 'dark)
                nuit
              sole)) )

    ;; Loop successive integers from 0 (inclusive), to 8 (exclusive)
    (dotimes (ilv 8)
      (let ( (veidas (intern (format "outline-%d" (1+ ilv))))
             (kleur  (nth ilv pigments)) )
        (set-face-foreground veidas kleur)))))





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