emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eudc Directory Search duplicate menu problems


From: Richard Stallman
Subject: Re: eudc Directory Search duplicate menu problems
Date: Wed, 18 Sep 2002 11:48:36 -0400

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]