emacs-devel
[Top][All Lists]
Advanced

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

Re: feature/icomplete-vertical


From: Ergus
Subject: Re: feature/icomplete-vertical
Date: Mon, 5 Oct 2020 06:48:23 +0200

On Mon, Oct 05, 2020 at 12:47:39AM +0100, Jo�o T�vora wrote:

Hi Joao:

Please look at the previous messages in this same thread to see the
problems with your approach.

So far there is:

1) The problem when using different font in minibuffer reported by Jixiuf 2) the long line issue from Gregory (but also mentioned before)
3) the ellipsis issue mentioned by Eli
4) The prompt issue (which seems is not going to be solved as it is more
a design choice or a feature than a real issue)
5) Respect the user customs max-mini-window-height and
resize-mini-windows so we shouldn't call enlarge-window and as an
core package we must not conflict with such customs.
6) The removal of {} in vertical mode because in that case they are
redundant.
7) The compatibility with packages like maple-minibuffer reported by
Dimitry.
8) The case when using multiline separator.
9) Move the first candidate to a newline instead of keeping it inline.

The patch I propose is not complex at all considering all the above
conditions. The only complexity comes from the height calculation in
pixels which is something that will need to be done in any case either
for 1, 2, 3 or 4.

Hi Ergus,

Thanks, I had a look at your patch.  I'm personally not too fond of that
kind of
complexity coming into lisp/icomplete.el especially when then are simpler
formulae for achieving a funcional vertical icomplete system.  My solution
is even
simpler than Gregory's for example (and based on his):

(setq icomplete-prospects-height 6)
(setq icomplete-separator "\n")

(defun icomplete-vertical-adjust-minibuffer-height (completions)
 (let* ((comp completions)
         (complen (length (split-string comp "\n"))))
    (if (> complen 1) (enlarge-window (- icomplete-prospects-height (1-
(window-height)))))
    comp))
(advice-add 'icomplete-completions :filter-return
#'icomplete-vertical-adjust-minibuffer-height)

So, in my view, all that's needed is to fix the window height problem
(addressed separately
in a discussion which I haven't been following), and then add sufficient
hookage so that
a _separate_ icomplete-vertical.el package with all the advanced features
you are working
on can be developed.

By the way, do you mind listing here exactly which ones those are in
relation to the
system attained  by the code above?

Look at the other branch I mentioned
(completions-highlight-modifications).

I want to bring such zsh-like completion style to icomplete (when have
some time). It must be simpler than in the *Completions* because it
won't need to switch window or add overlays.

Ergus

Jo�o


On Thu, Oct 1, 2020 at 5:48 PM Ergus <spacibba@aol.com> wrote:

Hi:

I made some corrections to simplify the icomplete-vertical feature
branch and pushed (forced) some days ago. (sorry for that, I should have
used a scratch branch instead)

Now the icomplete-format variable is removed and the user only needs to
add at least one '\n' to the separator. I also use
window-text-pixel-size to correct the issue with long lines but still
perform the height calculations in pixels to properly show the ellipsis
as Eli recommended.

I keep the funcall approach because IMO it is cleaner, and reduces
unneeded and redundant things. (And because it is compatible with
something else I am working in)

If some of the previous testers could give it a second try. When it is
fine I will add some documentation and merge in master.

BTW: If someone could give a look to the completions-highlight feature
branch too and make recommendations, report issues?

Best,
Ergus



--
Jo�o T�vora


reply via email to

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