[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: replace default tool-bar by home-grown tool-bar
From: |
Nick Roberts |
Subject: |
Re: replace default tool-bar by home-grown tool-bar |
Date: |
Wed, 19 Dec 2007 10:15:23 +1300 |
> i am meditating over chapter 22.17 from the Emacs Lisp-manual for a
> while and couldn't really get a hint on how to have my own tool-bar. I
> understand how to define a keymap that describes the tool-bar but how do
> i tell emacs to use my keymap? Maybe it is too obvious, but i can't
> figure it out...
22.17.6 says (for edition 2.9, GNU Emacs version 23.0.50 but that
for 22.1 is probably the same) :
Major modes may replace
the global bar completely by making `tool-bar-map' buffer-local
and set to a keymap containing only the desired items. Info mode
provides an example.
Looking at info.el:
(set (make-local-variable 'tool-bar-map) info-tool-bar-map)
and info-tool-bar-map is created using tool-bar-local-item-from-menu
Is that not clear?
> I didn't find any hooks for the tool-bar. While they are used so
> frequently i wonder why there is none in this case. Wouldn't it be a
> good idea to have one that defines all the buttons in the tool-bar?
> If you can point me to a very simple example that would be nice.
gud.el provides another example.
--
Nick http://www.inet.net.nz/~nickrob