all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Bostjan Vilfan <bjvilfan@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs Help <help-gnu-emacs@gnu.org>
Subject: Re: how to redraw the tool bar
Date: Sat, 27 Dec 2014 23:08:38 +0100	[thread overview]
Message-ID: <CAAm34zrwyZZBHrepzTkUa3Cy+JN6oNf-YS7YBTx=T6DOFA+6Fg@mail.gmail.com> (raw)
In-Reply-To: <jwvzja9j1z5.fsf-monnier+gmane.emacs.help@gnu.org>

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	other threads:[~2014-12-27 22:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-25 14:48 how to redraw the tool bar Bostjan Vilfan
2014-12-26 19:37 ` Michael Heerdegen
2014-12-27  1:50 ` Stefan Monnier
2014-12-27 22:08   ` Bostjan Vilfan [this message]
2014-12-31 22:13     ` Michael Heerdegen
2015-01-01 15:35       ` bug#19480: (no subject) Eli Zaretskii
2015-01-01 20:37         ` Michael Heerdegen
2015-01-01 20:56           ` Eli Zaretskii
2022-05-03 16:58         ` bug#19480: Tool-bar modifications not reflected on display Lars Ingebrigtsen

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='CAAm34zrwyZZBHrepzTkUa3Cy+JN6oNf-YS7YBTx=T6DOFA+6Fg@mail.gmail.com' \
    --to=bjvilfan@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.