From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Spiers Subject: FR: keystroke to cancel prefix sub-keymap Date: Sat, 29 Dec 2007 21:48:51 +0000 Message-ID: <20071229214851.GC10722@atlantic.linksys.moosehall> Reply-To: Adam Spiers Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J8jY7-0001vI-Ij for emacs-orgmode@gnu.org; Sat, 29 Dec 2007 16:48:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J8jY6-0001ud-70 for emacs-orgmode@gnu.org; Sat, 29 Dec 2007 16:48:55 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J8jY6-0001ua-4z for emacs-orgmode@gnu.org; Sat, 29 Dec 2007 16:48:54 -0500 Received: from mail.beimborn.com ([70.84.38.100]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J8jY5-0002Yc-Qv for emacs-orgmode@gnu.org; Sat, 29 Dec 2007 16:48:54 -0500 Received: from mail.beimborn.com (localhost.localdomain [127.0.0.1]) by mail.beimborn.com (8.12.11.20060308/8.12.8) with ESMTP id lBTLmq8N012504 for ; Sat, 29 Dec 2007 15:48:52 -0600 Received: from localhost (localhost [[UNIX: localhost]]) by mail.beimborn.com (8.12.11.20060308/8.12.11/Submit) id lBTLmq83012498 for emacs-orgmode@gnu.org; Sat, 29 Dec 2007 21:48:52 GMT Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: org-mode mailing list Suppose that I have a sub-keymap for custom agenda commands with prefix 's', i.e. shortcuts 's1', 's2', 's3' and so on. I might invoke org-agenda, press 's', then change my mind and want to use another custom command instead. Currently, the only way of doing this would be to press something like 'q' or C-g, then reinvoke org-agenda. It would be nice instead if there was a keystroke which simply returned you to the first *Agenda Commands* buffer. The following patch demonstrates the required behaviour, but as you can see, is not a particularly clean way of doing it. http://www.adamspiers.org/cgi-bin/hg.cgi/org-pacific/rev/8fadf3f7ddda # HG changeset patch # User Adam Spiers # Date 1198960339 0 # Node ID 8fadf3f7ddda7680bf0df572bdc48f7a0133ee14 # Parent 42a4c005ba9ce0df46b01b9571fff385a65ccae5 SPACE to cancel prefix sub-keymap --- a/org.el Sat Dec 29 20:32:19 2007 +0000 +++ b/org.el Sat Dec 29 20:32:19 2007 +0000 @@ -19340,6 +19340,14 @@ L Timeline for current buffer (setq restriction nil)) ((and (equal selstring "") (memq c '(?a ?t ?m ?L ?C ?e ?T ?M ?# ?! ?/))) (throw 'exit (cons (setq selstring (char-to-string c)) restriction))) + ((and (> (length selstring) 0) (eq c ? )) + (delete-window) + (org-agenda-get-restriction-and-command prefix-descriptions)) +;; Can't do it this way because help text describing hardcoded agenda +;; commands is inserted into buffer outside the (while t ...) loop. +;; (setq selstring "" +;; rmheader 0 +;; custom org-agenda-custom-commands)) ((equal c ?q) (error "Abort")) (t (error "Invalid key %c" c))))))))