From 00b1e8fe86689ea23a470bee985fa248c2a476c4 Mon Sep 17 00:00:00 2001 From: Brett Gilio Date: Sun, 25 Oct 2020 14:49:43 -0500 Subject: [PATCH] Work around let-binding bias. --- README.md | 7 ++++--- docs/README.org | 7 ++++--- org-webring.el | 31 +++++++++++++++++-------------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0f5265b..43f7084 100644 --- a/README.md +++ b/README.md @@ -222,9 +222,10 @@ The maximum length of all syndicate titles. ### **Variable**: org-webring-override-time-locale -A convenient way to override the time encoding. Your selected -locale must be available on your machine, otherwise no effect will -be witnessed. +A convenient way to override the time encoding. + +Your selected locale must be available on your machine, otherwise no +effect will be witnessed. - Type: `String` - Default Value: `env LANG` diff --git a/docs/README.org b/docs/README.org index c9195a1..337f386 100644 --- a/docs/README.org +++ b/docs/README.org @@ -162,9 +162,10 @@ The maximum length of all syndicate titles. - Default Value: ~25~ *** *Variable*: org-webring-override-time-locale -A convenient way to override the time encoding. Your selected -locale must be available on your machine, otherwise no effect will -be witnessed. +A convenient way to override the time encoding. + +Your selected locale must be available on your machine, otherwise no +effect will be witnessed. - Type: =String= - Default Value: ~env LANG~ diff --git a/org-webring.el b/org-webring.el index 0a31501..8090174 100644 --- a/org-webring.el +++ b/org-webring.el @@ -222,12 +222,13 @@ set for the planet description." :type 'integer) ;; -;;; Variable Aliases +;;; Variables -(defvaralias 'org-webring-override-time-locale 'system-time-locale - "A convenient way to override the time encoding. Your selected -locale must be available on your machine, otherwise no effect will -be witnessed.") +(defvar org-webring-override-time-locale nil + "A convenient way to override the time encoding. + +Your selected locale must be available on your machine, otherwise no +effect will be witnessed.") ;; ;;; Extraction @@ -397,16 +398,16 @@ was introduced in Emacs 27) isn't available. Additionally, carry URL for error catching." (condition-case msg (apply #'encode-time (org-webring--parse-datetime date atom-p)) - (error - (read-event - (format - "Warning: [%s] — RFC 2822, Report to URL Administrator + (error + (read-event + (format + "Warning: [%s] — RFC 2822, Report to URL Administrator Encoding: %s URL: %s The POST will be skipped —> Press any key to continue or C-g to QUIT." - (cadr msg) date url)) - nil))) + (cadr msg) date url)) + nil))) (defun org-webring--pub-time (item) "Get ITEM's publication time." @@ -492,7 +493,8 @@ The POST will be skipped ;;;###autoload (defun org-webring-generate-webring () "Generate the entire webring and return it as HTML." - (let* ((unique-urls (seq-uniq org-webring-urls)) + (let* ((system-time-locale org-webring-override-time-locale) + (unique-urls (seq-uniq org-webring-urls)) (items (mapcan #'org-webring--get-items-from-url unique-urls)) (articles (cl-multiple-value-bind (pinned normal) @@ -539,7 +541,8 @@ The POST will be skipped ;;;###autoload (defun org-webring-generate-planet () "Generate the entire planet with syndicates list and return it as HTML." - (let* ((org-webring-items-per-source most-positive-fixnum) + (let* ((system-time-locale org-webring-override-time-locale) + (org-webring-items-per-source most-positive-fixnum) (unique-urls (seq-uniq org-webring-urls)) (items (mapcan #'org-webring--get-items-from-url unique-urls)) (items-filtered (seq-filter @@ -556,7 +559,7 @@ The POST will be skipped `(section :class "org-webring-planet" ,@(when org-webring-planet-display-description `((h4 :class "org-webring-description" - ,(print org-webring-planet-description)))) + ,(print org-webring-planet-description)))) (p :class "org-webring-attribution" ,@(when org-webring-display-generation-time (list -- 2.45.2