[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xkcd b303669b33 39/82: Merge pull request #7 from rafoo/ma
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/xkcd b303669b33 39/82: Merge pull request #7 from rafoo/master |
Date: |
Mon, 12 Dec 2022 21:59:52 -0500 (EST) |
branch: elpa/xkcd
commit b303669b337f5665b7f16f7720e997f81411cad0
Merge: 4d280972bc 502a36d15e
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>
Merge pull request #7 from rafoo/master
Some suggestions
---
README.md | 4 ++--
xkcd.el | 19 ++++++++++++-------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
index 4456de7637..506433b19d 100644
--- a/README.md
+++ b/README.md
@@ -28,8 +28,8 @@ Files are cached by default to ~/.emacs.d/xkcd/. This can be
changed by changing
# Current keybindings:
| Keybinding | Use | Function |
|:----------:|:------------------------------:|:--------------:|
-| `C-c r` | Load a random xkcd | (xkcd-rand) |
-| `C-c t` | Show alt-text in the minibuffer| (xkcd-alt-text)|
+| `r` | Load a random xkcd | (xkcd-rand) |
+| `t` | Show alt-text in the minibuffer| (xkcd-alt-text)|
| `<right>` | Load next xkcd | (xkcd-next) |
| `<left>` | Load previous xkcd | (xkcd-prev) |
diff --git a/xkcd.el b/xkcd.el
index 6b812e8ad6..94963bf61c 100644
--- a/xkcd.el
+++ b/xkcd.el
@@ -44,8 +44,8 @@
:keymap (let ((map (make-sparse-keymap)))
(define-key map (kbd "<right>") 'xkcd-next)
(define-key map (kbd "<left>") 'xkcd-prev)
- (define-key map (kbd "C-c r") 'xkcd-rand)
- (define-key map (kbd "C-c t") 'xkcd-alt-text)
+ (define-key map (kbd "r") 'xkcd-rand)
+ (define-key map (kbd "t") 'xkcd-alt-text)
(define-key map (kbd "q") 'xkcd-kill-buffer)
map))
@@ -139,11 +139,14 @@ be located in xkcd-cache-dir"
(setq title (format "%d: %s" (cdr (assoc 'num (json-read-from-string out)))
(cdr (assoc 'safe_title (json-read-from-string out)))))
(insert (concat title "\n"))
- (insert-image (create-image
- (concat xkcd-cache-dir
- (number-to-string
- (cdr
- (assoc 'num (json-read-from-string out)))) ".png")
'png))
+ (let ((start (point)))
+ (insert-image (create-image
+ (concat xkcd-cache-dir
+ (number-to-string
+ (cdr
+ (assoc 'num (json-read-from-string out))))
".png") 'png))
+ (add-text-properties start (point) '(help-echo xkcd-alt))
+ )
(if (eq xkcd-cur 0)
(setq xkcd-cur (cdr (assoc 'num (json-read-from-string out)))))
(xkcd-cache-json num out)
@@ -172,6 +175,8 @@ be located in xkcd-cache-dir"
(interactive)
(xkcd-get 0))
+(defalias 'xkcd 'xkcd-get-latest)
+
(defun xkcd-get-latest-cached ()
"Get the latest cached xkcd"
(interactive)
- [nongnu] elpa/xkcd 7b1a312239 37/82: Add an help-echo text property to display the alt-text, (continued)
- [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, 2022/12/12
- [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 <=
- [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
- [nongnu] elpa/xkcd 296aa18259 47/82: Merge branch 'master' of https://github.com/vibhavp/emacs-xkcd, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd c2be5c6a08 50/82: Merge pull request #8 from rafoo/master, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 9f77f0422f 64/82: Require browse-url for external-browser functions to work., ELPA Syncer, 2022/12/12