From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: bypassing defining prefix keys Date: Mon, 05 Feb 2007 14:10:07 -0500 Message-ID: References: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1170702704 2611 80.91.229.12 (5 Feb 2007 19:11:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Feb 2007 19:11:44 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 05 20:11:37 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HE9FU-0005wN-99 for ged-emacs-devel@m.gmane.org; Mon, 05 Feb 2007 20:11:32 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HE9FT-0000E2-O4 for ged-emacs-devel@m.gmane.org; Mon, 05 Feb 2007 14:11:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HE9FG-0000Cj-EK for emacs-devel@gnu.org; Mon, 05 Feb 2007 14:11:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HE9FE-0000Ax-Ga for emacs-devel@gnu.org; Mon, 05 Feb 2007 14:11:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HE9FE-0000Am-5Z for emacs-devel@gnu.org; Mon, 05 Feb 2007 14:11:16 -0500 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HE9FD-0005Sc-PS for emacs-devel@gnu.org; Mon, 05 Feb 2007 14:11:15 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1HE9E7-0005ZH-My; Mon, 05 Feb 2007 14:10:07 -0500 In-reply-to: X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:65939 Archived-At: (define-key dired-mode-map "*" nil) (define-key dired-mode-map "*/" 'dired-mark-directories) ... This explains the behavior I get, but I wonder if `*' and `%' should be defined this way. Is there a guideline or policy on this? Obviously, it would be better for my key-completion code if `*' and `%' were defined as real prefix keys. Actually this DOES define them as prefix keys; this is a valid way to do so. The other method is to define it as a symbol and give the symbol the submap as a function definition. It seems your completion command works with one method of doing so and not with the other. But it could handle both. ;; Make all regexp commands share a `%' prefix: ;; We used to get to the submap via a symbol dired-regexp-prefix, ;; but that seems to serve little purpose, and copy-keymap ;; does a better job without it. I don't understand the part about `copy-keymap' (which is not used in dired.el, in any case). What is the `copy-keymap' limitation that is hinted at here? I think it is this: with a symbol in the way, `copy-keymap' won't copy that symbol (since an interned symbol is unique), nor whatever map it points to. With no symbol, it will recursively copy the submap. Why it should be relevant here, I am not sure. Maybe some other mode does (or did) `copy-keymap' on `dired-mode-map'.