all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Changing foreground colours for outline-minor-mode
@ 2023-06-19 12:20 uzibalqa
  2023-06-19 15:53 ` Yuri Khan
  0 siblings, 1 reply; 5+ messages in thread
From: uzibalqa @ 2023-06-19 12:20 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor


Having changed outline-regexp to accept ";;; H1" ";;; H2", ... as outline headers,
I also want to change the foreground colours at the different heading levels.

(defvar hglevels
  '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
     (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) ))

(setq outline-heading-alist hglevels)

But I do not see the foreground colours taking effect.

Is the definition for hglevels wrong for setting outline-heading-alist ?

Would I need to enable outline-minor-mode before or after setting outline-heading-alist ?





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

* Re: Changing foreground colours for outline-minor-mode
  2023-06-19 12:20 Changing foreground colours for outline-minor-mode uzibalqa
@ 2023-06-19 15:53 ` Yuri Khan
  2023-06-19 16:06   ` uzibalqa
  0 siblings, 1 reply; 5+ messages in thread
From: Yuri Khan @ 2023-06-19 15:53 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

On Mon, 19 Jun 2023 at 19:21, uzibalqa <uzibalqa@proton.me> wrote:

> Having changed outline-regexp to accept ";;; H1" ";;; H2", ... as outline headers,
> I also want to change the foreground colours at the different heading levels.
>
> (defvar hglevels
>   '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
>      (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) ))
>
> (setq outline-heading-alist hglevels)
>
> But I do not see the foreground colours taking effect.

Have you customized the outline-minor-mode-highlight variable? Have
you tried each of its possible values? After changing the variable,
did you re-activate outline-minor-mode?

(Also, what you’re trying to do is misguided, and if you’re doing that
as a library as you’ve hinted in other messages, then you’re harming
your users. For one thing, your modified patterns are suitable only
for languages that treat a semicolon as a comment starter, such as
Lisp; if applied indiscriminately to other languages, users will not
be able to add headings without breaking their language’s syntax.)

(Also, when you think of a possible improvement to a question that
you’ve asked earlier but that hadn’t received a reply, you should post
your improvement as a reply to that past question, not as a new
separate thread. That helps people review all the things you’ve said
in previous versions of the question.)



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

* Re: Changing foreground colours for outline-minor-mode
  2023-06-19 15:53 ` Yuri Khan
@ 2023-06-19 16:06   ` uzibalqa
  2023-06-19 16:25     ` Yuri Khan
  0 siblings, 1 reply; 5+ messages in thread
From: uzibalqa @ 2023-06-19 16:06 UTC (permalink / raw)
  To: Yuri Khan; +Cc: uzibalqa via Users list for the GNU Emacs text editor


------- Original Message -------
On Tuesday, June 20th, 2023 at 3:53 AM, Yuri Khan <yuri.v.khan@gmail.com> wrote:


> On Mon, 19 Jun 2023 at 19:21, uzibalqa uzibalqa@proton.me wrote:
> 
> > Having changed outline-regexp to accept ";;; H1" ";;; H2", ... as outline headers,
> > I also want to change the foreground colours at the different heading levels.
> > 
> > (defvar hglevels
> > '( (";;; H1" . 1) (";;; H2" . 2) (";;; H3" . 3) (";;; H4" . 4)
> > (";;; H5" . 5) (";;; H6" . 6) (";;; H7" . 7) (";;; H8" . 8) ))
> > 
> > (setq outline-heading-alist hglevels)
> > 
> > But I do not see the foreground colours taking effect.
> 
> 
> Have you customized the outline-minor-mode-highlight variable? Have
> you tried each of its possible values? After changing the variable,
> did you re-activate outline-minor-mode?

Yes, I have set it to 'override.  How does one re-activate outline-minor-mode,
using (outline-minor-mode 1) ?
 
> (Also, what you’re trying to do is misguided, and if you’re doing that
> as a library as you’ve hinted in other messages, then you’re harming
> your users. For one thing, your modified patterns are suitable only
> for languages that treat a semicolon as a comment starter, such as
> Lisp; if applied indiscriminately to other languages, users will not
> be able to add headings without breaking their language’s syntax.)

I have started this as a test first on elisp files.
 
> (Also, when you think of a possible improvement to a question that
> you’ve asked earlier but that hadn’t received a reply, you should post
> your improvement as a reply to that past question, not as a new
> separate thread. That helps people review all the things you’ve said
> in previous versions of the question.)



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

* Re: Changing foreground colours for outline-minor-mode
  2023-06-19 16:06   ` uzibalqa
@ 2023-06-19 16:25     ` Yuri Khan
  2023-06-19 16:55       ` uzibalqa
  0 siblings, 1 reply; 5+ messages in thread
From: Yuri Khan @ 2023-06-19 16:25 UTC (permalink / raw)
  To: uzibalqa; +Cc: uzibalqa via Users list for the GNU Emacs text editor

On Mon, 19 Jun 2023 at 23:06, uzibalqa <uzibalqa@proton.me> wrote:

> > Have you customized the outline-minor-mode-highlight variable? Have
> > you tried each of its possible values? After changing the variable,
> > did you re-activate outline-minor-mode?
>
> Yes, I have set it to 'override.  How does one re-activate outline-minor-mode,
> using (outline-minor-mode 1) ?

For me, the default outline headings in lisp (those starting with
three or more semicola or a ‘(def’) show up highlighted after I set
outline-minor-mode-highlight to 'override and do (outline-minor-mode
1). I have not tested with a custom outline-heading-alist.



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

* Re: Changing foreground colours for outline-minor-mode
  2023-06-19 16:25     ` Yuri Khan
@ 2023-06-19 16:55       ` uzibalqa
  0 siblings, 0 replies; 5+ messages in thread
From: uzibalqa @ 2023-06-19 16:55 UTC (permalink / raw)
  To: Yuri Khan; +Cc: uzibalqa via Users list for the GNU Emacs text editor


------- Original Message -------
On Tuesday, June 20th, 2023 at 4:25 AM, Yuri Khan <yuri.v.khan@gmail.com> wrote:


> On Mon, 19 Jun 2023 at 23:06, uzibalqa uzibalqa@proton.me wrote:
> 
> > > Have you customized the outline-minor-mode-highlight variable? Have
> > > you tried each of its possible values? After changing the variable,
> > > did you re-activate outline-minor-mode?
> > 
> > Yes, I have set it to 'override. How does one re-activate outline-minor-mode,
> > using (outline-minor-mode 1) ?
> 
> 
> For me, the default outline headings in lisp (those starting with
> three or more semicola or a ‘(def’) show up highlighted after I set
> outline-minor-mode-highlight to 'override and do (outline-minor-mode
> 1). I have not tested with a custom outline-heading-alist.

I confirm that the default outline headings in lisp show up highlighted.
But not with a custom outline-heading-alist.




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

end of thread, other threads:[~2023-06-19 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-19 12:20 Changing foreground colours for outline-minor-mode uzibalqa
2023-06-19 15:53 ` Yuri Khan
2023-06-19 16:06   ` uzibalqa
2023-06-19 16:25     ` Yuri Khan
2023-06-19 16:55       ` uzibalqa

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.