unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: master 6458e16: New mode outline-cycle-minor-mode with Orgmode-like TAB cycling on headings
Date: Sun, 07 Mar 2021 20:54:43 +0200	[thread overview]
Message-ID: <874khmhk0c.fsf@mail.linkov.net> (raw)
In-Reply-To: <87a6rj44k6.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  04 Mar 2021 11:05:29 +0200")

>> This is a great feature, thank you!  I could replace all my custom elisp
>> code that handles outline cycle/highlight on my init.el with the new
>> minor-modes, and everything has been working fine so far.
>>
>> I think that having only the variables is fine, I can't see any special
>> need for the minor-modes.
>>
>>> 4. (advice-add 'xref--insert-xrefs :after
>>>             (lambda (&rest _args)
>>>               (setq-local outline-regexp "/")
>>>               (outline-cycle-minor-mode +1)))
>>>    using file names as headings where S-TAB could provide
>>>    an overview of all found files
>>
>> The use of outline-minor-mode + cycle on xref buffers is one of my main
>> use cases. However, having to setup the outline-regexp and to add a
>> defadvice seems a dirty hack.  Should Emacs provide better defaults for
>> xref and other modes (like Gnus) for an easier integration with
>> outline-minor-mode ?
>
> Gnus has own outline-like commands like 'T H' that hides all threads.
> But in xref it should be easy to set the outline-regexp by default,
> and to add a hook to call when the xref output buffer is ready.

Now this should be added in bug#46992.

>> As another suggestion, would be nice to add more keybidings, for
>> example, to navigate between headers.
>
> Maybe bind more org-like bindings in outline-mode-cycle-map,
> e.g. ‘C-c C-n’ like ‘org-next-visible-heading’
> and ‘C-c C-p’ like ‘org-previous-visible-heading’.

Actually it's easy to customize such keys, e.g.:

(let ((map outline-mode-cycle-map)
      (cmds '(("C-c C-n"  outline-next-visible-heading)
              ("C-c C-p"  outline-previous-visible-heading))))
  (dolist (command cmds)
    (define-key map (kbd (nth 0 command))
      `(menu-item
        "" ,(nth 1 command)
        ;; Only takes effect if point is on a heading.
        :filter ,(lambda (cmd)
                   (when (outline-on-heading-p) cmd))))))



  reply	other threads:[~2021-03-07 18:54 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
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 [this message]
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=874khmhk0c.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=emacs-devel@gnu.org \
    --cc=gabriel376@hotmail.com \
    /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).