emacs-pretest-bug
[Top][All Lists]
Advanced

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

tool-bar-setup overwrites local tool-bar-map


From: Bill Wohler
Subject: tool-bar-setup overwrites local tool-bar-map
Date: Thu, 20 Apr 2006 17:03:39 -0700

  emacs22 -Q
  M-x info
  M-x tool-bar-mode

Note how Preferences and Help icons are present.

  C-x b *scratch* RET

Note how Preferences and Help icons are absent.

To see what should have happened:

  emacs22 -Q
  M-x tool-bar-mode

Note how Preferences and Help icons are present.

  M-x info

Note how Preferences and Help icons are absent.

This is particularly bad if you fire up mh-rmail before tool-bar-mode
since you get two pairs of Help and Preferences. 

I see that tool-bar-add-item-from-menu passes (default-value
'tool-bar-map) to tool-bar-local-item-from-menu while tool-bar-add-item
does not. Coincidentally, it is the tool-bar-add-item calls in
tool-bar-setup which are a problem (Preferences and Help). Changing
tool-bar-add-item to match tool-bar-item-from-menu fixes the problem.

Does anyone know why tool-bar-add-item-from-menu got the (default-value
'tool-bar-map) and tool-bar-add-item did not? If not, may I check in
this patch?


Index: tool-bar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/tool-bar.el,v
retrieving revision 1.5
diff -u -u -r1.5 tool-bar.el
--- tool-bar.el 6 Feb 2006 14:33:35 -0000       1.5
+++ tool-bar.el 20 Apr 2006 23:54:48 -0000
@@ -105,7 +105,7 @@
 
 Use this function only to make bindings in the global value of `tool-bar-map'.
 To define items in any other map, use `tool-bar-local-item'."
-  (apply 'tool-bar-local-item icon def key tool-bar-map props))
+  (apply 'tool-bar-local-item icon def key (default-value 'tool-bar-map) 
props))
 
 ;;;###autoload
 (defun tool-bar-local-item (icon def key map &rest props)


-- 
Bill Wohler <address@hidden>  http://www.newt.com/wohler/  GnuPG ID:610BD9AD
Maintainer of comp.mail.mh FAQ and MH-E. Vote Libertarian!
If you're passed on the right, you're in the wrong lane.




reply via email to

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