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: Mon, 07 Nov 2005 16:27:11 +0200 Organization: JURTA Message-ID: <87k6fku51c.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> <87pspfa8ig.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 1131376361 28782 80.91.229.2 (7 Nov 2005 15:12:41 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2005 15:12:41 +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 Mon Nov 07 16:12:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZ8bP-000259-Ns for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2005 16:08:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ8bP-0001b9-2B for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2005 10:08:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZ8LB-0000By-QX for emacs-devel@gnu.org; Mon, 07 Nov 2005 09:51:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZ8L8-00009B-7V for emacs-devel@gnu.org; Mon, 07 Nov 2005 09:51:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ8L7-000091-Vl for emacs-devel@gnu.org; Mon, 07 Nov 2005 09:51:18 -0500 Original-Received: from [194.126.101.111] (helo=mail.neti.ee) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZ8Ko-0002KA-Jo; Mon, 07 Nov 2005 09:50:58 -0500 Original-Received: from mail.neti.ee (80-235-32-104-dsl.mus.estpak.ee [80.235.32.104]) by Relayhost1.neti.ee (Postfix) with ESMTP id 1A4581FB9; Mon, 7 Nov 2005 16:50:57 +0200 (EET) Original-To: rms@gnu.org In-Reply-To: (Richard M. Stallman's message of "Sat, 05 Nov 2005 18:43:39 -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:45543 Archived-At: > `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 > > That's the place that has to be changed. > > When this call to `Flookup_key' returns a number N, `shadow_lookup' > should look up a sub-key-sequence of the first N events. If that > returns non-nil, the longer key is shadowed, so don't mention it at all. > If that returns non-nil, the longer key is not shadowed. This is what I considered initially as one variant, but wanted to make the returned value of `Flookup_key' more useful. If this is not needed, then the patch below changes only `shadow_lookup'. I tested it, and it works. Index: src/keymap.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/keymap.c,v retrieving revision 1.307 diff -c -r1.307 keymap.c *** src/keymap.c 12 Sep 2005 10:26:35 -0000 1.307 --- src/keymap.c 7 Nov 2005 14:17:55 -0000 *************** *** 2377,2383 **** for (tail = shadow; CONSP (tail); tail = XCDR (tail)) { value = Flookup_key (XCAR (tail), key, flag); ! if (!NILP (value) && !NATNUMP (value)) return value; } return Qnil; --- 2377,2389 ---- for (tail = shadow; CONSP (tail); tail = XCDR (tail)) { value = Flookup_key (XCAR (tail), key, flag); ! if (NATNUMP (value)) ! { ! value = Flookup_key (XCAR (tail), Fsubstring (key, 0, value), flag); ! if (!NILP (value)) ! return Qnil; ! } ! else if (!NILP (value)) return value; } return Qnil; -- Juri Linkov http://www.jurta.org/emacs/