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: Sun, 05 Jan 2014 02:13:42 +0000 Message-ID: <87fvp3xjjd.fsf@gmail.com> References: <87fvqtg02v.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> <87vby6s3ji.fsf@gmail.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 1388888148 18254 80.91.229.3 (5 Jan 2014 02:15:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jan 2014 02:15:48 +0000 (UTC) Cc: John Yates , Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 03:15:54 2014 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 1VzdFq-0001Tm-1b for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 03:15:54 +0100 Original-Received: from localhost ([::1]:56393 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzdFp-0007FE-JN for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2014 21:15:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzdFi-0007EO-FB for emacs-devel@gnu.org; Sat, 04 Jan 2014 21:15:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzdFc-0007wu-RU for emacs-devel@gnu.org; Sat, 04 Jan 2014 21:15:46 -0500 Original-Received: from mail-wi0-x236.google.com ([2a00:1450:400c:c05::236]:41637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzdFc-0007wq-KB for emacs-devel@gnu.org; Sat, 04 Jan 2014 21:15:40 -0500 Original-Received: by mail-wi0-f182.google.com with SMTP id en1so1690747wid.15 for ; Sat, 04 Jan 2014 18:15:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=C89Py5rJMJ29GjpicLDS05oIhaxO+KDCuDHWjCUlKoA=; b=KYRU4UWoxJtbj6x8evgV/35i6805P5OXv7LenVO9OtR4ALEWi1QZVpIHp9botrp0+a PmVPZs07e7s7vcnCiJmBreFeacZfYABWm/Y9VK+BVCURkagMkmDtzaeKDYQMVZIoOBMT y60LQ0ew/WzjOlfH3dune9Z+lNtYqMGw5VgAsc/gNbnWQmZEWVWEOvoPMQKtPnvAF8ja smCL7WTPBpChuwnh1hFH8+g6NtDmvxwW4uk5npm/dxhicj0dKODdnaChzWk7Sj54tRtr Zu2L5bDHuoFOtuuTWDHe/1gSKgzFX+ybsrM69h9dvsaLHCmANXnofeY9YsJRDCKgi7P5 ZbXw== X-Received: by 10.180.184.105 with SMTP id et9mr7023502wic.36.1388888139428; Sat, 04 Jan 2014 18:15:39 -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 y8sm5685635wje.12.2014.01.04.18.15.37 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 04 Jan 2014 18:15:38 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Sat, 04 Jan 2014 18:02:26 -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::236 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:167340 Archived-At: Stefan Monnier writes: >> (define-fallbackish-command maybe-foo (kbd "[somekey]") () > > I don't understand what's the intended relation between [somekey] and > `maybe-foo'. Sorry, I should have provided some implementation, or made this more clear. I The generated part of the `maybe-foo' would do two things: * register the association between maybe-foo and [somekey] in a some global variable, pushing in front of any existing ones also defined with the same macro. This keeps track of the "fallbackish commands" (horrible name, sorry) for [somekey] * bind maybe-foo to [somekey] in the (global) keymap, maybe replacing someone else's binding. When (if ever) `fallback' is called from a command's body, it looks up the first variable. Its a list of commands that are still fallbacks to the current. It removes the current command from the list, let-binds the list and calls the next command. Now, I haven't even attempted this, but it sounded good (in my head :)) and think it could resolve most problems. I'll try to implement it and get back to you, unless someone immediately detects some big error. One problem is that you more or less now have two bindings to synchronize, and this may be quite bad. The map's binding and the other global variable. I have no idea how it would work with multiple keymaps. > binding otherwise. But this is not very satisfactory: > - no way to do something after the fallback command is run. `fallback' could be called anywhere from `maybe-foo's body. > - C-h k will only tell you about one of the possible commands. yasnippet does this with (put 'yas-expand 'function-documentation '(yas--expand-from-trigger-key-doc t)) in which the latter function calls a `yas--keybinding-beyond-yasnippet' function. I believe this could also be done with the above idea. > - Can't have more than one such "conditional binding" for the same key > in the same keymap. This is the main use case i'm trying to cover. Jo=C3=A3o