From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel Subject: Re: tool bar icons not updated according to :active condition Date: Sun, 26 Feb 2006 13:15:45 +0100 Message-ID: References: <873bi8ok5h.fsf@stupidchicken.com> Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1140990308 4440 80.91.229.2 (26 Feb 2006 21:45:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Feb 2006 21:45:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 26 22:45:01 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FDThI-0006zQ-QB for ged-emacs-devel@m.gmane.org; Sun, 26 Feb 2006 22:44:57 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDThM-0007wC-2n for ged-emacs-devel@m.gmane.org; Sun, 26 Feb 2006 16:45:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FDM2W-0006l9-J6 for emacs-devel@gnu.org; Sun, 26 Feb 2006 08:34:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FDM2D-0006hY-QZ for emacs-devel@gnu.org; Sun, 26 Feb 2006 08:34:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FDM26-0006h1-Q0 for emacs-devel@gnu.org; Sun, 26 Feb 2006 08:33:56 -0500 Original-Received: from [134.60.1.1] (helo=mail.uni-ulm.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FDM2a-0006UY-HZ for emacs-devel@gnu.org; Sun, 26 Feb 2006 08:34:25 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by mail.uni-ulm.de (8.13.4/8.13.4) with ESMTP id k1QDXh0A029091; Sun, 26 Feb 2006 14:33:43 +0100 (MET) Original-Received: from viandante.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.123]) by bridgekeeper.physik.uni-ulm.de (Postfix) with SMTP id 130CE11028; Sun, 26 Feb 2006 14:33:41 +0100 (CET) Original-Received: (nullmailer pid 10999 invoked by uid 170); Sun, 26 Feb 2006 12:15:46 -0000 Original-To: Chong Yidong User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-DCC-servers-Metrics: gemini 1049; Body=2 Fuz1=2 Fuz2=2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:50993 Archived-At: On Sat, Feb 25 2006, Reiner Steib wrote: > On Fri, Feb 24 2006, Chong Yidong wrote: [...] >>> But after moving up/down in the group buffer (C-p/C-n), the icon is >>> not updated (enabled/disabled) when changing from a group to a topic >>> line and vice versa. >>> >>> After `C-l' (or after `redraw-frame' [3]), the correct icon is >>> displayed. A workaround could be to redraw the frame after every >>> point-motion (is there a after-point-motion-hook?). >> >> You could use post-command-hook. > > The following code updates the frame and the tool bar, but I think it > is too expensive (and maybe irritating for the user) because it > affects the whole frame, not only the tool bar. The following gives better results (but of course it is still a workaround, not a fix). --8<---------------cut here---------------start------------->8--- (defvar gnus-group-redraw-line-number nil "Internal variable.") (defun gnus-group-redraw-check () "Check if we need to redraw the frame." ;; Work around for ;; http://www.google.com/groups?as_umsgid=v9u0an3hti.fsf@marauder.physik.uni-ulm.de (when (and (not (featurep 'xemacs)) (boundp 'tool-bar-mode) tool-bar-mode) (let ((no (line-number-at-pos))) (unless (eq gnus-group-redraw-line-number no) (setq gnus-group-redraw-line-number no) ;; (run-with-idle-timer 1 nil 'menu-bar-update-buffers t) (run-with-idle-timer 1 nil 'redraw-frame (selected-frame)))))) (with-current-buffer gnus-group-buffer (add-to-list (make-local-variable 'post-command-hook) 'gnus-group-redraw-check)) --8<---------------cut here---------------end--------------->8--- > Is it possible to limit redrawing to the tool bar? Is there an analog of `menu-bar-update-buffers' or `menu-bar-update-buffers-1' for the tool bar? BTW, maybe these functions should have a doc string. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/