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: M-g in dired Date: Thu, 03 Nov 2005 10:03:18 -0500 Message-ID: <87r79xzsl5.fsf-monnier+emacs@gnu.org> References: <873bnf36mr.fsf@jurta.org> <878xwap86u.fsf@jurta.org> <8764rcye8k.fsf@jurta.org> <877jbqmrbc.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1131030898 11763 80.91.229.2 (3 Nov 2005 15:14:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 3 Nov 2005 15:14:58 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 03 16:14:55 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EXgk5-0000Dg-AI for ged-emacs-devel@m.gmane.org; Thu, 03 Nov 2005 16:11:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXgk4-0005KK-NN for ged-emacs-devel@m.gmane.org; Thu, 03 Nov 2005 10:11:04 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EXgcq-0001Lc-FP for emacs-devel@gnu.org; Thu, 03 Nov 2005 10:03:36 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EXgcp-0001LN-Rn for emacs-devel@gnu.org; Thu, 03 Nov 2005 10:03:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXgcp-0001LK-Mp for emacs-devel@gnu.org; Thu, 03 Nov 2005 10:03:35 -0500 Original-Received: from [209.226.175.184] (helo=tomts22-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EXgcb-0001Kh-CW; Thu, 03 Nov 2005 10:03:21 -0500 Original-Received: from alfajor ([65.92.241.6]) by tomts22-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20051103150320.MDDR21470.tomts22-srv.bellnexxia.net@alfajor>; Thu, 3 Nov 2005 10:03:20 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 078CED7AEC; Thu, 3 Nov 2005 10:03:18 -0500 (EST) Original-To: Juri Linkov In-Reply-To: <877jbqmrbc.fsf@jurta.org> (Juri Linkov's message of "Thu, 03 Nov 2005 09:48:54 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:45357 Archived-At: > But in dired-mode-map, where "C-x `" is undefined, lookup-key > currently returns: > (lookup-key dired-mode-map "\C-x") => nil > (lookup-key dired-mode-map "\C-x`") => 1 > The return value `1' of the last expression seems wrong. No, it is correct. `lookup-key' only looks at the keymap passed as argument and doesn't (and shouldn't) try and guess which other keymaps might/will be active together with this keymap. > This docstring is not very clear. The documentation in the Emacs Lisp > is better: > If the string or vector KEY is not a valid key sequence according to > the prefix keys specified in KEYMAP, it must be "too long" and have > extra events at the end that do not fit into a single key sequence. > Then the value is a number, the number of events at the front of KEY > that compose a complete key. > For the case of dired-mode-map where lookup-key returns 1 for "\C-x`", > 1 is not a number of events at the front of "\C-x`" that compose > a complete key, because "C-x" alone is not a valid key in dired-mode-map. It doesn't say "valid key" it says "valid key sequence". "C-x" is a valid key sequence in this context. It is not bound to anything, but it is a valid sequence. C-x ` is not a valid sequence on the other hand, because read-key-sequence would have immediately stopped after C-x. Stefan