[Top][All Lists]

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

Re: master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like

From: Daniele Nicolodi
Subject: Re: master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings
Date: Thu, 4 Mar 2021 20:37:51 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.0

On 04/03/2021 19:17, Juri Linkov wrote:
>>>> One example (mostly for demonstration purposes) currently is
>>>> in etc/compilation.txt. whose Local Variables contains just:
>>>>   ;;; eval: (outline-cycle-highlight-minor-mode)
>>>> Initially I implemented this only with variables and without modes
>>>> like you suggested:
>>>>   ;;; outline-minor-mode-cycle: t
>>>>   ;;; outline-minor-mode-highlight: t
>>>>   ;;; eval: (outline-minor-mode 1)
>>>> But then thought that maybe with a mode would be more concise and 
>>>> convenient.
>> Can't you add setting the variables to the minor-mode hooks?
> It's easier to set them using minor-mode like
>   (add-hook 'emacs-lisp-mode-hook 'outline-cycle-highlight-minor-mode)
> than using lambda
>   (add-hook 'emacs-lisp-mode-hook
>     (lambda ()
>       (setq-local outline-minor-mode-cycle t)
>       (setq-local outline-minor-mode-highlight t)
>       (outline-minor-mode 1)))

That would seem to imply that there should be a minor-mode for every
buffer-local safe variable in Emacs... :-)

>> I haven't tried your code, but there are occasions in which
>> outline-minor-mode is used to section the buffer on syntactic elements
>> that are already fontified (on function declarations, for example). What
>> does happen then when outline-minor-mode-highlight is t? I think these
>> would be cases in which outline-minor-mode-highlight nil would be better.
> outline-minor-mode-highlight already works surprisingly well,
> and doesn't override faces added by major mode.

Doesn't that mean that it does not apply the faces most of the time? In
almost all my use of outline-mirror mode, the headings are comments in
the current major mode, and almost always are fontified as such by the
major mode.

I should probably try your code. Do you know if it works in Emacs 27?
That would spare me from having to compile Emacs.


reply via email to

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