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: Sat, 04 Jan 2014 18:02:26 -0500 Message-ID: References: <87fvqtg02v.fsf@flea.lifelogs.com> <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> <87vby6s3ji.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388876567 12005 80.91.229.3 (4 Jan 2014 23:02:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 4 Jan 2014 23:02:47 +0000 (UTC) Cc: Emacs developers , John Yates To: joaotavora@gmail.com (=?windows-1252?B?Sm/jbyBU4XZvcmE=?=) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 00:02:53 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 1VzaF2-0004la-3U for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 00:02:52 +0100 Original-Received: from localhost ([::1]:55998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzaF1-0008Fi-Gs for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2014 18:02:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzaEr-0008FX-Sf for emacs-devel@gnu.org; Sat, 04 Jan 2014 18:02:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzaEk-0005CL-JG for emacs-devel@gnu.org; Sat, 04 Jan 2014 18:02:41 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:9985) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzaEk-0005CG-FF for emacs-devel@gnu.org; Sat, 04 Jan 2014 18:02:34 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYcBxALNBIUGA2IQgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYcBxALNBIUGA2IQgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="44008849" Original-Received: from 184-175-11-38.dsl.teksavvy.com (HELO pastel.home) ([184.175.11.38]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 Jan 2014 18:02:30 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id DBEC5604AC; Sat, 4 Jan 2014 18:02:26 -0500 (EST) In-Reply-To: <87vby6s3ji.fsf@gmail.com> (=?windows-1252?Q?=22Jo=E3o_T=E1vo?= =?windows-1252?Q?ra=22's?= message of "Mon, 30 Dec 2013 16:32:17 +0000") 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.181 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:167336 Archived-At: >> 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? Everything's possible and yes, I think there's interest in supporting this cleanly. There are different approaches, tho. One is advice-add. This makes it possible to extend a command with new behavior, with a clean and simple fallback mechanism. If OTOH you want to "extend a key-binding", we don't have a good story. You can do things like (define-key map [?\C-i] `(menu-item "" mycommand :filter ,(lambda (cmd) (if cmd)))) which will use `mycommand' if is true and fallback on the next binding otherwise. But this is not very satisfactory: - no way to do something after the fallback command is run. - C-h k will only tell you about one of the possible commands. - Can't have more than one such "conditional binding" for the same key in the same keymap. > (define-fallbackish-command maybe-foo (kbd "[somekey]") () I don't understand what's the intended relation between [somekey] and `maybe-foo'. Stefan