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

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

Re: Changing highlight colours of headings when using outline-minor-mode


From: uzibalqa
Subject: Re: Changing highlight colours of headings when using outline-minor-mode
Date: Fri, 16 Jun 2023 16:09:38 +0000

> > ------- Original Message -------
> > On Thursday, June 15th, 2023 at 5:06 AM, Eli Zaretskii eliz@gnu.org wrote:
> > 
> > > > Date: Wed, 14 Jun 2023 16:13:26 +0000
> > > > From: Heime heimeborgia@protonmail.com
> > > > 
> > > > I want to change highlight foreground colours of headings to be more 
> > > > vibrant when using outline-minor-mode
> > > > How can the colour levels be changed ?
> > > 
> > > By customizing the relevant faces.
> > 
> > Right, but I am looking to customise them via the construction of an elisp 
> > function.
> > But I do not know how the specific function would like.
 
I have added BEG and END to outline-map-region and finished with 
(font-lock-flush)
but the changes are not taking effect.
 

(defun tematika-heading-tyface ()
  "Set annunciator lights for headings in `outline-minor-mode'."
  (interactive)

  (let ( (beg (point-min))
         (end (point-max)) )

    (outline-map-region

     (lambda ()
       (let* ( ($hglevl (funcall outline-level))
               ($tyface (cond
                         ((= $hglevl 1) '(:foreground "red"))
                         ((= $hglevl 2) '(:foreground "blue"))
                         ((= $hglevl 3) '(:foreground "green"))
                         (t '(:foreground "white")))) )
         ;;--------------------------
         (when (looking-at outline-regexp)
           (put-text-property (point-at-bol) (point-at-eol)
                              '$tyface $tyface))))

     beg end)

    (font-lock-flush)))





reply via email to

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