From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/75918 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.gnus.general,gmane.emacs.bugs Subject: Re: bug#7727: describe-key doesn't tell whole redirect sequence Date: Mon, 24 Jan 2011 22:09:10 -0500 Message-ID: References: <87k4iznqjz.fsf_-_@jidanni.org> <87oc772ju1.fsf@gnus.org> <874o8z2ix4.fsf@gnus.org> <87aaiqota7.fsf@gnus.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295924987 24733 80.91.229.12 (25 Jan 2011 03:09:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 25 Jan 2011 03:09:47 +0000 (UTC) Cc: jidanni@jidanni.org, 7727debbugs.gnu.org@pastel.home, yamaoka@jpl.org, bug-gnu-emacs@gnu.org, ding@gnus.org To: Lars Ingebrigtsen Original-X-From: ding-owner+M24269@lists.math.uh.edu Tue Jan 25 04:09:42 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PhZHp-0003fx-Vu for ding-account@gmane.org; Tue, 25 Jan 2011 04:09:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1PhZHW-0001Qg-G0; Mon, 24 Jan 2011 21:09:22 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1PhZHU-0001QT-Oh for ding@lists.math.uh.edu; Mon, 24 Jan 2011 21:09:20 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1PhZHT-000210-DL for ding@lists.math.uh.edu; Mon, 24 Jan 2011 21:09:20 -0600 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1PhZHS-0000XA-8V; Tue, 25 Jan 2011 04:09:18 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAGDNPU1MCo4O/2dsb2JhbACka3S7YYVQBIUXj2g X-IronPort-AV: E=Sophos;i="4.60,372,1291611600"; d="scan'208";a="89126343" Original-Received: from 76-10-142-14.dsl.teksavvy.com (HELO pastel.home) ([76.10.142.14]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 24 Jan 2011 22:09:10 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 5B8A258C4E; Mon, 24 Jan 2011 22:09:10 -0500 (EST) In-Reply-To: <87aaiqota7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 24 Jan 2011 14:01:36 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:75918 gmane.emacs.bugs:43621 Archived-At: >> A cleaner could look like the following: add dynamic keymaps to Emacs, >> where "dynamic keymaps" are represented as functions/objects a bit like >> functional completion tables. > Hm... how would that work? > The complicated run-summary-commands-from-the-article-buffer thing is > quite, er, complicated, because some commands need to keep the window > conf, while others shouldn't, and stuff. I haven't worked it out, so I can't really answer. In PCL-CVS I had a similar situation, except that I used a prefix key, so in a derived buffer would call the command bound to in the main buffer, so I didn't need to play tricks with the keymap. But I had to make the commands themselves work in "any" buffer, and indeed, that had to be done differently for each command. How would the dynamic keymap enter the picture: rather than substitute "undefined => gnus-article-read-summary-keys" and fool around describe-key and friends, you'd set article-mode's parent keymap to a dynamic keymap, i.e. a function that takes the current key as argument and needs to return the command to which this key is bound (or nil), so this function can lookup summary mode's keymap and return a command that performs but that works from the article buffer. You can do this last step either by making all summary command work in the article buffer (as I did in PCL-CVS) or by dynamically wrapping the command into a new command (which would do something similar to gnus-article-read-summary-keys, except it takes the as argument rather than a key-sequence). The main benefit is that the keymapping is made clear to describe-key, so you wouldn't need gnus-article-describe-key and friends. Of course, all this is hypothetical since we don't have dynamic keymaps. As for me, the main reason why I want dynamic keymaps is for use in function-key-map where I'd move most of the "fallback" thingies from read-key-sequence (e.g. A => a, double-mouse-2 => mouse-2, down-mouse-2 => nil, ...) and where we could place generic remappings like "any modifiers + mouse-4 => same modifiers + wheel-up". Stefan