From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Mon, 5 Oct 2020 00:47:39 +0100 Message-ID: References: <20200912133311.6ujtgczj6wyclufy@Ergus> <20200920130435.heye7bk73pm252km@Ergus> <83sgbczj0i.fsf@gnu.org> <83lfh4zfml.fsf@gnu.org> <838sd4z6lz.fsf@gnu.org> <20201001164804.mqqyxtet4ttweuyv@Ergus> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006e11a305b0e0fea4" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23063"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Gregory Heytings , Eli Zaretskii , Juri Linkov , Yuan Fu , emacs-devel To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 05 01:48:48 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPDkE-0005pz-FT for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Oct 2020 01:48:46 +0200 Original-Received: from localhost ([::1]:43678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPDkD-0007OJ-H1 for ged-emacs-devel@m.gmane-mx.org; Sun, 04 Oct 2020 19:48:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPDjP-0006fi-Ah for emacs-devel@gnu.org; Sun, 04 Oct 2020 19:47:55 -0400 Original-Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:45657) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPDjN-0003XH-8F; Sun, 04 Oct 2020 19:47:54 -0400 Original-Received: by mail-il1-x12e.google.com with SMTP id b12so6216432ilh.12; Sun, 04 Oct 2020 16:47:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S08CTNiELYHddcxB/prVlITnIvcDWIxox8Ql7bvNvQg=; b=HdfSUBLHurhtBQ+hWgD+uQVnR52kiVXyMW2lcb0AzAHq7pg+tNtDFesfnWY3bpWivF enS5EMCrLs6eQpxjJ1In8EHcFesJyjYfeCdpi+xan2xxIj9jNLV0FQ07kWo8Mb+buUyv 5tjzbiliLU90c3cLh5ps5T8RYk2dvgJcEODtNXuvCwdG154LEIsc1EABWmNqAvWAqfs7 ipAMQqf1S2sRKm81t2k4lKq2jiQjMzOvvPu9rOXpza6Gc6au6TdXZilQbuvWveifCFfs zQRUmTob4XVS22KxsF7ikK1QgGiFHRIwEfi9BmnlAfOssWE6ZyQKOWeZCKeE9eGI8JNk 5Rhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S08CTNiELYHddcxB/prVlITnIvcDWIxox8Ql7bvNvQg=; b=Zj+Q73/L2plpBuAKxfSk/b5yZWvaKZoZ5ygD5e78eAi6Ze+gar211vGyNrOo1ZbWh6 7NCBW0MvtaE1KBJ6H5VCGSf0hPSBUtjSQlwxQgdsALr+vHorEEm6kLqiMplIjV9Anpmu pMVkk6cCntBLHaVP25IA8gO7akKid4frGQRcFoXyjc7gmQjnm6fvyHzO3gNJ+NKyORgt SN47fMICpYxUowGU2BsR+S8v9rNm1B8Co6uumAhByDdPPAHJhosUIjO2i407yHoc7JLZ IBzCNYMyS6WnHYPit3Oo/YYGspIAzWVY1ohN1vyf0LL0/0nhaSjc6veFw2ICfsIw6W+i g7Vw== X-Gm-Message-State: AOAM5324iNQz/RQyc4pGDHsLy0iw+q1rPJGDXUqlU//5PjFvRi53/Py8 ojJqzhRQjwxR9UhkIY785v7Y87UshjiRsYZ/yME= X-Google-Smtp-Source: ABdhPJy0lRB467DX0kWLd66x3ulNolGQk5ODeFgjLomg7awlUvcy84toCdTVJf+yPWu14dnWJ1KTrIg82wkCFkKKG0g= X-Received: by 2002:a92:a307:: with SMTP id a7mr8409194ili.97.1601855271341; Sun, 04 Oct 2020 16:47:51 -0700 (PDT) In-Reply-To: <20201001164804.mqqyxtet4ttweuyv@Ergus> Received-SPF: pass client-ip=2607:f8b0:4864:20::12e; envelope-from=joaotavora@gmail.com; helo=mail-il1-x12e.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:257056 Archived-At: --0000000000006e11a305b0e0fea4 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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? Jo=C3=A3o On Thu, Oct 1, 2020 at 5:48 PM Ergus 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 > --=20 Jo=C3=A3o T=C3=A1vora --0000000000006e11a305b0e0fea4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ergus,

Thanks, I had a lo= ok at your patch.=C2=A0 I'm personally not too fond of that kind of
complexity coming into lisp/icomplete.el especially when then a= re simpler
formulae for achieving a funcional vertical icomp= lete system.=C2=A0 My solution is even
simpler than Gregory&= #39;s for example (and based on his):

(setq icompl= ete-prospects-height 6)
(setq icomplete-separator "\n")
(defun icomplete-vertical-adjust-minibuffer-height (completions)
=C2=A0= (let* ((comp completions)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (complen (= length (split-string comp "\n"))))
=C2=A0 =C2=A0 =C2=A0(if (&g= t; complen 1) (enlarge-window (- icomplete-prospects-height (1- (window-hei= ght)))))
=C2=A0 =C2=A0 =C2=A0comp))
(advice-add 'icomplete-comple= tions :filter-return #'icomplete-vertical-adjust-minibuffer-height)

So, in my view, all that's needed is to fix the w= indow 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 feat= ures you are working
on can be developed.

By the way, do you mind listing here exactly which ones those are in rela= tion to the
system attained=C2=A0 by the code above?

Jo=C3=A3o


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

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=C3=A3o T=C3=A1vora
--0000000000006e11a305b0e0fea4--