emacs-devel
[Top][All Lists]
Advanced

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

Re: vertical fido-mode (new branch)


From: Ergus
Subject: Re: vertical fido-mode (new branch)
Date: Wed, 26 Aug 2020 01:11:59 +0200

On Tue, Aug 25, 2020 at 09:55:41PM +0300, Juri Linkov wrote:

If this patch is too much code for adding in simple and minibuffer, I
would try to make a separate file with a mode. WDYT?

Maybe initially this could be a separate package to allow easier
experimentation with it.  Later when it works well, this could be added
to core commands.


To do so I need two changes in the emacs core that can't be implemented
from outside.

1) The hook

-    (if win (with-selected-window win (bury-buffer)))))
+    (when win
+      (with-selected-window win (bury-buffer))
+      (run-hooks 'minibuffer-hide-completions-hook))))

Maybe there is a hook like bury-buffer-hook or something similar; but I
am not aware of it.  If so, then I could add my function in that local
hook in *Completions*. It is tricky, but it could work if we don't want
to add another hook. (But I would prefer having the hook)

2) The extra condition in completion--in-region-1

-            ;; If end is in view, scroll up to the beginning.
-            (set-window-start window (point-min) nil)
+            (if (and minibuffer-tab-go-completion
+                     (pos-visible-in-window-p (point-min) window))
+                (minibuffer-next-completion 1)
+                ;; If all completions are visible use tab completion
+              ;; If end is in view, scroll up to the beginning.
+              (set-window-start window (point-min) nil))

I think that we can modify this one to be more general using a funcall
or so and make my function to return t on success or nil if we should go
for the `else` part.

I can add these two small changes if you think they are fine.  If so,
then the package can be added as an extra file and I could avoid messing
up even more the simple.el and minibuffer.el. Even enabling the mode by
default (if we decide so) it could be in a different file for simplicity.

BTW I am implementing also a vertical icomplete.  I will upload a
feature branch in a while. Could you try that?

Best,
Ergus


reply via email to

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