From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ergus Newsgroups: gmane.emacs.devel Subject: Re: feature/icomplete-vertical Date: Sat, 12 Sep 2020 15:33:11 +0200 Message-ID: <20200912133311.6ujtgczj6wyclufy@Ergus> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16083"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , casouri@gmail.com, emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Sep 12 15:33:55 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 1kH5f9-00045U-5A for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Sep 2020 15:33:55 +0200 Original-Received: from localhost ([::1]:41614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kH5f8-00084k-7h for ged-emacs-devel@m.gmane-mx.org; Sat, 12 Sep 2020 09:33:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kH5ee-0007ef-Ss for emacs-devel@gnu.org; Sat, 12 Sep 2020 09:33:24 -0400 Original-Received: from sonic304-9.consmr.mail.bf2.yahoo.com ([74.6.128.32]:37751) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kH5ec-0006mV-8V for emacs-devel@gnu.org; Sat, 12 Sep 2020 09:33:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aol.com; s=a2048; t=1599917600; bh=8iAEP8dG2BqzYl/jGxM7RwMvvayjOFplP1MbtnynNFQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From:Subject; b=gukgDTTMNfETv3gfrK08xnB7kd2STAs0M1nObIp9+P2OhGWOnoW6fr1z+YjVVoPsEVrX2l8InLRNBD6tTAFd+ID/Vb5q0GkkAiO9CL3iYVoPEBgcQVz4mpeQNebKXBWyK3DWImd8ZHcnJmnYFe0ske8v9puP8x3iPeWqpSheYXrCG258o0b93NKTK3kmdQN4/rEUA2EnrKnQ1nhopOqEA80F9hOtL1l87Zwrba6YD/pA2Ch5Al/CFevemtG64CvJ6Xd9qG19MSYziSwp+PCxICsbVhegwzO2yf1/OMAybHK0BXnDOYArrm+JqOZzbqNGB6UWQ9Srb93eBLlRDPC6Yw== X-YMail-OSG: OHyjIHQVM1nJYWJx_EP4_CtOmNqWxxYPdAXKWxp6shdIcNP_aSxxfFFFiSZIPOh MgReLIIKNrM5r2I19_kTbPd2eb25nc7zu8X8YXLZ9rGyC31ZwqDGYr5ojBFQ2YZG5MUUNCnu6isD p73E_2JtMvWGLhbyy1vatC5V9bxb22t__Nl5oIkm_lM8wHlJgg212iMyFiODhX0Bi8jcXpiMfkyn nd2vIfs1.PAHFP2dIVAH16BJuwkumbWYsMZz6sfgw6hSHw0HK2y59OANZdgzBVFEfdhoI13CQHLH L7ENc1G8TmSyWqM23pdSfBA2CMZXv2ONhiyxgmoJ1SOv28wS.xcUksbwhBOYhcMLg7ukzk90ImX1 kBw761WM77Sw7K6vHKQqueMWY3qBR2weZ.E1GzcDBJqdZvgKPyASbDRAOErSQug1TqZ0au5BLPNC DNCbrizqlMW6YI5jK4JH5FbqROi9zNyUi3cfpl0wv6phE9V.xOF56gTjOhosCwokxqORtgQcl48i CguRARQ7PAIkRfSXMAlUjYZ74CHjBtpACufPBlQ6F4LgbNOjQGXcYgm3lpjMue99sQcXYcAWrZhD u0NTrDITAKeDB.BjD2vuEwpwGkraa415wZybmBzqjsLRyM5x3yTAyjrL2BuVeljYe1yx4dOvNIiz seAv5UhOuGTQCSwDdA501o9ov9ePx7DFLGHMRF5ugGWdSnFF_lEAL0UvL0PQN2LwBbcu5.Q_LSeX i.3n.ZE2ZDvsghx5DqkSSmj4PGcZLlDxIzeI4PFjhBrMTs7tg0ViokAORfJOlqxcTyDvMXFbFkxi cyrpxRxrZm56kSWRfz9iFJ8vPEp7swrzdxYYWexOYx Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.bf2.yahoo.com with HTTP; Sat, 12 Sep 2020 13:33:20 +0000 Original-Received: by smtp423.mail.ir2.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID efc02164af10e60496dd17571ce1284c; Sat, 12 Sep 2020 13:33:15 +0000 (UTC) Content-Disposition: inline In-Reply-To: X-Mailer: WebService/1.1.16583 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol Apache-HttpAsyncClient/4.1.4 (Java/11.0.7) Received-SPF: pass client-ip=74.6.128.32; envelope-from=spacibba@aol.com; helo=sonic304-9.consmr.mail.bf2.yahoo.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/12 09:33:20 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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:255344 Archived-At: On Sat, Sep 12, 2020 at 01:10:57PM +0000, Gregory Heytings wrote: > >> >>>If there was a built-in vertical mode it would be better / more >>>intuitive. >> >>Could you try the branch feature/icomplete-vertical? I need some >>testers before adding it to master. >> > >Alas no, I have been using the following to have icomplete-vertical >for quite some time, it works perfectly well, so I don't see why a >more complex implementation would be necessary. > >(setq icomplete-prospects-height 6) >(setq icomplete-separator "\n") >(defun icomplete-vertical-minibuffer-setup () > (setq truncate-lines t) > (setq-local completion-ignore-case t) > (setq-local read-file-name-completion-ignore-case t) > (setq-local read-buffer-completion-ignore-case t) > (setq icomplete-hide-common-prefix nil)) >(add-hook 'icomplete-minibuffer-setup-hook #'icomplete-vertical-minibuffer-setup) >(defun icomplete-vertical-reformat-completions (completions) > (save-match-data > (let ((cnp (substring-no-properties completions))) > (if (string-match "^\\((.*)\\|\\[.+\\]\\)?{\\(\\(?:.\\|\n\\)+\\)}" cnp) > (format "%s \n%s" > (or (match-string 1 cnp) "") > (replace-regexp-in-string "^" (make-string (current-column) ? ) (match-string 2 cnp))) > cnp)))) >(defun icomplete-vertical-adjust-minibuffer-height (completions) > (let* ((comp (icomplete-vertical-reformat-completions 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) 1) Internal functionalities try not to use advises. 2) The branch is not actually more complex, it just generates the formatted vertical output form the beginning. 3) It does more or less the same you are doing but with a simpler config: (icomplete-mode t) (icomplete-format 'vertical) 4) We add arrow bindings to move 5) Add completion matching faces is also coming.