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: Mon, 07 Nov 2005 11:03:21 -0500 Message-ID: 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> <87k6fku51c.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 1131379571 8081 80.91.229.2 (7 Nov 2005 16:06:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 7 Nov 2005 16:06:11 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 07 17:06:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EZ9Ti-0005JP-Ka for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2005 17:04:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ9Th-0004sw-NJ for ged-emacs-devel@m.gmane.org; Mon, 07 Nov 2005 11:04:13 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZ9Sx-0004e4-RZ for emacs-devel@gnu.org; Mon, 07 Nov 2005 11:03:27 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZ9Sx-0004dc-4e for emacs-devel@gnu.org; Mon, 07 Nov 2005 11:03:27 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZ9Sw-0004dT-PE for emacs-devel@gnu.org; Mon, 07 Nov 2005 11:03:26 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZ9Sv-0000ZJ-Sv; Mon, 07 Nov 2005 11:03:26 -0500 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 869272CF6A6; Mon, 7 Nov 2005 11:03:25 -0500 (EST) Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id 2BC554AC00A; Mon, 7 Nov 2005 11:03:21 -0500 (EST) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 19514E6C18; Mon, 7 Nov 2005 11:03:21 -0500 (EST) Original-To: Juri Linkov In-Reply-To: <87k6fku51c.fsf@jurta.org> (Juri Linkov's message of "Mon, 07 Nov 2005 16:27:11 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-4.853, requis 5, autolearn=not spam, AWL 0.05, BAYES_00 -4.90) X-MailScanner-From: monnier@iro.umontreal.ca 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:45553 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. A compomise might be to return 1 for (lookup-key map [e1 e2 e3]) if [e1 e2] is bound to a command, and to return -1 if [e1] is bound to a prefix key and [e1 e2] is not bound to anything. Callers might need to be updated but a quick `abs' is all it takes to recover the current info. Stefan