all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* shouldn't substitute-command-keys remove duplicates?
@ 2008-03-21  4:47 Drew Adams
  2008-03-21  4:59 ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2008-03-21  4:47 UTC (permalink / raw)
  To: emacs-pretest-bug

Shouldn't substitute-command-keys remove duplicates?
 
If you explicitly bind a key to the same command in both a
keymap km
and its parent pkm, and then you call this, the binding is
written
twice:
 
(define-key km  "a" 'foo)
(define-key pkm "a" 'foo)
 
(substitute-command-keys "\\{km\\}")
 
key             binding
---             -------
 
...
a  foo
a  foo
...
 

In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
 of 2008-01-30 on PRETEST
Windowing system distributor `Microsoft Corp.', version
5.1.2600
configured using `configure --with-gcc (3.4) --cflags
-Ic:/gnuwin32/include'
 





^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: shouldn't substitute-command-keys remove duplicates?
  2008-03-21  4:47 shouldn't substitute-command-keys remove duplicates? Drew Adams
@ 2008-03-21  4:59 ` Drew Adams
  2008-03-21 17:21   ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2008-03-21  4:59 UTC (permalink / raw)
  To: emacs-pretest-bug

As an example, filecache.el does this (via ;;;###autoload):

(define-key minibuffer-local-completion-map
            [C-tab] 'file-cache-minibuffer-complete)
(define-key minibuffer-local-map
            [C-tab] 'file-cache-minibuffer-complete)
(define-key minibuffer-local-must-match-map
            [C-tab] 'file-cache-minibuffer-complete)

This is in spite of the fact that minibuffer-local-map is
the parent of minibuffer-local-completion-map and
minibuffer-local-completion-map is the parent of
minibuffer-local-must-match-map.

The first and third bindings here are therefore superfluous,
but they serve to show that (substitute-command-keys
"\\{minibuffer-local-must-match-map\\}") doesn't remove the
duplicate entries:

minibuffer-local-must-match-map
-------------------------------

Local keymap for minibuffer input with completion, for exact
match.

key             binding
---             -------

C-g             abort-recursive-edit
TAB             minibuffer-complete
C-j             minibuffer-complete-and-exit
RET             minibuffer-complete-and-exit
ESC             Prefix Command
SPC             minibuffer-complete-word
?               minibuffer-completion-help
<C-tab>         file-cache-minibuffer-complete
<C-tab>         file-cache-minibuffer-complete
<C-tab>         file-cache-minibuffer-complete
<down>          next-history-element
...

> From: Drew Adams Sent: Thursday, March 20, 2008 9:47 PM
> Shouldn't substitute-command-keys remove duplicates?
>  
> If you explicitly bind a key to the same command in both a
> keymap km
> and its parent pkm, and then you call this, the binding is
> written
> twice:
>  
> (define-key km  "a" 'foo)
> (define-key pkm "a" 'foo)
>  
> (substitute-command-keys "\\{km\\}")
>  
> key             binding
> ---             -------
>  
> ...
> a  foo
> a  foo
> ...
>  
> In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
>  of 2008-01-30 on PRETEST
> Windowing system distributor `Microsoft Corp.', version
> 5.1.2600
> configured using `configure --with-gcc (3.4) --cflags
> -Ic:/gnuwin32/include'





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: shouldn't substitute-command-keys remove duplicates?
  2008-03-21  4:59 ` Drew Adams
@ 2008-03-21 17:21   ` Stefan Monnier
  2008-03-22  1:29     ` Juri Linkov
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2008-03-21 17:21 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-pretest-bug

Yes, duplicates should be removed, just as in menus.

> As an example, filecache.el does this (via ;;;###autoload):
> (define-key minibuffer-local-completion-map
>             [C-tab] 'file-cache-minibuffer-complete)
> (define-key minibuffer-local-map
>             [C-tab] 'file-cache-minibuffer-complete)
> (define-key minibuffer-local-must-match-map
>             [C-tab] 'file-cache-minibuffer-complete)

In the mean time, could someone fix filecache.el so as not to put those
redundant bindings?  Thanks,


        Stefan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: shouldn't substitute-command-keys remove duplicates?
  2008-03-21 17:21   ` Stefan Monnier
@ 2008-03-22  1:29     ` Juri Linkov
  2008-03-22  2:38       ` Drew Adams
  2008-03-22 17:07       ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Juri Linkov @ 2008-03-22  1:29 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-pretest-bug, Drew Adams

> Yes, duplicates should be removed, just as in menus.
>
>> As an example, filecache.el does this (via ;;;###autoload):
>> (define-key minibuffer-local-completion-map
>>             [C-tab] 'file-cache-minibuffer-complete)
>> (define-key minibuffer-local-map
>>             [C-tab] 'file-cache-minibuffer-complete)
>> (define-key minibuffer-local-must-match-map
>>             [C-tab] 'file-cache-minibuffer-complete)
>
> In the mean time, could someone fix filecache.el so as not to put those
> redundant bindings?  Thanks,

I see this was already fixed on 2007-11-21 on the 22 branch and on the
trunk.  The only small inessential fix is necessary is the following one
(since `map' is locally bound to `minibuffer-local-map').  I suggest Drew to
use the latest Emacs source code before reporting bugs to emacs-pretest-bug.

Index: lisp/bindings.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/bindings.el,v
retrieving revision 1.199
diff -c -r1.199 bindings.el
*** lisp/bindings.el	21 Mar 2008 23:59:04 -0000	1.199
--- lisp/bindings.el	22 Mar 2008 01:29:31 -0000
***************
*** 776,782 ****
    ;; indent-for-tab-command).  The alignment that indent-relative tries to
    ;; do doesn't make much sense here since the prompt messes it up.
    (define-key map "\t"    'self-insert-command)
!   (define-key minibuffer-local-map [C-tab] 'file-cache-minibuffer-complete))
  
  (define-key global-map "\C-u" 'universal-argument)
  (let ((i ?0))
--- 776,782 ----
    ;; indent-for-tab-command).  The alignment that indent-relative tries to
    ;; do doesn't make much sense here since the prompt messes it up.
    (define-key map "\t"    'self-insert-command)
!   (define-key map [C-tab] 'file-cache-minibuffer-complete))
  
  (define-key global-map "\C-u" 'universal-argument)
  (let ((i ?0))

-- 
Juri Linkov
http://www.jurta.org/emacs/




^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: shouldn't substitute-command-keys remove duplicates?
  2008-03-22  1:29     ` Juri Linkov
@ 2008-03-22  2:38       ` Drew Adams
  2008-03-23  2:30         ` Juri Linkov
  2008-03-22 17:07       ` Stefan Monnier
  1 sibling, 1 reply; 8+ messages in thread
From: Drew Adams @ 2008-03-22  2:38 UTC (permalink / raw)
  To: 'Juri Linkov', 'Stefan Monnier'; +Cc: emacs-pretest-bug

> I suggest Drew to use the latest Emacs source code before
> reporting bugs to emacs-pretest-bug.

I use M-x report-emacs-bug. That reports the relevant version - to
emacs-pretest-bug or bug-gnu-emacs or wherever Emacs developers decide.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: shouldn't substitute-command-keys remove duplicates?
  2008-03-22  1:29     ` Juri Linkov
  2008-03-22  2:38       ` Drew Adams
@ 2008-03-22 17:07       ` Stefan Monnier
  1 sibling, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2008-03-22 17:07 UTC (permalink / raw)
  To: Juri Linkov; +Cc: emacs-pretest-bug, Drew Adams

> I see this was already fixed on 2007-11-21 on the 22 branch and on the
> trunk.

Great.

> The only small inessential fix is necessary is the following one
> (since `map' is locally bound to `minibuffer-local-map').

Please install it,


        Stefan




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: shouldn't substitute-command-keys remove duplicates?
  2008-03-22  2:38       ` Drew Adams
@ 2008-03-23  2:30         ` Juri Linkov
  2008-03-23  5:59           ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Juri Linkov @ 2008-03-23  2:30 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-pretest-bug, 'Stefan Monnier'

>> I suggest Drew to use the latest Emacs source code before
>> reporting bugs to emacs-pretest-bug.
>
> I use M-x report-emacs-bug. That reports the relevant version - to
> emacs-pretest-bug or bug-gnu-emacs or wherever Emacs developers decide.

It is very strange.  In your original report the pretest version was 22.1.90:

    In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
     of 2008-01-30 on PRETEST

but in your followup message you reported file-cache duplication
that doesn't exist in this pretest version.  Did you get it from
another older version?

-- 
Juri Linkov
http://www.jurta.org/emacs/




^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: shouldn't substitute-command-keys remove duplicates?
  2008-03-23  2:30         ` Juri Linkov
@ 2008-03-23  5:59           ` Drew Adams
  0 siblings, 0 replies; 8+ messages in thread
From: Drew Adams @ 2008-03-23  5:59 UTC (permalink / raw)
  To: 'Juri Linkov'; +Cc: emacs-pretest-bug, 'Stefan Monnier'

> >> I suggest Drew to use the latest Emacs source code before
> >> reporting bugs to emacs-pretest-bug.
> >
> > I use M-x report-emacs-bug. That reports the relevant version - to
> > emacs-pretest-bug or bug-gnu-emacs or wherever Emacs 
> > developers decide.
> 
> It is very strange.  In your original report the pretest 
> version was 22.1.90:
> 
>     In GNU Emacs 22.1.90.1 (i386-mingw-nt5.1.2600)
>      of 2008-01-30 on PRETEST
> 
> but in your followup message you reported file-cache duplication
> that doesn't exist in this pretest version.  Did you get it from
> another older version?

Perhaps I did; dunno. My mistake if I did. I might have had two sessions open
and reported the bug from a different session where I saw it.

Checking now I see that the Emacs 22.1 release has the bug, but 22.1.90.1 of
2008-01-30 does not.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-03-23  5:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21  4:47 shouldn't substitute-command-keys remove duplicates? Drew Adams
2008-03-21  4:59 ` Drew Adams
2008-03-21 17:21   ` Stefan Monnier
2008-03-22  1:29     ` Juri Linkov
2008-03-22  2:38       ` Drew Adams
2008-03-23  2:30         ` Juri Linkov
2008-03-23  5:59           ` Drew Adams
2008-03-22 17:07       ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.