From: Daniele Nicolodi <daniele@grinta.net>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
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 [thread overview]
Message-ID: <9a88bc11-2325-b4cb-5253-4580134234d3@grinta.net> (raw)
In-Reply-To: <87zgzi69zr.fsf@mail.linkov.net>
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.
Cheers,
Dan
next prev parent reply other threads:[~2021-03-04 19:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210303191236.24697.93201@vcs0.savannah.gnu.org>
[not found] ` <20210303191237.2B2D720E1B@vcs0.savannah.gnu.org>
2021-03-03 20:13 ` master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings Stefan Monnier
2021-03-03 20:38 ` Juri Linkov
2021-03-03 21:44 ` Stefan Monnier
2021-03-04 8:58 ` Juri Linkov
2021-03-04 13:20 ` Stefan Monnier
2021-03-04 18:12 ` Juri Linkov
2021-03-04 19:07 ` Stefan Monnier
2021-03-04 17:03 ` Daniele Nicolodi
2021-03-04 18:06 ` Stefan Monnier
2021-03-04 20:38 ` Juri Linkov
2021-03-04 18:17 ` Juri Linkov
2021-03-04 19:37 ` Daniele Nicolodi [this message]
2021-03-04 20:35 ` Juri Linkov
2021-03-04 20:44 ` Daniele Nicolodi
2021-03-04 20:53 ` Juri Linkov
2021-03-04 22:57 ` Stefan Monnier
2021-03-04 0:31 ` Gabriel do Nascimento Ribeiro
2021-03-04 9:05 ` Juri Linkov
2021-03-07 18:54 ` Juri Linkov
2021-03-07 18:53 ` Juri Linkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a88bc11-2325-b4cb-5253-4580134234d3@grinta.net \
--to=daniele@grinta.net \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).