From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] icomplete-vertical Date: Tue, 06 Apr 2021 01:04:22 +0200 Message-ID: <87h7kkwcy1.fsf@posteo.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7619"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: emacs-devel@gnu.org To: Gregory Heytings Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 06 01:06:17 2021 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 1lTYIT-0001sc-4B for ged-emacs-devel@m.gmane-mx.org; Tue, 06 Apr 2021 01:06:17 +0200 Original-Received: from localhost ([::1]:44862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTYIS-0003SC-4I for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 19:06:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTYGp-0002Qt-OJ for emacs-devel@gnu.org; Mon, 05 Apr 2021 19:04:35 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:36183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTYGh-0000CP-F9 for emacs-devel@gnu.org; Mon, 05 Apr 2021 19:04:35 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DC99216005F for ; Tue, 6 Apr 2021 01:04:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1617663863; bh=GPsIW7iF9Fjv2Ahuc1AfxIPL7pWJs78sXtjjtlnsvIU=; h=From:To:Cc:Subject:Date:From; b=SHcyWGpQ9M5+mEP32h7cuSTHpZyWXAwHhvNIKOAQD4BesnDOY1hhRxzJ3zL6k8/E9 gf+FyICCoIK3iL5MC5Ab6+mjomvLv0O3zSpRvfrU4crKhPAObFaR+nOZHB6tzkHrA9 x+dS4TBz9TPpk719BOXS26LCzSfAfCqCYccqa95TsxDkost7jhGCOKZaglCFLYhvxS 4QbNtKd3ZJoHACgb9s9jbrhSY8jL1PidbuBzWNJSLWmjb9D1+REOMrhWmz26NhpY4T uT5EamqjRgcPz8jhd98KyE8V2mg6GbkOPvf9cKz3Jh7agOIm9K3Eegnlyo8iNiri7K 4eFCSVKi4bzCw== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FDmSR2XVLz6tm9; Tue, 6 Apr 2021 01:04:23 +0200 (CEST) In-Reply-To: (Gregory Heytings's message of "Mon, 05 Apr 2021 22:23:16 +0000") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:267446 Archived-At: Gregory Heytings writes: > +;;;###autoload > +(define-minor-mode icomplete-vertical-mode > + "Toggle incremental minibuffer completion with vertical display. > + > +This global minor mode is identical to `icomplete-mode' (which see), > +except that it displays the list of completions candidates vertically. > + > +As many completion candidates as possible are displayed, depending on > +the value of `max-mini-window-height'." > + :global t :group 'icomplete > + (remove-hook 'icomplete-minibuffer-setup-hook > + #'icomplete-vertical-minibuffer-setup) > + (advice-remove 'icomplete-completions > + #'icomplete-vertical-reformat-completions) > + (icomplete-mode -1) > + (when icomplete-vertical-mode > + (icomplete-mode 1) > + (setq icomplete-separator "\n") > + (setq icomplete-hide-common-prefix nil) > + ;; ask `icomplete-completions' to return enough completions candidates > + (setq icomplete-prospects-height 25) > + (add-hook 'icomplete-minibuffer-setup-hook > + #'icomplete-vertical-minibuffer-setup) > + (advice-add 'icomplete-completions > + :filter-return #'icomplete-vertical-reformat-completions))) > + Why is this a patch that uses advice and hook instead of a user option that changes the behaviour of icomplete directly? -- Philip K.