From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: M-g in dired Date: Sat, 05 Nov 2005 09:55:35 +0200 Organization: JURTA Message-ID: <87pspfa8ig.fsf@jurta.org> References: <873bnf36mr.fsf@jurta.org> <878xwap86u.fsf@jurta.org> <8764rcye8k.fsf@jurta.org> <877jbqmrbc.fsf@jurta.org> <87r79xzsl5.fsf-monnier+emacs@gnu.org> <87zmok96ry.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 1131178386 1894 80.91.229.2 (5 Nov 2005 08:13:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Nov 2005 08:13:06 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 05 09:13:06 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EYJ9j-00017R-Ik for ged-emacs-devel@m.gmane.org; Sat, 05 Nov 2005 09:12:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYJ9i-00018b-PH for ged-emacs-devel@m.gmane.org; Sat, 05 Nov 2005 03:12:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EYIxd-0006Op-Lz for emacs-devel@gnu.org; Sat, 05 Nov 2005 02:59:39 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EYIxc-0006OL-VL for emacs-devel@gnu.org; Sat, 05 Nov 2005 02:59:37 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EYIxN-0006Ip-6i for emacs-devel@gnu.org; Sat, 05 Nov 2005 02:59:21 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EYIxM-0001q7-DW; Sat, 05 Nov 2005 02:59:20 -0500 Original-Received: from mail.neti.ee (80-235-33-80-dsl.mus.estpak.ee [80.235.33.80]) by Relayhost1.neti.ee (Postfix) with ESMTP id EBAAF174E; Sat, 5 Nov 2005 09:59:30 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Fri, 04 Nov 2005 20:37:23 -0500") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: by amavisd-new-2.2.1 (20041222) (Debian) at neti.ee 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:45432 Archived-At: > However, if this is not what the docstring meant, and leaving the logic > of the current return value is desirable, then maybe `lookup-key' needs > an additional argument defining another logic of its return value. > > Why? > > Otherwise, almost all code in `lookup-key' should be duplicated in > `shadow_lookup'. > > Why? To fix the bug, I think changes should be made in `shadow_lookup'. Let's see how it currently works for the case when dired-mode-map defines the "M-g" key, and the global-map defines "M-gn": `shadow_lookup' iterates over two maps (dired and global) and calls `Flookup_key' on them. When `Flookup_key' returns 1 for the key "M-gn" on the dired map, the loop in `shadow_lookup' skips it and advances to the next iteration on the global map where it finds the command `next-error' bound to "M-gn", and returns it. This causes the current code to assume that "M-gn" in the global map is not shadowed by "M-g" in the dired map. It fails due to the value 1 returned by `Flookup_key', which is unsuitable to decide whether "M-g" is bound in the dired map or not, and thus whether it shadows "M-gn" in the global map or not. To fix this, I intended to use the same code as `Flookup_key' uses to process key sequences, but additionally to check whether a shorter prefix key is bound or not. This can be achieved either by adding a new argument to `Flookup_key' to check if a key is bound and to return the corresponding return value (and not to change its current default semantics of the return value), or to duplicate most code of `Flookup_key' in `shadow_lookup' to do this. -- Juri Linkov http://www.jurta.org/emacs/