unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
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: Wed, 03 Mar 2021 16:44:07 -0500	[thread overview]
Message-ID: <jwv5z28orgx.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87zgzkug5d.fsf@mail.linkov.net> (Juri Linkov's message of "Wed,  03 Mar 2021 22:38:22 +0200")

>> This is very welcome functionality (and the highlighting as well).
>> I wonder if we really need the new minor modes, tho, instead of just
>> sticking to the new `outline-minor-mode-cycle` and
>> `outline-minor-mode-highlight` variables (which we could make into
>> `defcustom`s).
>
> 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.
>
> I'm fine with removing these modes after analyzing more use cases.

BTW, I'm writing under the assumption that we'd want to eventually have
both of those vars default to t.

>> IOW, I wonder if there are many use cases where users will want to have
>> some `outline-minor-mode` buffers with cycling and others without.
> Here's is a list of use cases where I tried to use outline-minor-mode
> with cycling, and somewhere also with highlighting.

Any mode where you've found bad interactions?

> 3. (add-hook 'emacs-lisp-mode-hook 'outline-cycle-minor-mode)
>    without outline highlighting to not overwrite major mode faces

In which way did the highlighting get in the way?

> But none of them require to disable cycling.  I don't know where
> outline-minor-mode without cycling would be needed.  Maybe in
> external packages that implement own cycling in outline-minor-mode
> like in https://debbugs.gnu.org/41198#99

FWIW, I think the only really good way to solve this problem is to
replace `indent-for-tab-command` with a new command (call it
`tab-dwim`?)  which can be more finely configured by major and minor
modes.  E.g.  by making it call `tab-dwim-function` on which modes can
`add-function` at will (and at various depths so they can control
whether it should take precedence or not over the "TAB causes
indentation" or "TAB causes completion", ...).

The mechanism of priorities of keymaps coupled with "fallthrough"
(either via the "menu-item + filter" trick or via some explicitly
looking up the keymaps and calling the next command) isn't fine-grained
enough to deal with the amount of overloading that people want to use on
that poor TAB key.


        Stefan




  reply	other threads:[~2021-03-03 21:44 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 [this message]
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
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=jwv5z28orgx.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --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).