unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: M-g in dired
Date: Mon, 07 Nov 2005 16:27:11 +0200	[thread overview]
Message-ID: <87k6fku51c.fsf@jurta.org> (raw)
In-Reply-To: <E1EYXhD-0001ig-QF@fencepost.gnu.org> (Richard M. Stallman's message of "Sat, 05 Nov 2005 18:43:39 -0500")

>     `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/

  reply	other threads:[~2005-11-07 14:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-15 11:27 M-g in dired Juri Linkov
2005-10-15 19:33 ` Kim F. Storm
2005-10-16 14:40 ` Richard M. Stallman
2005-10-16 14:40 ` Richard M. Stallman
2005-10-31  1:14 ` Richard Stallman
2005-10-31  7:47   ` Juri Linkov
2005-11-01  2:13     ` Richard M. Stallman
2005-11-01  9:16       ` Juri Linkov
2005-11-01 14:09         ` Andreas Schwab
2005-11-01 19:55           ` Juri Linkov
2005-11-02 10:28             ` Richard M. Stallman
2005-11-02 10:27         ` Richard M. Stallman
2005-11-03  7:48           ` Juri Linkov
2005-11-03 15:03             ` Stefan Monnier
2005-11-04 12:06               ` Juri Linkov
2005-11-05  1:37                 ` Richard M. Stallman
2005-11-05  7:55                   ` Juri Linkov
2005-11-05 23:43                     ` Richard M. Stallman
2005-11-07 14:27                       ` Juri Linkov [this message]
2005-11-07 16:03                         ` Stefan Monnier
2005-11-08 12:43                           ` Juri Linkov
2005-11-09  2:57                             ` Richard M. Stallman
2005-11-07 21:56                         ` Richard M. Stallman
2005-11-03 21:41             ` Richard M. Stallman
     [not found] <446C7B73.60907@earthlink.net>
2006-05-19  2:04 ` Richard Stallman
2006-05-19  3:04   ` Juri Linkov
2006-05-19  8:16     ` Kim F. Storm
2006-05-19  8:43       ` Miles Bader
2006-05-19 12:37         ` Kim F. Storm
2006-05-20 13:45         ` Juri Linkov
2006-05-20  5:03       ` Richard Stallman
     [not found]     ` <E1FhJd4-000822-Fe@fencepost.gnu.org>
2006-05-20 13:45       ` Juri Linkov
2006-05-20 15:46         ` Johan Bockgård
2006-05-20 20:03           ` Juri Linkov
2006-05-20 20:41             ` Romain Francoise
2006-05-21  0:56         ` Richard Stallman
2006-05-21  4:28           ` Juri Linkov
2006-05-22  2:38             ` Richard Stallman
2006-05-22 13:46               ` Juri Linkov
2006-05-22 20:37                 ` Richard Stallman
2006-05-23  5:16                   ` Juri Linkov
2006-05-19 18:53   ` David Hansen
2006-05-19 19:57     ` Reiner Steib
2006-05-19 20:07     ` Miles Bader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k6fku51c.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).