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: Sun, 05 Jan 2014 11:11:00 -0500 Message-ID: References: <87fvqtg02v.fsf@flea.lifelogs.com> <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> <87fvp3xjjd.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1388938273 15719 80.91.229.3 (5 Jan 2014 16:11:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jan 2014 16:11:13 +0000 (UTC) Cc: John Yates , Emacs developers 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 17:11:19 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 1VzqII-0001N0-06 for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 17:11:18 +0100 Original-Received: from localhost ([::1]:58391 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzqIH-0004sX-HC for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2014 11:11:17 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzqI7-0004nh-TP for emacs-devel@gnu.org; Sun, 05 Jan 2014 11:11:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VzqI0-0008UW-Jw for emacs-devel@gnu.org; Sun, 05 Jan 2014 11:11:07 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:27368) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VzqI0-0008UR-Fo for emacs-devel@gnu.org; Sun, 05 Jan 2014 11:11:00 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYcBwULCzQSFBgNiEIGwS2RCgOIYZwZgV6DFQ X-IPAS-Result: Av4EABK/CFG4rwsm/2dsb2JhbABEvw4Xc4IeAQEEAVYcBwULCzQSFBgNiEIGwS2RCgOIYZwZgV6DFQ X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="44093156" Original-Received: from 184-175-11-38.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([184.175.11.38]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Jan 2014 11:11:00 -0500 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 04005AE235; Sun, 5 Jan 2014 11:11:00 -0500 (EST) In-Reply-To: <87fvp3xjjd.fsf@gmail.com> (=?windows-1252?Q?=22Jo=E3o_T=E1vo?= =?windows-1252?Q?ra=22's?= message of "Sun, 05 Jan 2014 02:13:42 +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:167370 Archived-At: >>> (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. We could do the above fairly easily with (add-function :around (lookup-key global-map [somekey]) (lambda (orig &rest args) (if (foop) (foo) (apply orig args)))) > I have no idea how it would work with multiple keymaps. Right, that's where it gets more interesting. E.g. some major mode might want to extend the meaning of TAB, but it should do it in the major mode's map, not in the global map. Stefan