GNU bug report logs - #55117
[PROPOSED] Fix gnus-html-image-cache-ttl FIXME

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Tue, 26 Apr 2022 01:01:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55117 in the body.
You can then email your comments to 55117 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#55117; Package emacs. (Tue, 26 Apr 2022 01:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Paul Eggert <eggert <at> cs.ucla.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 26 Apr 2022 01:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: bug-gnu-emacs <at> gnu.org,
	larsi <at> gnus.org
Cc: Paul Eggert <eggert <at> cs.ucla.edu>
Subject: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
Date: Mon, 25 Apr 2022 18:00:13 -0700
* lisp/gnus/gnus-html.el (gnus-html-image-cache-ttl):
Make it a seconds count.
---
 etc/NEWS               |  6 ++++++
 lisp/gnus/gnus-html.el | 10 +++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 40e914cd32..f24177cf55 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -935,6 +935,12 @@ representation as emojis.
 Configuration is very similar to the notmuch and namazu backends.  It
 supports the unified search syntax.
 
+---
+*** gnus-html-image-cache-ttl is now a seconds count.
+Formerly it was a pair of numbers (A B) that represented 65536*A + B,
+to cater to older Emacs implementations that lacked bignums.
+The older form still works but is undocumented.
+
 ** EIEIO
 
 +++
diff --git a/lisp/gnus/gnus-html.el b/lisp/gnus/gnus-html.el
index 8b2200af54..41c488a2b5 100644
--- a/lisp/gnus/gnus-html.el
+++ b/lisp/gnus/gnus-html.el
@@ -40,15 +40,11 @@
 (require 'help-fns)
 (require 'url-queue)
 
-(defcustom gnus-html-image-cache-ttl (days-to-time 7)
-  "Time used to determine if we should use images from the cache."
+(defcustom gnus-html-image-cache-ttl (time-convert (days-to-time 7) 'integer)
+  "Number of seconds used to determine if we should use images from the cache."
   :version "24.1"
   :group 'gnus-art
-  ;; FIXME hardly the friendliest type.  The allowed value is actually
-  ;; any time value, but we are assuming no-one cares about USEC and
-  ;; PSEC here.  It would be better to make it a number of seconds.
-  :type '(choice (cons integer integer)
-		 (list integer integer)))
+  :type number)
 
 (defcustom gnus-html-image-automatic-caching t
   "Whether automatically cache retrieve images."
-- 
2.35.1





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55117; Package emacs. (Tue, 26 Apr 2022 05:06:01 GMT) Full text and rfc822 format available.

Message #8 received at 55117 <at> debbugs.gnu.org (full text, mbox):

From: Po Lu <luangruo <at> yahoo.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: larsi <at> gnus.org, 55117 <at> debbugs.gnu.org
Subject: Re: bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
Date: Tue, 26 Apr 2022 13:04:54 +0800
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> +(defcustom gnus-html-image-cache-ttl (time-convert (days-to-time 7) 'integer)
> +  "Number of seconds used to determine if we should use images from the cache."
>    :version "24.1"

Shouldn't the version be changed to 29.1?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55117; Package emacs. (Tue, 26 Apr 2022 07:08:01 GMT) Full text and rfc822 format available.

Message #11 received at 55117 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Po Lu <luangruo <at> yahoo.com>
Cc: larsi <at> gnus.org, 55117 <at> debbugs.gnu.org
Subject: Re: bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
Date: Tue, 26 Apr 2022 00:07:10 -0700
[Message part 1 (text/plain, inline)]
On 4/25/22 22:04, Po Lu wrote:
> Paul Eggert <eggert <at> cs.ucla.edu> writes:
> 
>> +(defcustom gnus-html-image-cache-ttl (time-convert (days-to-time 7) 'integer)
>> +  "Number of seconds used to determine if we should use images from the cache."
>>     :version "24.1"
> 
> Shouldn't the version be changed to 29.1?

Yes, I suppose so. Thanks for checking. Also, "number" should be quoted. 
Revised patch attached.
[0001-Fix-gnus-html-image-cache-ttl-FIXME.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55117; Package emacs. (Tue, 26 Apr 2022 10:19:01 GMT) Full text and rfc822 format available.

Message #14 received at 55117 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Po Lu <luangruo <at> yahoo.com>, 55117 <at> debbugs.gnu.org
Subject: Re: bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
Date: Tue, 26 Apr 2022 12:17:53 +0200
Paul Eggert <eggert <at> cs.ucla.edu> writes:

> Yes, I suppose so. Thanks for checking. Also, "number" should be
> quoted. Revised patch attached.

Looks good to me; please go ahead and push.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Tue, 26 Apr 2022 21:02:02 GMT) Full text and rfc822 format available.

Notification sent to Paul Eggert <eggert <at> cs.ucla.edu>:
bug acknowledged by developer. (Tue, 26 Apr 2022 21:02:02 GMT) Full text and rfc822 format available.

Message #19 received at 55117-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 55117-done <at> debbugs.gnu.org
Subject: Re: bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
Date: Tue, 26 Apr 2022 14:00:53 -0700
Thanks for reviewing. I pushed it and am closing the bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 25 May 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.