From: Bill Wohler <wohler@newt.com>
Subject: Re: tool-bar-setup overwrites local tool-bar-map
Date: Thu, 20 Apr 2006 17:44:19 -0700 [thread overview]
Message-ID: <423.1145580259__36484.6037854024$1146290672$gmane$org@olgas.newt.com> (raw)
In-Reply-To: <31860.1145577819@olgas.newt.com>
Bill Wohler <wohler@olgas.newt.com> 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 <wohler@newt.com> 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.
next parent reply other threads:[~2006-04-21 0:44 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <31860.1145577819@olgas.newt.com>
2006-04-21 0:44 ` Bill Wohler [this message]
[not found] ` <423.1145580259@olgas.newt.com>
2006-04-30 3:04 ` tool-bar-setup overwrites local tool-bar-map Richard Stallman
2006-04-30 18:23 ` Bill Wohler
2006-05-01 4:19 ` Richard Stallman
2006-05-01 6:16 ` Bill Wohler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='423.1145580259__36484.6037854024$1146290672$gmane$org@olgas.newt.com' \
--to=wohler@newt.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.