unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* eudc Directory Search duplicate menu problems
@ 2002-09-17  4:41 John Paul Wallington
  2002-09-18 15:48 ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: John Paul Wallington @ 2002-09-17  4:41 UTC (permalink / raw)


emacs -q --no-site-file

then
(require 'eudc)

or choosing Tools > Directory Search > Load Hotlist of Servers (which
is bound to `eudc-load-eudc')

creates two Tools > Directory Search menus.

Making this change avoids the problem, but doesn't address it:

Index: menu-bar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/menu-bar.el,v
retrieving revision 1.228
diff -u -r1.228 menu-bar.el
--- menu-bar.el	11 Sep 2002 21:56:50 -0000	1.228
+++ menu-bar.el	15 Sep 2002 07:50:44 -0000
@@ -989,7 +989,7 @@
 (define-key menu-bar-tools-menu [separator-net]
   '("--"))
 
-(define-key menu-bar-tools-menu [directory-search]
+(define-key menu-bar-tools-menu [directory\ search]
   '(menu-item "Directory Search" eudc-tools-menu
 	      :help "Query directory servers via LDAP, CCSO PH/QI or BBDB"))
 (define-key menu-bar-tools-menu [compose-mail]

I thought perhaps `easy-menu-intern' could be changed to replace the
spaces in its string argument with hypens before interning; that
avoided the duplicate Directory Search menu but created problems
for recentf.

Any ideas?

-- 
John Paul Wallington

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

* Re: eudc Directory Search duplicate menu problems
  2002-09-17  4:41 eudc Directory Search duplicate menu problems John Paul Wallington
@ 2002-09-18 15:48 ` Richard Stallman
  2002-09-19 15:27   ` John Paul Wallington
  2002-09-20  1:46   ` John Paul Wallington
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Stallman @ 2002-09-18 15:48 UTC (permalink / raw)
  Cc: emacs-devel

    I thought perhaps `easy-menu-intern' could be changed to replace the
    spaces in its string argument with hypens before interning; that
    avoided the duplicate Directory Search menu but created problems
    for recentf.

What exactly were the problems it created?  Was it for file names
with spaces in them?  What were the symptoms of the problem?
Perhaps we should change recentf not to use easymenu.


Does this change work right in general?  I am not sure.

*** easymenu.el.~1.54.~	Fri Sep  6 12:12:19 2002
--- easymenu.el	Wed Sep 18 10:29:11 2002
***************
*** 44,49 ****
--- 44,54 ----
  (defsubst easy-menu-intern (s)
    (if (stringp s) (intern (downcase s)) s))
  
+ (defsubst easy-menu-intern-for-prefix (s)
+   (if (stringp s) 
+       (intern (downcase (subst-char-in-string ?\  ?- s)))
+     s))
+ 
  ;;;###autoload
  (put 'easy-menu-define 'lisp-indent-function 'defun)
  ;;;###autoload
***************
*** 170,176 ****
  				     (symbol-function ,symbol)))
  			       ,symbol))))
      (mapcar (lambda (map)
! 	      (define-key map (vector 'menu-bar (easy-menu-intern (car menu)))
  		(cons 'menu-item
  		      (cons (car menu)
  			    (if (not (symbolp keymap))
--- 175,181 ----
  				     (symbol-function ,symbol)))
  			       ,symbol))))
      (mapcar (lambda (map)
! 	      (define-key map (vector 'menu-bar (easy-menu-intern-for-prefix (car menu)))
  		(cons 'menu-item
  		      (cons (car menu)
  			    (if (not (symbolp keymap))
***************
*** 574,581 ****
    submap)
  
  (defun easy-menu-get-map (map path &optional to-modify)
!   "Return a sparse keymap in which to add or remove an item.
  MAP and PATH are as defined in `easy-menu-add-item'.
  
  TO-MODIFY, if non-nil, is the name of the item the caller
  wants to modify in the map that we return.
--- 579,587 ----
    submap)
  
  (defun easy-menu-get-map (map path &optional to-modify)
!   "From MAP, follow submenu path PATH to get a menu several levels down.
  MAP and PATH are as defined in `easy-menu-add-item'.
+ If MAP is nil, use the current active maps and choose among them.
  
  TO-MODIFY, if non-nil, is the name of the item the caller
  wants to modify in the map that we return.
***************
*** 583,589 ****
    (setq map
  	(catch 'found
  	  (let* ((key (vconcat (unless map '(menu-bar))
! 			       (mapcar 'easy-menu-intern path)))
  		 (maps (mapcar (lambda (map)
  				 (setq map (lookup-key map key))
  				 (while (and (symbolp map) (keymapp map))
--- 589,595 ----
    (setq map
  	(catch 'found
  	  (let* ((key (vconcat (unless map '(menu-bar))
! 			       (mapcar 'easy-menu-intern-for-prefix path)))
  		 (maps (mapcar (lambda (map)
  				 (setq map (lookup-key map key))
  				 (while (and (symbolp map) (keymapp map))

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

* Re: eudc Directory Search duplicate menu problems
  2002-09-18 15:48 ` Richard Stallman
@ 2002-09-19 15:27   ` John Paul Wallington
  2002-09-20  3:44     ` Richard Stallman
  2002-09-20  1:46   ` John Paul Wallington
  1 sibling, 1 reply; 5+ messages in thread
From: John Paul Wallington @ 2002-09-19 15:27 UTC (permalink / raw)
  Cc: emacs-devel

>     I thought perhaps `easy-menu-intern' could be changed to replace the
>     spaces in its string argument with hypens before interning; that
>     avoided the duplicate Directory Search menu but created problems
>     for recentf.
> 
> What exactly were the problems it created?  Was it for file names
> with spaces in them?  What were the symptoms of the problem?
> Perhaps we should change recentf not to use easymenu.

I tried changing `easy-menu-intern' to always replace spaces with
hypens.  This clobbered the recentf menu completely; it wasn't there.

> Does this change work right in general?  I am not sure.
> 
> *** easymenu.el.~1.54.~	Fri Sep  6 12:12:19 2002
> --- easymenu.el	Wed Sep 18 10:29:11 2002

I don't know whether that change is correct in general, but it
doesn't appear to address the duplicate Tools > Directory Search menus.

-- 
John Paul Wallington

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

* Re: eudc Directory Search duplicate menu problems
  2002-09-18 15:48 ` Richard Stallman
  2002-09-19 15:27   ` John Paul Wallington
@ 2002-09-20  1:46   ` John Paul Wallington
  1 sibling, 0 replies; 5+ messages in thread
From: John Paul Wallington @ 2002-09-20  1:46 UTC (permalink / raw)
  Cc: emacs-devel

>     I thought perhaps `easy-menu-intern' could be changed to replace the
>     spaces in its string argument with hypens before interning; that
>     avoided the duplicate Directory Search menu but created problems
>     for recentf.
> 
> What exactly were the problems it created?  Was it for file names
> with spaces in them?  What were the symptoms of the problem?
> Perhaps we should change recentf not to use easymenu.

There is a simple fix for the duplicate Directory Search menu problem.
If it isn't generally beneficial for `easy-menu-intern' to hypenate
spaces in its argument, apologies for the noise!

-- 
John Paul Wallington

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

* Re: eudc Directory Search duplicate menu problems
  2002-09-19 15:27   ` John Paul Wallington
@ 2002-09-20  3:44     ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-09-20  3:44 UTC (permalink / raw)
  Cc: emacs-devel

    > Does this change work right in general?  I am not sure.
    > 
    > *** easymenu.el.~1.54.~	Fri Sep  6 12:12:19 2002
    > --- easymenu.el	Wed Sep 18 10:29:11 2002

    I don't know whether that change is correct in general, but it
    doesn't appear to address the duplicate Tools > Directory Search menus.

In that case I give up trying to change easymenu.el to DTRT in all
cases.  I think the right fix may be to make the patch you suggested
in easymenu, and change recentf not to use easymenu.

Would someone like to change recentf?

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

end of thread, other threads:[~2002-09-20  3:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-17  4:41 eudc Directory Search duplicate menu problems John Paul Wallington
2002-09-18 15:48 ` Richard Stallman
2002-09-19 15:27   ` John Paul Wallington
2002-09-20  3:44     ` Richard Stallman
2002-09-20  1:46   ` John Paul Wallington

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