[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xkcd f5942003bf 45/82: Fix xkcd-get-json
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/xkcd f5942003bf 45/82: Fix xkcd-get-json |
Date: |
Mon, 12 Dec 2022 21:59:52 -0500 (EST) |
branch: elpa/xkcd
commit f5942003bf4f7ba5f4f815c2dfbecba400039a0f
Author: Vibhav Pant <vibhavp@inspiron-1150.lan>
Commit: Vibhav Pant <vibhavp@inspiron-1150.lan>
Fix xkcd-get-json
---
xkcd.el | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/xkcd.el b/xkcd.el
index 50650be2dc..e9a650268e 100644
--- a/xkcd.el
+++ b/xkcd.el
@@ -75,12 +75,12 @@ The return value is a string."
(cached (and (file-exists-p file) (not (eq num 0)))))
(with-current-buffer (if cached
(find-file file)
- (url-retrieve-synchronously url)))
- (goto-char (point-min))
- (unless cached (re-search-forward "^$"))
- (prog1
- (buffer-substring-no-properties (point) (point-min))
- (kill-buffer (current-buffer)))))
+ (url-retrieve-synchronously url))
+ (goto-char (point-min))
+ (unless cached (re-search-forward "^$"))
+ (prog1
+ (buffer-substring-no-properties (point) (point-min))
+ (kill-buffer (current-buffer))))))
(defun xkcd-get-image-type (url)
(let ((substr (substring url (- (length url) 3))))
@@ -95,9 +95,8 @@ The return value is a string."
"Download the image linked by URL to NUM. If NUM arleady exists, do nothing"
;;check if the cache directory exists
(unless (file-exists-p xkcd-cache-dir) (make-directory xkcd-cache-dir))
- (let ((name (concat xkcd-cache-dir (number-to-string num) "." (substring
- url
- (- (length url)
3)))))
+ (let ((name (format "%s%s.%s" xkcd-cache-dir (number-to-string num)
+ (substring url (- (length url) 3)))))
(if (file-exists-p name)
name
(url-copy-file url name))
@@ -124,9 +123,8 @@ and write xkcd-latest to a file"
(defun xkcd-insert-image (file num)
"Insert image FILENAME in buffer with the title-text,
and animate if FILENAME is a gif"
- (let ((image (create-image (concat xkcd-cache-dir
+ (let ((image (create-image (format "%s%s.%s" xkcd-cache-dir
(number-to-string num)
- "."
(substring file (- (length file) 3)))
(xkcd-get-image-type file)))
(start (point)))
- [nongnu] elpa/xkcd b966b340b4 22/82: Rename to xkcd.el, (continued)
- [nongnu] elpa/xkcd b966b340b4 22/82: Rename to xkcd.el, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd e04bb9535d 44/82: Incorporate some changes from rafoo's branch., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 57659266fa 65/82: Fix jpg viewing issue., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd a55c3f7dcd 75/82: Add faces to comic title., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 80011da2e7 82/82: Update copyright years., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd ca3eed5603 80/82: Prefer HTTPS to HTTP, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 5c10f6a679 21/82: Merge pull request #4 from purcell/patch-1, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 25594f98c7 31/82: Add info about Melpa in README., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 52c0d270de 36/82: Use one-letter keybindings, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 20e0b48044 42/82: Correct flycheck warnings, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd f5942003bf 45/82: Fix xkcd-get-json,
ELPA Syncer <=
- [nongnu] elpa/xkcd 3c13ae29c4 49/82: Docstrings, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd e2daa08012 25/82: Add a better screenshot., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd df47be622f 28/82: The package isn't that hackish now., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd d1bc89dee2 34/82: Add variable xkcd-latest: Stores the latest cached xkcd number., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 7b1a312239 37/82: Add an help-echo text property to display the alt-text, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd e61b7e6ed6 51/82: xkcd-get-json: Get substring between (point) and (point-max), instead of, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 5693718f71 52/82: Add support for browse-url., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 0db98c2ca2 72/82: Add instructions for el-get., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 046ad2c582 67/82: Add README.org, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 7987d64a7e 71/82: * README.md: Remove. Replaced with README.org., ELPA Syncer, 2022/12/12