unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: eudc Directory Search duplicate menu problems
Date: Wed, 18 Sep 2002 11:48:36 -0400	[thread overview]
Message-ID: <E17rh48-0000d3-00@fencepost.gnu.org> (raw)
In-Reply-To: <E17rAAv-00030d-00@bundalo.shootybangbang.com> (message from John Paul Wallington on Tue, 17 Sep 2002 05:41:25 +0100)

    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	other threads:[~2002-09-18 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-17  4:41 eudc Directory Search duplicate menu problems John Paul Wallington
2002-09-18 15:48 ` Richard Stallman [this message]
2002-09-19 15:27   ` John Paul Wallington
2002-09-20  3:44     ` Richard Stallman
2002-09-20  1:46   ` John Paul Wallington

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=E17rh48-0000d3-00@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).