all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing highlight colours of headings when using outline-minor-mode
@ 2023-06-14 16:13 Heime
  2023-06-14 17:06 ` Eli Zaretskii
  0 siblings, 1 reply; 17+ messages in thread
From: Heime @ 2023-06-14 16:13 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor


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 ?





^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-14 16:13 Changing highlight colours of headings when using outline-minor-mode Heime
@ 2023-06-14 17:06 ` Eli Zaretskii
  2023-06-14 23:20   ` Heime
  2023-06-16 17:03   ` uzibalqa
  0 siblings, 2 replies; 17+ messages in thread
From: Eli Zaretskii @ 2023-06-14 17:06 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-14 17:06 ` Eli Zaretskii
@ 2023-06-14 23:20   ` Heime
  2023-06-14 23:38     ` Heime
  2023-06-16 17:03   ` uzibalqa
  1 sibling, 1 reply; 17+ messages in thread
From: Heime @ 2023-06-14 23:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-14 23:20   ` Heime
@ 2023-06-14 23:38     ` Heime
  2023-06-16 16:09       ` uzibalqa
  0 siblings, 1 reply; 17+ messages in thread
From: Heime @ 2023-06-14 23:38 UTC (permalink / raw)
  To: Heime; +Cc: Eli Zaretskii, help-gnu-emacs


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








^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-14 23:38     ` Heime
@ 2023-06-16 16:09       ` uzibalqa
  0 siblings, 0 replies; 17+ messages in thread
From: uzibalqa @ 2023-06-16 16:09 UTC (permalink / raw)
  To: Heime; +Cc: Eli Zaretskii, help-gnu-emacs


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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-14 17:06 ` Eli Zaretskii
  2023-06-14 23:20   ` Heime
@ 2023-06-16 17:03   ` uzibalqa
  2023-06-16 18:01     ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: uzibalqa @ 2023-06-16 17:03 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


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


Have spent quite some time writing a function to do this but I am finding it very hard 
to get something that actually works.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 17:03   ` uzibalqa
@ 2023-06-16 18:01     ` Eli Zaretskii
  2023-06-16 18:37       ` uzibalqa
  0 siblings, 1 reply; 17+ messages in thread
From: Eli Zaretskii @ 2023-06-16 18:01 UTC (permalink / raw)
  To: help-gnu-emacs

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



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 18:01     ` Eli Zaretskii
@ 2023-06-16 18:37       ` uzibalqa
  2023-06-16 19:12         ` Bruno Barbier
  2023-06-17  5:41         ` Eli Zaretskii
  0 siblings, 2 replies; 17+ messages in thread
From: uzibalqa @ 2023-06-16 18:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs


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







^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 18:37       ` uzibalqa
@ 2023-06-16 19:12         ` Bruno Barbier
  2023-06-16 19:34           ` uzibalqa
  2023-06-17  5:41         ` Eli Zaretskii
  1 sibling, 1 reply; 17+ messages in thread
From: Bruno Barbier @ 2023-06-16 19:12 UTC (permalink / raw)
  To: uzibalqa, Eli Zaretskii; +Cc: help-gnu-emacs

uzibalqa <uzibalqa@proton.me> writes:

Shouldn't this:
>            (put-text-property (point-at-bol) (point-at-eol)
>                               '$tyface $tyface))))


be:
>            (put-text-property (point-at-bol) (point-at-eol)
>                               'font-lock-face $tyface))))

?



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 19:12         ` Bruno Barbier
@ 2023-06-16 19:34           ` uzibalqa
  2023-06-16 19:55             ` Bruno Barbier
  0 siblings, 1 reply; 17+ messages in thread
From: uzibalqa @ 2023-06-16 19:34 UTC (permalink / raw)
  To: Bruno Barbier; +Cc: Eli Zaretskii, help-gnu-emacs

------- Original Message -------
On Saturday, June 17th, 2023 at 7:12 AM, Bruno Barbier <brubar.cs@gmail.com> wrote:


> uzibalqa uzibalqa@proton.me writes:
> 
> 
> Shouldn't this:
> 
> > (put-text-property (point-at-bol) (point-at-eol)
> > '$tyface $tyface))))
> 
> be:
> 
> > (put-text-property (point-at-bol) (point-at-eol)
> > 'font-lock-face $tyface))))
> 
> ?

Most likely, but I also have to incorporate all this with "outline-minor-mode-highlight".

What would you suggest ?



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 19:34           ` uzibalqa
@ 2023-06-16 19:55             ` Bruno Barbier
  2023-06-16 20:05               ` uzibalqa
  2023-06-16 20:15               ` uzibalqa
  0 siblings, 2 replies; 17+ messages in thread
From: Bruno Barbier @ 2023-06-16 19:55 UTC (permalink / raw)
  To: uzibalqa; +Cc: Eli Zaretskii, help-gnu-emacs

uzibalqa <uzibalqa@proton.me> writes:

> Most likely, but I also have to incorporate all this with "outline-minor-mode-highlight".
>
> What would you suggest ?

I just saw and pointed what I think was "most likely" a mistake. I don't
understand enough what you're real problem is to have anything to
suggest. Sorry.

Best,

Bruno





^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 19:55             ` Bruno Barbier
@ 2023-06-16 20:05               ` uzibalqa
  2023-06-16 20:15               ` uzibalqa
  1 sibling, 0 replies; 17+ messages in thread
From: uzibalqa @ 2023-06-16 20:05 UTC (permalink / raw)
  To: Bruno Barbier; +Cc: Eli Zaretskii, help-gnu-emacs

------- Original Message -------
On Saturday, June 17th, 2023 at 7:55 AM, Bruno Barbier <brubar.cs@gmail.com> wrote:


> uzibalqa uzibalqa@proton.me writes:
> 
> > Most likely, but I also have to incorporate all this with "outline-minor-mode-highlight".
> > 
> > What would you suggest ?
> 
> 
> I just saw and pointed what I think was "most likely" a mistake. I don't
> understand enough what you're real problem is to have anything to
> suggest. Sorry.
> 
> Best,
> 
> Bruno


It was a mistake as you say.  But just calling the function from my .emacs does
not enable the colouring of headlines with the colour scheme specified.

Also, I am not quite sure whether (font-lock-flush) is needed at the end.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 19:55             ` Bruno Barbier
  2023-06-16 20:05               ` uzibalqa
@ 2023-06-16 20:15               ` uzibalqa
  2023-06-16 21:57                 ` [External] : " Drew Adams
  1 sibling, 1 reply; 17+ messages in thread
From: uzibalqa @ 2023-06-16 20:15 UTC (permalink / raw)
  To: Bruno Barbier; +Cc: Eli Zaretskii, help-gnu-emacs


------- Original Message -------
On Saturday, June 17th, 2023 at 7:55 AM, Bruno Barbier <brubar.cs@gmail.com> wrote:


> uzibalqa uzibalqa@proton.me writes:
> 
> > Most likely, but I also have to incorporate all this with "outline-minor-mode-highlight".
> > 
> > What would you suggest ?
> 
> 
> I just saw and pointed what I think was "most likely" a mistake. I don't
> understand enough what you're real problem is to have anything to
> suggest. Sorry.
> 
> Best,
> Bruno

Ideally I would like that the colours are set permanently whenever I use 
"outline-minor-mode".  Hewovor the function I wrote has to be run on every
buffer.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [External] : Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 20:15               ` uzibalqa
@ 2023-06-16 21:57                 ` Drew Adams
  2023-06-16 22:18                   ` uzibalqa
  0 siblings, 1 reply; 17+ messages in thread
From: Drew Adams @ 2023-06-16 21:57 UTC (permalink / raw)
  To: uzibalqa, Bruno Barbier; +Cc: Eli Zaretskii, help-gnu-emacs@gnu.org

> Ideally I would like that the colours are set permanently whenever I use
> "outline-minor-mode".  Hewovor the function I wrote has to be run on every
> buffer.

I'm no expert on `outline-minor-mode'.

But I sense that maybe you haven't been listening.
Several times people have suggested that you just
_customize_ the relevant faces.

I do `M-x customize-group outline TAB RET'.  I
see 8 faces named `outline-1' through `outline-8'.

I do `C-h f outline-minor-mode', to see if it
mentions something special wrt the minor mode and
faces, as opposed to the major mode, `outline-mode'.
It doesn't.

You can also take a look at the source code, in
`outline.el'.

It seems, from a superficial look, that the faces
used by `outline-minor-mode' are those 8 faces.

Have you tried to customize them?  To do that is
simple: `M-x customize-face'.  Or get to them all
together, with `M-x customize-group outlines'.

Customize _persists_ your settings.  It sounds
like exactly what you're asking for.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [External] : Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 21:57                 ` [External] : " Drew Adams
@ 2023-06-16 22:18                   ` uzibalqa
  2023-06-16 22:39                     ` uzibalqa
  0 siblings, 1 reply; 17+ messages in thread
From: uzibalqa @ 2023-06-16 22:18 UTC (permalink / raw)
  To: Drew Adams; +Cc: Bruno Barbier, Eli Zaretskii, help-gnu-emacs@gnu.org


------- Original Message -------
On Saturday, June 17th, 2023 at 9:57 AM, Drew Adams <drew.adams@oracle.com> wrote:


> > Ideally I would like that the colours are set permanently whenever I use
> > "outline-minor-mode". Hewovor the function I wrote has to be run on every
> > buffer.
> 
> 
> I'm no expert on `outline-minor-mode'. But I sense that maybe you haven't been listening. Several times people have suggested that you just _customize_ the relevant faces. I do` M-x customize-group outline TAB RET'. I
> see 8 faces named `outline-1' through` outline-8'.

Although that is right, my intention is different.  "M-x customize-group outline TAB RE" is not enough
for me.
 
> I do `C-h f outline-minor-mode', to see if it mentions something special wrt the minor mode and faces, as opposed to the major mode,` outline-mode'.
> It doesn't.
> 
> You can also take a look at the source code, in
> `outline.el'. It seems, from a superficial look, that the faces used by` outline-minor-mode' are those 8 faces.

Thanks
 
> Have you tried to customize them? To do that is
> simple: `M-x customize-face'. Or get to them all together, with` M-x customize-group outlines'.
> 
> Customize persists your settings. It sounds
> like exactly what you're asking for.

As I am constructing a library, I need to have a function for doing the settings.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* RE: [External] : Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 22:18                   ` uzibalqa
@ 2023-06-16 22:39                     ` uzibalqa
  0 siblings, 0 replies; 17+ messages in thread
From: uzibalqa @ 2023-06-16 22:39 UTC (permalink / raw)
  To: Drew Adams; +Cc: Bruno Barbier, Eli Zaretskii, help-gnu-emacs@gnu.org


------- Original Message -------
> On Saturday, June 17th, 2023 at 9:57 AM, Drew Adams drew.adams@oracle.com wrote:
> 
> > > Ideally I would like that the colours are set permanently whenever I use
> > > "outline-minor-mode". Hewovor the function I wrote has to be run on every
> > > buffer.
> > 
> > I'm no expert on `outline-minor-mode'. But I sense that maybe you haven't been listening. Several times people have suggested that you just _customize_ the relevant faces. I do` M-x customize-group outline TAB RET'. I
> > see 8 faces named `outline-1' through` outline-8'.
> 
> 
> Although that is right, my intention is different. "M-x customize-group outline TAB RE" is not enough
> for me.
> 
> > I do `C-h f outline-minor-mode', to see if it mentions something special wrt the minor mode and faces, as opposed to the major mode,` outline-mode'.
> > It doesn't.
> > 
> > You can also take a look at the source code, in
> > `outline.el'. It seems, from a superficial look, that the faces used by` outline-minor-mode' are those 8 faces.

I have done as follows, which gets the correct level colours as you described.

(defun outline-tyface ()
  (interactive)
  (set-face-foreground 'outline-1 "red")
  (set-face-foreground 'outline-2 "blue")
  (set-face-foreground 'outline-3 "green"))







^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: Changing highlight colours of headings when using outline-minor-mode
  2023-06-16 18:37       ` uzibalqa
  2023-06-16 19:12         ` Bruno Barbier
@ 2023-06-17  5:41         ` Eli Zaretskii
  1 sibling, 0 replies; 17+ messages in thread
From: Eli Zaretskii @ 2023-06-17  5:41 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 16 Jun 2023 18:37:39 +0000
> From: uzibalqa <uzibalqa@proton.me>
> Cc: help-gnu-emacs@gnu.org
> 
> > > 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.

This doesn't use set-face-background and set-face-foreground.

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

You cannot usefully use put-text-property to change faces in a buffer
in which font-lock-mode is turned on, because font-lock-mode begins by
erasing all the 'face' text properties, then puts its own 'face'
properties.



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2023-06-17  5:41 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-14 16:13 Changing highlight colours of headings when using outline-minor-mode Heime
2023-06-14 17:06 ` Eli Zaretskii
2023-06-14 23:20   ` Heime
2023-06-14 23:38     ` Heime
2023-06-16 16:09       ` uzibalqa
2023-06-16 17:03   ` uzibalqa
2023-06-16 18:01     ` Eli Zaretskii
2023-06-16 18:37       ` uzibalqa
2023-06-16 19:12         ` Bruno Barbier
2023-06-16 19:34           ` uzibalqa
2023-06-16 19:55             ` Bruno Barbier
2023-06-16 20:05               ` uzibalqa
2023-06-16 20:15               ` uzibalqa
2023-06-16 21:57                 ` [External] : " Drew Adams
2023-06-16 22:18                   ` uzibalqa
2023-06-16 22:39                     ` uzibalqa
2023-06-17  5:41         ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.