Re: tool-bar-setup overwrites local tool-bar-map

2006-04-30 Thread Bill Wohler
Richard Stallman [EMAIL PROTECTED] wrote:

  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.
 
 In what sense is that what should have happened?  I do not follow.

You get the tool bar as the info package had intended.

 Shouldn't the Preferences and Help icons always be present?

Arguably yes, but their function is context-dependent. For example, the
MH-E package defines the actions as mh-tool-bar-customize and
mh-tool-bar-folder-help or mh-tool-bar-letter-help where the default
actions are customize and help.

With the current tool-bar code, the behavior is inconsistent.

If one runs tool-bar-mode first, and then MH-E, one sees the one pair of
Preferences/Help buttons (the ones defined by MH-E). If vice-versa, one
sees *two* pairs of Preferences/Help buttons (the ones defined by MH-E
plus the ones defined by tool-bar).

Similarly, if one runs tool-bar-mode first, and then info, one does not
see the pair of Preferences/Help buttons since the info package does not
define them. If vice-versa, one sees the pair of Preferences/Help
buttons defined by tool-bar.

Does that help clear things up?

 What are you asking us to do?

My patch makes the tool-bar's behavior consistent. It prevents the
default tool bar from interfering with the mode's tool bar if
tool-bar-mode is run after the mode has been initialized. I just wanted
a review and a Please check it in before checking it in. Perhaps Nick
Roberts? Here it is again.

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 -   1.5
+++ tool-bar.el 30 Apr 2006 18:21:10 -
@@ -267,14 +267,16 @@
   ;;(tool-bar-add-item-from-menu 'compose-mail mail/compose)
 
   (tool-bar-add-item-from-menu 'print-buffer print)
-  (tool-bar-add-item preferences 'customize 'customize
-:help Edit preferences (customize))
+  (tool-bar-local-item preferences 'customize 'customize
+   (default-value 'tool-bar-map)
+   :help Edit preferences (customize))
 
-  (tool-bar-add-item help (lambda ()
- (interactive)
- (popup-menu menu-bar-help-menu))
-'help
-:help Pop up the Help menu)
+  (tool-bar-local-item help (lambda ()
+(interactive)
+(popup-menu menu-bar-help-menu))
+   'help
+   (default-value 'tool-bar-map)
+   :help Pop up the Help menu)
   )
 
 (provide 'tool-bar)

-- 
Bill Wohler [EMAIL PROTECTED]  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.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: tool-bar-setup overwrites local tool-bar-map

2006-04-29 Thread Richard Stallman
 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.

In what sense is that what should have happened?  I do not follow.

Shouldn't the Preferences and Help icons always be present?

No, I may not ;-). It breaks the idiom from the tool-bar-add-item
documentation, namely:

  (defvar foo-tool-bar-map
(let ((tool-bar-map (make-sparse-keymap)))
  (tool-bar-add-item ...)
  ...
  tool-bar-map))

It also did some mean and nasty things to the MH-E toolbar. The
following patch (to tool-bar-setup) seems to be working a little better.

What are you asking us to do?


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: tool-bar-setup overwrites local tool-bar-map

2006-04-23 Thread Bill Wohler
Richard Stallman [EMAIL PROTECTED] writes:

 You can reproduce with emacs22 -Q --xrm Emacs.toolBar:0.

 Is this a corner-case we wish to fix? I think so. 

 We should fix every case, except when the fix is so hard or risky
 that we decide to let it go.

My (last) patch still seems to be working well for me. Is anyone else
observing this problem that can verify the patch? If not, does anyone
object if I try checking it in so we can see if it causes problems for
others? (Does anyone on this list use tool bars? ;-)

-- 
Bill Wohler [EMAIL PROTECTED]  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.



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: tool-bar-setup overwrites local tool-bar-map

2006-04-21 Thread Stephen Berman
On Thu, 20 Apr 2006 18:01:27 -0700 Bill Wohler [EMAIL PROTECTED] wrote:

 Nick Roberts [EMAIL PROTECTED] wrote:

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

Note how Preferences and Help icons are present.
 
 This doesn't make sense to me. If you start with -Q then doesn't
 tool-bar-mode tool-bar-mode turn the tool bar *off*?

 Nick, you bring up a good point. I have Emacs.toolBar: 0 in my
 .Xresources file to avoid the frame resizing that happens if you just
 customize tool-bar-mode to nil. If I set Emacs.toolBar: 1, then I
 don't see the problem.

 You can reproduce with emacs22 -Q --xrm Emacs.toolBar:0.

I can also reproduce it with emacs -D -Q (I don't have the tool bar
turned off in my .Xresources).

Steve Berman



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: tool-bar-setup overwrites local tool-bar-map

2006-04-21 Thread Richard Stallman
You can reproduce with emacs22 -Q --xrm Emacs.toolBar:0.

Is this a corner-case we wish to fix? I think so. 

We should fix every case, except when the fix is so hard or risky
that we decide to let it go.



___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug


Re: tool-bar-setup overwrites local tool-bar-map

2006-04-20 Thread Bill Wohler
Nick Roberts [EMAIL PROTECTED] wrote:

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

Note how Preferences and Help icons are present.
 
 This doesn't make sense to me. If you start with -Q then doesn't
 tool-bar-mode tool-bar-mode turn the tool bar *off*?

Nick, you bring up a good point. I have Emacs.toolBar: 0 in my
.Xresources file to avoid the frame resizing that happens if you just
customize tool-bar-mode to nil. If I set Emacs.toolBar: 1, then I
don't see the problem.

You can reproduce with emacs22 -Q --xrm Emacs.toolBar:0.

Is this a corner-case we wish to fix? I think so. 

-- 
Bill Wohler [EMAIL PROTECTED]  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.


___
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug