[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xkcd b9095c5aae 16/82: Make xkcd-get-latest work.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/xkcd b9095c5aae 16/82: Make xkcd-get-latest work. |
Date: |
Mon, 12 Dec 2022 21:59:50 -0500 (EST) |
branch: elpa/xkcd
commit b9095c5aae64df1a80c07f5ada89e2c62fc161e0
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>
Make xkcd-get-latest work.
---
emacs-xkcd.el | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/emacs-xkcd.el b/emacs-xkcd.el
index 00d9c03de4..5d9bed0460 100644
--- a/emacs-xkcd.el
+++ b/emacs-xkcd.el
@@ -27,7 +27,7 @@
(defun xkcd-get-json (url &optional num)
(let ((json nil))
(let ((file (concat xkcd-cache-dir (number-to-string num) ".json")))
- (if (file-exists-p file)
+ (if (and (file-exists-p file) (not (eq num 0)))
(with-current-buffer (find-file-literally file) ;; File already
exists in the cache
(setq json (buffer-substring-no-properties (point-min) (point-max)))
(kill-buffer (current-buffer))
@@ -71,8 +71,8 @@
(if (and (boundp 'xkcd-mode) (not xkcd-mode))
(xkcd-mode))
(setq xkcd-cur num)
- (let ((out (if (eq num nil)
- (xkcd-get-json "http://xkcd.com/info.0.json")
+ (let ((out (if (eq num 0)
+ (xkcd-get-json "http://xkcd.com/info.0.json" 0)
(xkcd-get-json (concat "http://xkcd.com/" (number-to-string num)
"/info.0.json") num)))
(img nil)
@@ -92,7 +92,7 @@
(number-to-string
(cdr
(assoc 'num (json-read-from-string out)))) ".png")
'png))
- (if (eq xkcd-cur nil)
+ (if (eq xkcd-cur 0)
(setq xkcd-cur (cdr (assoc 'num (json-read-from-string out)))))
(xkcd-cache-json num out)
(setq xkcd-alt (cdr (assoc 'alt (json-read-from-string out))))
@@ -120,7 +120,7 @@
(interactive)
(if (and (boundp 'xkcd-mode) (not xkcd-mode))
(xkcd-mode))
- (xkcd-get nil))
+ (xkcd-get 0))
(defun xkcd-alt-text ()
(interactive)
- [nongnu] elpa/xkcd e2daa08012 25/82: Add a better screenshot., (continued)
- [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
- [nongnu] elpa/xkcd b637a2aa84 13/82: Update README.md, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd b9095c5aae 16/82: Make xkcd-get-latest work.,
ELPA Syncer <=
- [nongnu] elpa/xkcd 2da77a12e2 29/82: Provide xkcd instead of emacs-xkcd, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd e8bb80c4a0 30/82: Make comments work with Melpa., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd b303669b33 39/82: Merge pull request #7 from rafoo/master, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd ef6e51ade7 43/82: Code simplification, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd f2650dc392 46/82: Retrieve correct substring, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 3304f05265 59/82: Autoload xkcd-handle-links., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 60de549e25 63/82: Merge pull request #10 from heikkil/master, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 0310d572b7 68/82: * images/screenshot.png: Add screenshot., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 74b0dfe926 78/82: Retain the quote style when printing messages, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 2c796bcd0f 81/82: Merge pull request #25 from skangas/prefer-https, ELPA Syncer, 2022/12/12