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: Heime
Subject: Re: Changing highlight colours of headings when using outline-minor-mode
Date: Wed, 14 Jun 2023 23:38:49 +0000

------- Original Message -------
On Thursday, June 15th, 2023 at 11:20 AM, Heime <heimeborgia@protonmail.com> 
wrote:


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

Have initiated with this attempt

(defun heading-tyface ()
  "Set foreground colour for headings in `outline-minor-mode'."
  (interactive)

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








reply via email to

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