From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?utf-8?B?Sm/Do28gVMOhdm9yYQ==?=) Newsgroups: gmane.emacs.devel Subject: Re: Emacs completion matches selection UI Date: Mon, 30 Dec 2013 16:32:17 +0000 Message-ID: <87vby6s3ji.fsf@gmail.com> References: <87fvqtg02v.fsf@flea.lifelogs.com> <87d2kuzzqj.fsf@uwakimon.sk.tsukuba.ac.jp> <87a9fylusq.fsf@flea.lifelogs.com> <878uvizrwz.fsf@uwakimon.sk.tsukuba.ac.jp> <8761qmkyn1.fsf@flea.lifelogs.com> <87zjnyxdpb.fsf@uwakimon.sk.tsukuba.ac.jp> <87k3f2j7xv.fsf@flea.lifelogs.com> <2518D79A-B9E4-45DF-A403-8330145DFD17@gmail.com> <87eh58j0x3.fsf@flea.lifelogs.com> <87mwjvfrfy.fsf@flea.lifelogs.com> <877gawbhp0.fsf@flea.lifelogs.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1388421255 20202 80.91.229.3 (30 Dec 2013 16:34:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Dec 2013 16:34:15 +0000 (UTC) Cc: Emacs developers , John Yates To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 30 17:34:21 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 1VxfnI-0006mW-W9 for ged-emacs-devel@m.gmane.org; Mon, 30 Dec 2013 17:34:21 +0100 Original-Received: from localhost ([::1]:58881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxfnI-0007nL-K2 for ged-emacs-devel@m.gmane.org; Mon, 30 Dec 2013 11:34:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VxfnA-0007dc-DZ for emacs-devel@gnu.org; Mon, 30 Dec 2013 11:34:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vxfn4-0004Ld-Uz for emacs-devel@gnu.org; Mon, 30 Dec 2013 11:34:12 -0500 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:47611) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vxfn4-0004LQ-OV for emacs-devel@gnu.org; Mon, 30 Dec 2013 11:34:06 -0500 Original-Received: by mail-wi0-f171.google.com with SMTP id bz8so16462884wib.16 for ; Mon, 30 Dec 2013 08:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=otIn4Ddz8y3yh8HN0U4abvKlTvyk3Ach+HrTaMC3M+M=; b=ITzF9enS6JoQavbfzHQrLeWmXNzc4r4n+KZTOq6OEbVRpYnV4WpASj5GpIJnCjQ+gN kFciXRqD3Fa7Se8jWW8D+OLmk2FOi8BVgaKszphlGp9mi+KIUCLAu5p0ZvMVbAXFp1Ur TpuqUdKshL54cl78IXjz58EH6tpo66uGA1bEz/Tr18oEgv6AUsbQS8SAcqen3BT9YpPE I0xjsvsBLhJ7ZHSPo+jv+tvYGQeBh5yhPYmoFpa7yqmbrZMJO4QbSF45TOJpKTZ9YiC4 EEYQ/1kv0hhbnOWZ6SWkU4zQ/+XVovaBLnR8ATk1XsndVXtBxF80DEH9ReRiUiLKYlrt ZXeg== X-Received: by 10.194.81.196 with SMTP id c4mr9236583wjy.57.1388421245767; Mon, 30 Dec 2013 08:34:05 -0800 (PST) Original-Received: from kitaj.yourcompany.com (66.207.108.93.rev.vodafone.pt. [93.108.207.66]) by mx.google.com with ESMTPSA id e5sm11397334wja.15.2013.12.30.08.34.04 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 30 Dec 2013 08:34:04 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Mon, 30 Dec 2013 07:55:21 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b 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:166996 Archived-At: Stefan Monnier writes: >> Does it not then follow that part of creating a more uniform completion >> experience ought to include direct Emacs support for that pattern? The >> alternative is today's hodgepodge of per-package idiosyncratic redefinit= ion >> mechanisms. > > Yes. We should make it easier to extend indent-for-tab-command. Do you think it's possible/desirable to generalize this mechanism (to support the "fallback-maybe" pattern) so that we can make it easier to extend any command, not just indent-for-tab-command? In other words, I believe this could be useful for any binding. I've yet to think of a nice interface, here's just a thought (define-fallbackish-command maybe-foo (kbd "[somekey]") () (interactive) (if (foop) (foo) (fallback))) (define-fallbackish-command maybe-bar (kbd "[somekey]") (args...) (interactive ...) (if (barp) (bar) (fallback))) Now, in a buffer where the active binding (set in whatever manner and following the normal priority rules) for [somekey] is maybe-bar: * if (barp) returns true, (bar) is run * if (barp) fails and (foop) return true, (foo) is run * if both (barp) and (foop) fail, we get the original keybinding [somekey], or nothing if it wasn't bound. In a buffer where the active binding for [somekey] is maybe-foo, only (foo) can ever be run, maybe-bar doesn't enter into play, because it was defined later. Also note that the fallback doesn't have to be mutually exclusive with the actual (bar) and (foo) calls, I just thought of this example. Jo=C3=A3o