From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.devel,gmane.emacs.jabber.general,gmane.emacs.gnus.general Subject: Re: gnus shouldn't be making general-purpose variables buffer-local Date: Mon, 22 Dec 2008 19:55:23 +0100 Message-ID: <87bpv4ca5g.fsf@marauder.physik.uni-ulm.de> References: <9aa0cfde0812112242o38d885a1h12d9e4ac490021@mail.gmail.com> <863agokpas.fsf@lifelogs.com> <87vdtj41ux.fsf@engster.org> 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 1229972252 6747 80.91.229.12 (22 Dec 2008 18:57:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Dec 2008 18:57:32 +0000 (UTC) Cc: emacs-jabber-general@lists.sourceforge.net, ding@gnus.org, emacs-devel@gnu.org To: Ami Fischman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 22 19:58:35 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LEpyr-0003dT-VO for ged-emacs-devel@m.gmane.org; Mon, 22 Dec 2008 19:58:19 +0100 Original-Received: from localhost ([127.0.0.1]:50664 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEpxf-0007x1-Co for ged-emacs-devel@m.gmane.org; Mon, 22 Dec 2008 13:57:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LEpxY-0007wW-Sn for emacs-devel@gnu.org; Mon, 22 Dec 2008 13:56:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LEpxU-0007vz-LD for emacs-devel@gnu.org; Mon, 22 Dec 2008 13:56:55 -0500 Original-Received: from [199.232.76.173] (port=45393 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LEpxU-0007vv-FI for emacs-devel@gnu.org; Mon, 22 Dec 2008 13:56:52 -0500 Original-Received: from mail.uni-ulm.de ([134.60.1.11]:63072) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LEpxT-0004gf-Ot for emacs-devel@gnu.org; Mon, 22 Dec 2008 13:56:52 -0500 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.175]) by mail.uni-ulm.de (8.14.2/8.14.2) with ESMTP id mBMIuhFC012711; Mon, 22 Dec 2008 19:56:44 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 6F3FD13542; Mon, 22 Dec 2008 19:56:43 +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: Ami Fischman , ding@gnus.org, emacs-devel@gnu.org, emacs-jabber-general@lists.sourceforge.net In-Reply-To: (Katsumi Yamaoka's message of "Wed, 17 Dec 2008 19:21:01 +0900") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-CTc-dcc1-Metrics: poseidon 1030; Body=4 Fuz1=4 Fuz2=4 X-Virus-Scanned: by amavisd-new X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:107188 gmane.emacs.jabber.general:829 gmane.emacs.gnus.general:67967 Archived-At: [ Adding Ami Fischman, emacs-devel and emacs-jabber (again). (See , also for the complete threads.) ] On Wed, Dec 17 2008, Katsumi Yamaoka wrote: > At least for `timestamp', the attached patch will solve (note > that you need to reload the patched gnus-group.elc because of > `defsubst'). At the first time you enter to a group, the buffer- > local variable `timestamp' is still alive, but it will be renamed > to `gnus-timestamp' when exiting the group. Maybe the change > will not slow Gnus. [...] > --- gnus-group.el~ 2008-10-03 05:47:11 +0000 > +++ gnus-group.el 2008-12-17 10:18:31 +0000 > @@ -4608,11 +4608,13 @@ > (when gnus-newsgroup-name > (let ((time (current-time))) > (setcdr (cdr time) nil) > - (gnus-group-set-parameter gnus-newsgroup-name 'timestamp time)))) > + (gnus-group-set-parameter gnus-newsgroup-name 'gnus-timestamp time) > + (gnus-group-remove-parameter gnus-newsgroup-name 'timestamp)))) > > (defsubst gnus-group-timestamp (group) > "Return the timestamp for GROUP." > - (gnus-group-get-parameter group 'timestamp t)) > + (or (gnus-group-get-parameter group 'gnus-timestamp t) > + (gnus-group-get-parameter group 'timestamp t))) After the initial report on emacs-devel, I wrote this quite similar patch: --8<---------------cut here---------------start------------->8--- --- gnus-group.el 10 Sep 2008 03:28:52 +0200 1.77 +++ gnus-group.el 03 Nov 2008 00:17:44 +0100 @@ -4608,11 +4608,17 @@ (when gnus-newsgroup-name (let ((time (current-time))) (setcdr (cdr time) nil) - (gnus-group-set-parameter gnus-newsgroup-name 'timestamp time)))) + ;; Remove obsolete `timestamp' (used until 2008-11-03) if present. + ;; Note: This breaks down-grading. + (when (gnus-group-get-parameter group 'timestamp t) + (gnus-group-remove-parameter group 'timestamp)) + (gnus-group-set-parameter gnus-newsgroup-name 'gnus-group-timestamp time)))) (defsubst gnus-group-timestamp (group) "Return the timestamp for GROUP." - (gnus-group-get-parameter group 'timestamp t)) + (or (gnus-group-get-parameter group 'gnus-group-timestamp t) + ;; For compatibility, check `timestamp' (used until 2008-11-03) as well. + (gnus-group-get-parameter group 'timestamp t))) (defun gnus-group-timestamp-delta (group) "Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number." --8<---------------cut here---------------end--------------->8--- Beside the other name, it removes the old parameter `timestamp'. However, I wonder if the more general patch suggested by David Engster is better. Does anyone see a problem with it? Ami, does David's patch solve your problem? --8<---------------cut here---------------start------------->8--- --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -3831,6 +3831,7 @@ This function is intended to be used in (and (consp elem) ; Has to be a cons. (consp (cdr elem)) ; The cdr has to be a list. (symbolp (car elem)) ; Has to be a symbol in there. + (boundp (car elem)) ; Has to be already bound (not (memq (car elem) vars)) (ignore-errors ; So we set it. (push (car elem) vars) --8<---------------cut here---------------end--------------->8--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/