From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66226 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: Problem running gnus when image is not already loaded Date: Sat, 02 Feb 2008 14:27:06 +0100 Message-ID: References: <20080202.121924.157909693.hanche@math.ntnu.no> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201958975 12980 80.91.229.12 (2 Feb 2008 13:29:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 2 Feb 2008 13:29:35 +0000 (UTC) Cc: , To: Harald Hanche-Olsen Original-X-From: ding-owner+M14717@lists.math.uh.edu Sat Feb 02 14:29:55 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1JLIRP-0004gI-6I for ding-account@gmane.org; Sat, 02 Feb 2008 14:29:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1JLIPX-0007po-0O; Sat, 02 Feb 2008 07:27:59 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JLIPU-0007pU-W8 for ding@lists.math.uh.edu; Sat, 02 Feb 2008 07:27:57 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JLIPM-0003Gk-D6 for ding@lists.math.uh.edu; Sat, 02 Feb 2008 07:27:56 -0600 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JLIPP-0001tT-00; Sat, 02 Feb 2008 14:27:51 +0100 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by mail.uni-ulm.de (8.14.2/8.14.2) with ESMTP id m12DRjn8028212; Sat, 2 Feb 2008 14:27:46 +0100 (MET) Original-Received: from localhost (bridgekeeper.physik.uni-ulm.de [134.60.41.37]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 0DFAE12EDE; Sat, 2 Feb 2008 14:27:45 +0100 (CET) X-Face: .*T0'iU(sujq_j9\J>-d4fg;N/1++U#U$_5ii6k.=|"-n'?5O:Hyz&wi'-!I~,}7~GgT=0S /&-R5sbkNy5+Xo1y{Tw2KKxi@Xh"g@]Qc|.U<*]WDd)qvGowFDvfU1F]{EDho:7P0@|oOD=Bc{K4?> WP68K[Mx:}=`ZT'6g4'f+g?;`vri2!)xGy}3:=l'(/Cea0l4lo^H5#@/Z3ev Mail-Followup-To: Harald Hanche-Olsen , In-Reply-To: <20080202.121924.157909693.hanche@math.ntnu.no> (Harald Hanche-Olsen's message of "Sat, 02 Feb 2008 12:19:24 +0100 (CET)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-DCC-dcc-servers.net-Metrics: poseidon 102; Body=3 Fuz1=3 Fuz2=3 X-Virus-Scanned: by amavisd-new X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66226 Archived-At: On Sat, Feb 02 2008, Harald Hanche-Olsen wrote: > Gnus v5.11 > GNU Emacs 23.0.0.2 (i386-unknown-freebsd5.3, X toolkit, Xaw3d scroll bars) > of 2005-10-18 on shuttle When running some CVS snapshot (as 23.0.0 indicates, though I don't know to which date and branch it belongs), it doesn't make sense to run a version more than 2 years old. However, I think you analysis is correct nevertheless. :-) > The ultrashort summary: > > I usually read usenet news by running: emacs -f gnus & > from an xterm. Once in a rare while, gnus stops with the splash > screen still up, and the message > > Symbol's value as variable is void: image-load-path > > in the minibuffer. > > I believe I have narrowed this down to the following code in > gnus-group-startup-message (irrelevant bits brutally snipped): > > (cond > ((and > (fboundp 'find-image) > (display-graphic-p) > (let* ((data-directory ...) > (image-load-path ...) > (image (find-image ...))) > (when image ...))))) > > Assume that image.el[c] has not yet been loaded when this runs. > Now find-image is autoloaded, so the symbol is fbound. > We bind image-load-path and call find-image, which tries to > (defvar load-image-path) > and that fails because the variable is let-bound. > Of course gnus-group-startup-message succeeds, but later on > gnus-mode-line-buffer-identification fails when it tries to put a > little gnu in the modeline and image-load-path is unbound. > > I believe one needs an extra test to be run just after > (display-graphic-p) in the code above. Perhaps (require 'image nil t) > would do, but we don't really want to hard code the location of > find-image in gnus code? So I came up with this instead > > (let ((f (symbol-function 'find-image))) > (if (consp f) > (and (eql (car f) 'autoload) > (load (cadr f) nil nil nil t)) > t)) > > but I'll leave that judgement up to you folks (obviously). I'm not sure if your or my suggestion (force loading it by adding a dummy call to `find-image' is preferable. Opinions? --8<---------------cut here---------------start------------->8--- --- gnus.el.~7.77.~ 2008-01-20 10:27:58.000000000 +0100 +++ gnus.el 2008-02-02 14:21:34.000000000 +0100 @@ -1002,6 +1002,12 @@ (cond ((and (fboundp 'find-image) + (or + ;; Make sure the library defining `image-load-path' is loaded now + ;; (`find-image' is autoloaded). Else, we may get "defvar ignored + ;; because image-load-path is let-bound". + (find-image '(nil (:type xpm :file "gnus.xpm"))) + t) (display-graphic-p) (let* ((data-directory (nnheader-find-etc-directory "images/gnus")) (image-load-path (cond (data-directory --8<---------------cut here---------------end--------------->8--- > I have no idea why image is usually, but not always, loaded before > gnus starts up. Maybe if I didn't have (tool-bar-mode 0) in my > .emacs, image would always be loaded. But I do. > > Finally, for your delectation, here is a bit of the hard evidence that > led me to the conjecture above (the other evidence is from browsing > source code). It is a diff between the *Messages* buffer from two > runs of emacs -f gnus, the first one (marked -) when all is good, and > the other (marked +) when the bug bit me. > > --- gnus-image-load-path-ok Fri Jan 18 19:20:26 2008 > +++ gnus-image-load-path-not-ok Sat Feb 2 09:39:32 2008 > @@ -12,21 +12,18 @@ > Loading tool-bar...done > Loading help-fns...done > Loading advice...done > -Loading image...done > -For information about the GNU Project and its goals, type C-h C-p. > Loading gnus... > Loading fix-gnus (source)...done > Loading gnus...done > Loading gnus-start... > Loading easymenu...done > Loading gnus-start...done > +Loading image... > +Warning: defvar ignored because image-load-path is let-bound > +Loading image...done > Loading gnus-agent... > Loading fix-gnus-group (source)...done > Loading regexp-opt...done > Loading gnus-agent...done > Reading /local/home/hanche/.newsrc.eld... > -Reading active file from localhost via nntp... > -Loading timezone...done > -No new newsgroups > -Checking new news...done > +gnus-mode-line-buffer-identification: Symbol's value as variable is void: image-load-path > > - Harald > > PS. I'd appreciate if you Cc'd me on any discussion of this problemm > on your mailing list. Done. Added ding@gnus, MFT set. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/