* bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
@ 2022-04-26 1:00 Paul Eggert
2022-04-26 5:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2022-04-26 1:00 UTC (permalink / raw)
To: 55117, larsi; +Cc: Paul Eggert
* 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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
2022-04-26 1:00 bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME Paul Eggert
@ 2022-04-26 5:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-26 7:07 ` Paul Eggert
0 siblings, 1 reply; 5+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-26 5:04 UTC (permalink / raw)
To: Paul Eggert; +Cc: larsi, 55117
Paul Eggert <eggert@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?
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME
2022-04-26 5:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-04-26 7:07 ` Paul Eggert
2022-04-26 10:17 ` Lars Ingebrigtsen
0 siblings, 1 reply; 5+ messages in thread
From: Paul Eggert @ 2022-04-26 7:07 UTC (permalink / raw)
To: Po Lu; +Cc: larsi, 55117
[-- Attachment #1: Type: text/plain, Size: 411 bytes --]
On 4/25/22 22:04, Po Lu wrote:
> Paul Eggert <eggert@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.
[-- Attachment #2: 0001-Fix-gnus-html-image-cache-ttl-FIXME.patch --]
[-- Type: text/x-patch, Size: 1904 bytes --]
From 310d35e8b9092d23b7570be9b9ab05d94ef073e3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Mon, 25 Apr 2022 17:57:50 -0700
Subject: [PATCH] Fix gnus-html-image-cache-ttl FIXME
* lisp/gnus/gnus-html.el (gnus-html-image-cache-ttl):
Make it a seconds count.
---
etc/NEWS | 6 ++++++
lisp/gnus/gnus-html.el | 12 ++++--------
2 files changed, 10 insertions(+), 8 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..87f3ee6362 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."
- :version "24.1"
+(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 "29.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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-04-26 21:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-26 1:00 bug#55117: [PROPOSED] Fix gnus-html-image-cache-ttl FIXME Paul Eggert
2022-04-26 5:04 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-26 7:07 ` Paul Eggert
2022-04-26 10:17 ` Lars Ingebrigtsen
2022-04-26 21:00 ` Paul Eggert
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.