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 18:37:39 +0000

------- Original Message -------
On Saturday, June 17th, 2023 at 6:01 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Fri, 16 Jun 2023 17:03:43 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: help-gnu-emacs@gnu.org
> > 
> > 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.
> > 
> > Have spent quite some time writing a function to do this but I am finding 
> > it very hard
> > to get something that actually works.
> 
> 
> I don't understand what could be hard here. Just use
> set-face-foreground and set-face-background.

I had written this, but which has got resulted in any effect upon heading 
colours.

(defun heading-tyface ()
  "Set colours 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]