From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/67968 Path: news.gmane.org!not-for-mail From: "Ami Fischman" Newsgroups: gmane.emacs.jabber.general,gmane.emacs.gnus.general,gmane.emacs.devel Subject: Re: gnus shouldn't be making general-purpose variables buffer-local Date: Mon, 22 Dec 2008 12:53:50 -0800 Message-ID: <9aa0cfde0812221253l39a5bf18w86a3dc34c1b46153@mail.gmail.com> References: <9aa0cfde0812112242o38d885a1h12d9e4ac490021@mail.gmail.com> <863agokpas.fsf@lifelogs.com> <87vdtj41ux.fsf@engster.org> <87bpv4ca5g.fsf@marauder.physik.uni-ulm.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1229979265 29356 80.91.229.12 (22 Dec 2008 20:54:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Dec 2008 20:54:25 +0000 (UTC) To: "Reiner Steib" , "Ami Fischman" , ding@gnus.org, emacs-devel@gnu.org, emacs-jabber-general@lists.sourceforge.net Original-X-From: emacs-jabber-general-bounces@lists.sourceforge.net Mon Dec 22 21:55:29 2008 Return-path: Envelope-to: gejg-emacs-jabber-general@m.gmane.org Original-Received: from lists.sourceforge.net ([216.34.181.88]) by lo.gmane.org with esmtp (Exim 4.50) id 1LEro8-0003X6-9I for gejg-emacs-jabber-general@m.gmane.org; Mon, 22 Dec 2008 21:55:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by 335xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1LErmt-0007YQ-E5; Mon, 22 Dec 2008 20:54:03 +0000 Original-Received: from sfi-mx-4.v28.ch3.sourceforge.com ([172.29.28.124] helo=mx.sourceforge.net) by 335xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1LErmr-0007Y4-7c for emacs-jabber-general@lists.sourceforge.net; Mon, 22 Dec 2008 20:54:01 +0000 Received-SPF: neutral (1b2kzd1.ch3.sourceforge.com: 209.85.219.21 is neither permitted nor denied by domain of fischman.org) client-ip=209.85.219.21; envelope-from=ami@fischman.org; helo=mail-ew0-f21.google.com; Original-Received: from mail-ew0-f21.google.com ([209.85.219.21]) by 1b2kzd1.ch3.sourceforge.com with esmtp (Exim 4.69) id 1LErmm-0005Bw-Bu for emacs-jabber-general@lists.sourceforge.net; Mon, 22 Dec 2008 20:54:01 +0000 Original-Received: by ewy14 with SMTP id 14so2577259ewy.10 for ; Mon, 22 Dec 2008 12:53:51 -0800 (PST) Original-Received: by 10.210.109.10 with SMTP id h10mr7890084ebc.10.1229979230828; Mon, 22 Dec 2008 12:53:50 -0800 (PST) Original-Received: by 10.210.92.12 with HTTP; Mon, 22 Dec 2008 12:53:50 -0800 (PST) In-Reply-To: <87bpv4ca5g.fsf@marauder.physik.uni-ulm.de> Content-Disposition: inline X-Spam-Score: 0.8 (/) X-Spam-Report: Spam detection software, running on the system "g2vjzd1.ch3.sourceforge.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Thanks for adding me back to the thread, Reiner. David's patch does solve my problem. In case it's helpful for others who don't want to edit their copy of gnus-sum.el, until now I'd been making do with: (add-hook 'gnus-select-group-hook (lambda () (kill-local-variable 'timestamp))) with no apparent ill-effect. [...] Content analysis details: (0.8 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.2 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -0.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1LErmm-0005Bw-Bu X-BeenThere: emacs-jabber-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-jabber-general-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.jabber.general:830 gmane.emacs.gnus.general:67968 gmane.emacs.devel:107200 Archived-At: Thanks for adding me back to the thread, Reiner. David's patch does solve my problem. In case it's helpful for others who don't want to edit their copy of gnus-sum.el, until now I'd been making do with: (add-hook 'gnus-select-group-hook (lambda () (kill-local-variable 'timestamp))) with no apparent ill-effect. -a On Mon, Dec 22, 2008 at 10:55 AM, Reiner Steib wrote: > [ 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/ > ------------------------------------------------------------------------------