From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Emacs completion matches selection UI Date: Tue, 19 Nov 2013 09:00:40 -0500 Message-ID: References: <87fvqtg02v.fsf@flea.lifelogs.com> <877gc5fm30.fsf@flea.lifelogs.com> <87bo1h6wvk.fsf@mail.jurta.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384869662 2602 80.91.229.3 (19 Nov 2013 14:01:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Nov 2013 14:01:02 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 19 15:01:07 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VilrW-0008SQ-Kf for ged-emacs-devel@m.gmane.org; Tue, 19 Nov 2013 15:01:06 +0100 Original-Received: from localhost ([::1]:49428 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VilrW-0004RW-96 for ged-emacs-devel@m.gmane.org; Tue, 19 Nov 2013 09:01:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44525) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VilrG-0004BI-17 for emacs-devel@gnu.org; Tue, 19 Nov 2013 09:00:57 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vilr7-0007iT-Sb for emacs-devel@gnu.org; Tue, 19 Nov 2013 09:00:49 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:32111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vilr7-0007iI-KA for emacs-devel@gnu.org; Tue, 19 Nov 2013 09:00:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+KWN/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GsR+QDpEKA4hhiXmSIIFegxU X-IPAS-Result: Av4EABK/CFHO+KWN/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GsR+QDpEKA4hhiXmSIIFegxU X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="38605719" Original-Received: from 206-248-165-141.dsl.teksavvy.com (HELO pastel.home) ([206.248.165.141]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Nov 2013 09:00:40 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 6CFC26066D; Tue, 19 Nov 2013 09:00:40 -0500 (EST) In-Reply-To: (Tom's message of "Tue, 19 Nov 2013 11:18:09 +0000 (UTC)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:165379 Archived-At: >> In modern UIs, auto-completion works such a way that after you type text >> it pops up a drop-down menu with a list of candidates where you can >> select one by using and arrow keys. > Helm works like this. You type and the candidates appear automatically. For the "appear" part you could start with the trivial minor-mode below. But I think what Ted is after is the other part: down/up/... While there is a risk of conflict in key-bindings, I do think it should be possible to "keep the best of both worlds" such that it could be enabled by default. E.g.: keep the same behavior by default as we have now, except that we add a new `select-completion-mode'. In this new mode, cursor keys move between elements of the completions list, RET selects the completion element from there, and most other keys just exit the mode. The main issue is then to figure out how/when to switch to this new mode. E.g. when the user hits `up' right after the *Completions* buffer got displayed/updated? > It could also be considered as a possible alternative completion UI. Part of Helm is an alternative completion UI, indeed. Another part is a much fancier completion-list-mode. And then yet another part relies on this much fancier completion-list-mode to change the argument order around, so that instead of first specifying the command and then the object on which to apply it, you first specify the object and then the command. Stefan (defun verbose--icomplete-do () (let ((beg (minibuffer-prompt-end)) (end (point-max)) (non-essential t)) (when (and (not (eq beg end)) buffer-undo-list) (while-no-input (minibuffer-completion-help beg end))))) (defun verbose--icomplete-setup () (when minibuffer-completion-table (add-hook 'post-command-hook #'verbose--icomplete-do nil 'local))) (define-minor-mode verbose-icomplete-mode "" :global t (if verbose-icomplete-mode (add-hook 'minibuffer-setup-hook 'verbose--icomplete-setup) (remove-hook 'minibuffer-setup-hook 'verbose--icomplete-setup)))