emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enhancement/wish


From: Jan D.
Subject: Re: enhancement/wish
Date: Wed, 29 Oct 2008 08:26:30 +0100
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Bernhard Koenig skrev:
OK, I see that there is a command tool-bar-local-item but it's not
listed in http://www.gnu.org/software/emacs/elisp/html_node/Tool-Bar.html

I guess the syopsis is
tool-bar-local-item icon def key map &rest props
but what is "map" in the case of "LaTeX-mode-hook"? Or in case of the info mode?


From what I see, LaTeX-mode-hook does not set its own tool bar map. So you should not have to do anything. It should work. Are you sure recentf-mode is on when you switch to latex-mode?

As for info mode, just put your code in a defun:

(defun my-tool-bar-addition ()
  ;; the code you have goes here
)

(add-hook 'Info-mode-hook 'my-tool-bar-addition)


As info mode makes tool-bar-map a buffer local variable, your old code continues to work. Instead of putting stuff into the global tool-bar-mode it now adds stuff to info-modes tool bar map. No need to mess about with tool-bar-local-item.

For other modes, you have to find their hook variable.
AFAIK, there is no way to add an item to "all tool bars", so it automatically gets added to new tool bars that modes may install. Maybe we need such a command.

        Jan D.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]