From: Ergus <spacibba@aol.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juri Linkov <juri@linkov.net>,
"emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: vertical fido-mode (new branch)
Date: Wed, 26 Aug 2020 06:34:49 +0200 [thread overview]
Message-ID: <20200826043419.5kl4h5qxg7idbexd@Ergus> (raw)
In-Reply-To: <jwvwo1mi9l1.fsf-monnier+emacs@gnu.org>
On Tue, Aug 25, 2020 at 07:42:23PM -0400, Stefan Monnier wrote:
>
>When introducing hooks, often it's a good idea to try and think of
>*replacing* rather than *adding*. E.g. Maybe instead of running
>`minibuffer-hide-completions-hook` after hiding the buffer, you want to
>have a `minibuffer-hide-completions-function` which defaults to `bury-buffer`.
>
>I'm not sure if it'd be better in this specific instance, but...
>
Hi Stefan:
Yes I also thought that, but as there is the `completion-setup-hook`
called when the completions are shown I just thought in a `symmetric`
hook to call when closing.
In my opinion the hook here was just simpler. Also because the
bury-buffer runs inside a with-selected-window and the action I need are
in the minibuffer.
>
>... I think here it might be a good idea: introduce
>a `minibuffer-tab-through-completions-function` which by default would
>do the scrolling, i.e.:
>
> (let ((window minibuffer-scroll-window))
> (with-current-buffer (window-buffer window)
> (if (pos-visible-in-window-p (point-max) window)
> ;; If end is in view, scroll up to the beginning.
> (set-window-start window (point-min) nil)
> ;; Else scroll down one screen.
> (with-selected-window window
> (scroll-up)))
> nil)))
>
>and which you could override to your liking.
>
This is exactly what I did ;p thanks for the name cause mine was worst.
>
>This makes me think maybe you were thinking exactly the same and we're
>just in violent agreement.
>
>
> Stefan
>
I have 2 questions:
1) Why the function needs to return nil if the return value of
completion--in-region-1 is not used anywhere so far?
2) What's the "canonical method" to add a keymap to the minibuffer (and
*Completions*) when enabling the mode but restoring it cleanly at the
end?
Is it possible to do something like push/pop a keymap to another?
I see we have inheritance for keymaps but maybe there is a simpler
method?
How can I restrict the mode-keymap to the minibuffer for example?
Thanks in advance,
Ergus
next prev parent reply other threads:[~2020-08-26 4:34 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1704199899.1577092.1591806438580.ref@mail.yahoo.com>
2020-06-10 16:27 ` vertical fido-mode Ergus
2020-06-10 16:53 ` Stefan Monnier
2020-06-10 19:01 ` Dmitry Gutov
2020-06-10 19:45 ` Basil L. Contovounesios
2020-06-10 21:54 ` Ergus
2020-06-10 22:00 ` Dmitry Gutov
2020-06-10 23:08 ` Juri Linkov
2020-06-10 23:23 ` Dmitry Gutov
2020-06-11 13:22 ` Ergus
2020-06-11 13:28 ` Noam Postavsky
2020-06-11 13:40 ` Ergus
2020-06-11 15:49 ` Protesilaos Stavrou
2020-06-11 15:52 ` Omar Antolín Camarena
2020-06-11 17:37 ` Basil L. Contovounesios
2020-06-17 21:50 ` Juri Linkov
2020-06-17 21:57 ` Dmitry Gutov
2020-06-17 22:17 ` João Távora
2020-06-17 22:31 ` Drew Adams
2020-06-17 22:40 ` João Távora
2020-06-17 22:56 ` Drew Adams
2020-06-17 22:52 ` Juri Linkov
2020-06-17 23:20 ` Drew Adams
2020-06-17 22:22 ` Juri Linkov
2020-06-17 22:52 ` Dmitry Gutov
2020-06-17 22:57 ` Dmitry Gutov
2020-06-17 22:58 ` Drew Adams
2020-06-17 23:15 ` Drew Adams
2020-06-18 21:54 ` Juri Linkov
2020-06-18 22:41 ` João Távora
2020-06-18 22:51 ` Juri Linkov
2020-06-19 8:53 ` João Távora
2020-06-18 8:22 ` Kévin Le Gouguec
2020-06-18 10:19 ` Ergus
2020-06-11 13:10 ` Ergus
2020-08-19 12:17 ` Ergus via Emacs development discussions.
2020-08-20 0:35 ` Juri Linkov
2020-08-20 10:37 ` Ergus
2020-08-20 23:15 ` Juri Linkov
2020-08-21 0:05 ` Ergus
2020-08-23 18:45 ` Juri Linkov
2020-08-24 19:06 ` vertical fido-mode (new branch) Ergus via Emacs development discussions.
2020-08-25 18:55 ` Juri Linkov
2020-08-25 23:11 ` Ergus
2020-08-25 23:42 ` Stefan Monnier
2020-08-26 4:34 ` Ergus [this message]
2020-08-26 13:30 ` Stefan Monnier
2020-08-28 10:09 ` Ergus
2020-06-10 19:45 ` vertical fido-mode Basil L. Contovounesios
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=20200826043419.5kl4h5qxg7idbexd@Ergus \
--to=spacibba@aol.com \
--cc=emacs-devel@gnu.org \
--cc=juri@linkov.net \
--cc=monnier@iro.umontreal.ca \
/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).