unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* minibuffer and current-local-map
@ 2007-11-07 16:30 Stephen Berman
  2007-11-08  4:42 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Berman @ 2007-11-07 16:30 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 2649 bytes --]

The value returned by current-local-map for the minibuffer seems to be
wrong (both in the trunk and in Emacs 22.1), containing partial
reduplication:

(keymap
 (C-tab . file-cache-minibuffer-complete)
 (10 . minibuffer-complete-and-exit)
 (13 . minibuffer-complete-and-exit)
 keymap
 (menu-bar keymap
	   (minibuf "Minibuf" keymap
		    (tab menu-item "Complete" minibuffer-complete
			 ([9]
			  . "  (TAB)")
			 :help "Complete as far as possible")
		    (space menu-item "Complete Word" minibuffer-complete-word
			   ([32]
			    . "  (SPC)")
			   :help "Complete at most one word")
		    (63 menu-item "List Completions" minibuffer-completion-help
			([63]
			 . "  (?)")
			:help "Display all possible completions")
		    "Minibuf" keymap
		    (return menu-item "Enter" exit-minibuffer
			    (nil)
			    :help "Terminate input and exit minibuffer")
		    (quit menu-item "Quit" keyboard-escape-quit
			  ([134217755 27]
			   . "  (M-ESC ESC)")
			  :help "Abort input and exit minibuffer")
		    "Minibuf")
	   keymap
	   (minibuf "Minibuf" keymap
		    (return menu-item "Enter" exit-minibuffer
			    (nil)
			    :help "Terminate input and exit minibuffer")
		    (quit menu-item "Quit" keyboard-escape-quit
			  ([134217755 27]
			   . "  (M-ESC ESC)")
			  :help "Abort input and exit minibuffer")
		    "Minibuf"))
 (27 keymap
     (118 . switch-to-completions)
     keymap
     (114 . previous-matching-history-element)
     (115 . next-matching-history-element)
     (112 . previous-history-element)
     (110 . next-history-element))
 (prior . switch-to-completions)
 (C-tab . file-cache-minibuffer-complete)
 (63 . minibuffer-completion-help)
 (32 . minibuffer-complete-word)
 (9 . minibuffer-complete)
 keymap
 (menu-bar keymap
	   (minibuf "Minibuf" keymap
		    (return menu-item "Enter" exit-minibuffer
			    (nil)
			    :help "Terminate input and exit minibuffer")
		    (quit menu-item "Quit" keyboard-escape-quit
			  ([134217755 27]
			   . "  (M-ESC ESC)")
			  :help "Abort input and exit minibuffer")
		    "Minibuf"))
 (C-tab . file-cache-minibuffer-complete)
 (9 . self-insert-command)
 (up . previous-history-element)
 (prior . previous-history-element)
 (down . next-history-element)
 (next . next-history-element)
 (27 keymap
     (114 . previous-matching-history-element)
     (115 . next-matching-history-element)
     (112 . previous-history-element)
     (110 . next-history-element))
 (10 . exit-minibuffer)
 (13 . exit-minibuffer)
 (7 . abort-recursive-edit))

As a result of this, typing <C-down-mouse-3> in the minibuffer pops up a
confusing context menu, see the attached screen shots.

Steve Berman


[-- Attachment #2: minibuf-menu1 --]
[-- Type: image/png, Size: 44545 bytes --]

[-- Attachment #3: minibuf-menu2 --]
[-- Type: image/png, Size: 33873 bytes --]

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: minibuffer and current-local-map
@ 2008-01-06 19:36 Glenn Morris
  2008-01-07 11:31 ` Richard Stallman
  0 siblings, 1 reply; 10+ messages in thread
From: Glenn Morris @ 2008-01-06 19:36 UTC (permalink / raw)
  To: Richard Stallman; +Cc: Stephen.Berman, emacs-devel


I no longer have the original message to reply to. I'm replying to:

http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg00602.html

  From:   Richard Stallman
  Subject:        Re: minibuffer and current-local-map
  Date:           Fri, 09 Nov 2007 17:00:03 -0500

The issue is:

emacs -Q
M-x
C-mouse-3 in the minibuffer brings up a menu with two "Minibuff" entries.

rms said:

  The solution, I think, is to fix the menu code to avoid showing
  duplicates in such a case.


Here is a simple patch that just takes the first of any duplicate
(same name) menus.


*** mouse.el.~1.315.2.4.~	2007-12-06 20:27:17.000000000 -0800
--- mouse.el	2008-01-06 11:11:51.000000000 -0800
***************
*** 173,183 ****
  	 ;; default to the edit menu.
  	 (newmap (if ancestor
  		     (make-sparse-keymap (concat mode-name " Mode"))
! 		   menu-bar-edit-menu)))
      (if ancestor
  	;; Make our menu inherit from the desired keymap which we want
  	;; to display as the menu now.
! 	(set-keymap-parent newmap ancestor))
      (popup-menu newmap event prefix)))
  
  
--- 173,190 ----
  	 ;; default to the edit menu.
  	 (newmap (if ancestor
  		     (make-sparse-keymap (concat mode-name " Mode"))
! 		   menu-bar-edit-menu))
!          uniq)
      (if ancestor
  	;; Make our menu inherit from the desired keymap which we want
  	;; to display as the menu now.
! 	(set-keymap-parent newmap
!                            (progn
!                              (dolist (e ancestor)
!                                (unless (and (listp e)
!                                             (assoc (car e) uniq))
!                                  (setq uniq (append uniq (list e)))))
!                              uniq)))
      (popup-menu newmap event prefix)))

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

end of thread, other threads:[~2008-01-07 12:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-07 16:30 minibuffer and current-local-map Stephen Berman
2007-11-08  4:42 ` Richard Stallman
2007-11-08  7:20   ` Stephen Berman
2007-11-08 23:37     ` Richard Stallman
2007-11-09 22:00       ` Richard Stallman
2007-11-30 16:42         ` Jason Rumney
2007-11-30 23:36           ` Richard Stallman
  -- strict thread matches above, loose matches on Subject: below --
2008-01-06 19:36 Glenn Morris
2008-01-07 11:31 ` Richard Stallman
2008-01-07 12:43   ` Stephen Berman

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).