|
From: | Kevin Rodgers |
Subject: | Re: making change of tool-bar entry persistent |
Date: | Tue, 25 May 2010 00:23:57 -0600 |
User-agent: | Thunderbird 2.0.0.24 (Macintosh/20100228) |
Stefan Vollmar wrote:
Hallo, I want to re-define what happends when an exising toolbar icon is pressed. In the Emacs documentation I found an example similar to this:(define-key global-map [tool-bar new-file]'(menu-item "New Buffer" my-new-buffer :image (image :type xpm :file "new.xpm")))
> Executing this code in Emacs 23.2 this will indeed show the desired > effect - but only for about 2 seconds: the tool-bar is then > automatically redrawn and behaves as before. How can I modify an > existing toolbar so that the change is persistent? -- Variable: tool-bar-map By default, the global map binds `[tool-bar]' as follows: (global-set-key [tool-bar] '(menu-item "tool bar" ignore :filter (lambda (ignore) tool-bar-map))) Thus the tool bar map is derived dynamically from the value of variable `tool-bar-map' and you should normally adjust the default (global) tool bar by changing that map. 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. -- Kevin Rodgers Denver, Colorado, USA
[Prev in Thread] | Current Thread | [Next in Thread] |