From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bill Wohler Newsgroups: gmane.emacs.devel Subject: Re: tool-bar-setup overwrites local tool-bar-map Date: Thu, 20 Apr 2006 17:44:19 -0700 Organization: Newt Software Message-ID: <423.1145580259__36484.6037854024$1146290672$gmane$org@olgas.newt.com> References: <31860.1145577819@olgas.newt.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1146290672 7575 80.91.229.2 (29 Apr 2006 06:04:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 29 Apr 2006 06:04:32 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 29 08:04:28 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FZiZ5-0003DW-Eg for ged-emacs-devel@m.gmane.org; Sat, 29 Apr 2006 08:04:23 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZiZ5-00084J-3M for ged-emacs-devel@m.gmane.org; Sat, 29 Apr 2006 02:04:23 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZiYr-00082o-48 for emacs-devel@gnu.org; Sat, 29 Apr 2006 02:04:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZiYm-000827-LG for emacs-devel@gnu.org; Sat, 29 Apr 2006 02:04:08 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZiYm-000824-Iy for emacs-devel@gnu.org; Sat, 29 Apr 2006 02:04:04 -0400 Original-Received: from [207.69.195.67] (helo=pop-tawny.atl.sa.earthlink.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FZic5-0002ID-1k for emacs-devel@gnu.org; Sat, 29 Apr 2006 02:07:29 -0400 Original-Received: from h-64-105-34-169.snvacaid.dynamic.covad.net ([64.105.34.169] helo=olgas.newt.com) by pop-tawny.atl.sa.earthlink.net with esmtp (Exim 3.36 #10) id 1FZiYl-0005v4-00 for emacs-devel@gnu.org; Sat, 29 Apr 2006 02:04:03 -0400 Original-Received: by olgas.newt.com (Postfix, from userid 1000) id 37EF516FB7; Fri, 28 Apr 2006 23:04:03 -0700 (PDT) Original-Received: from olgas.newt.com (localhost [127.0.0.1]) by olgas.newt.com (Postfix) with ESMTP id 3459A16FA8 for ; Fri, 28 Apr 2006 23:04:03 -0700 (PDT) X-MHE-Checksum: 81f30e3609fd268a859b11871ca29751 Original-To: emacs-pretest-bug@gnu.org Mail-Followup-To: emacs-pretest-bug@gnu.org In-reply-to: <31860.1145577819@olgas.newt.com> Comments: In-reply-to Bill Wohler message dated "Thu, 20 Apr 2006 17:03:39 -0700." X-Mailer: MH-E 7.93+cvs; nmh 1.1; GNU Emacs 22.0.50 X-Image-URL: http://www.newt.com/wohler/images/bill-diving.png Resent-To: emacs-devel@gnu.org Resent-Date: Fri, 28 Apr 2006 23:04:03 -0700 Resent-Message-ID: <9145.1146290643@olgas.newt.com> Resent-From: Bill Wohler X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53584 Archived-At: Bill Wohler wrote: > 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? 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. 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 21 Apr 2006 00:25:35 -0000 @@ -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 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.