From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67939 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus shouldn't be making general-purpose variables buffer-local Date: Wed, 17 Dec 2008 19:21:01 +0900 Organization: Emacsen advocacy group Message-ID: References: <9aa0cfde0812112242o38d885a1h12d9e4ac490021@mail.gmail.com> <863agokpas.fsf@lifelogs.com> <87vdtj41ux.fsf@engster.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1229509343 6313 80.91.229.12 (17 Dec 2008 10:22:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 17 Dec 2008 10:22:23 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16385@lists.math.uh.edu Wed Dec 17 11:23:29 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 1LCtYk-0008I8-Lx for ding-account@gmane.org; Wed, 17 Dec 2008 11:23:19 +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 1LCtXD-0003tB-8a; Wed, 17 Dec 2008 04:21:43 -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 1LCtXB-0003st-P3 for ding@lists.math.uh.edu; Wed, 17 Dec 2008 04:21:41 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LCtX8-0002ng-Kb for ding@lists.math.uh.edu; Wed, 17 Dec 2008 04:21:41 -0600 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LCtXL-0003Mu-00 for ; Wed, 17 Dec 2008 11:21:51 +0100 Original-Received: from localhost ([127.0.0.1]:57338) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1LCtWZ-0000oM-S1 for ding@gnus.org; Wed, 17 Dec 2008 04:21:04 -0600 X-Hashcash: 1:20:081217:ding@gnus.org::vZtSyMXLotLhnnOy:00000AUf X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:WThk9IxvtKMOORPD7aXnL+J9P84= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:67939 Archived-At: --=-=-= >>>>> Katsumi Yamaoka wrote: >>>>>> David Engster wrote: >>> Well, how can I get `timestamp' as a buffer-local variable in >>> the summary buffer? [...] >> You would have to bind it globally first to see that it's buffer-local. [...] > I see, oh! Interesting! 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. For other local variables of which the names are too generic, I tried (setq result (mapcar 'car (buffer-local-variables))) in a nnml group, a nntp group, a nnrss group and a nnshimbun group, and found no such one. --=-=-= Content-Type: text/x-patch Content-Disposition: inline --- 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))) (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." --=-=-=--