help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to redraw the tool bar


From: Bostjan Vilfan
Subject: Re: how to redraw the tool bar
Date: Sat, 27 Dec 2014 23:08:38 +0100

Hello,
Thanks for the replies. Unfortunately, neither of the two suggestions
works. Therefore, I'm going to include some more detail, and perhaps
somebody can point to what I am doing wrong

The problem arose when I tried to build a toolbar for tex-mode. So I
included the following line in my init file:

(add-hook 'tex-mode-hook 'bv-tex-mode)

where bv-tex-mode is the following function:

(defun bv-tex-mode ()
   "hook for building TeX tool bar"
   (interactive nil)
;; copy global tool-bar-map using copy-sequence
   (let ((temp (copy-sequence tool-bar-map)))
     (make-local-variable 'tool-bar-map)
     (setq tool-bar-map temp)
   )
   (define-key global-map [tool-bar bvdotex] 'tex-file)
   (tool-bar-local-item  "tex" 'tex-file 'bvdotex tool-bar-map
                    :help "Process file with default tex command")
   (define-key global-map [tool-bar bvpdfview] 'bv-pdf-view)
   (tool-bar-local-item  "pdf" 'bv-pdf-view 'bvpdfview tool-bar-map
 :help "view pdf file")
   (redraw-frame)
)

This version uses redraw-frame; but the result with force-mode-line-update
was the same. In effect, when I load a tex file I have to use several
clicks before the new icons appear.

Regards,
bostjanv

On Sat, Dec 27, 2014 at 2:50 AM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:

> > I have the following problem with emacs: I like to employ tool bars in my
> > work, and I add elements to them with tool-bar-add-item-from-menu or
> > tool-bar-local-item. However, I notice that most of the time it takes
> some
> > effort (multiple clicks) to make the changed tool bar appear. Is there
> any
> > way I can force a redraw of the toolbar? Thanks in advance for an answer.
>
> I think force-mode-line-update should do the trick,
>
>
>         Stefan
>
>
>


reply via email to

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