[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xkcd 91be72384e 61/82: Open current xkcd in external brows
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/xkcd 91be72384e 61/82: Open current xkcd in external browser |
Date: |
Mon, 12 Dec 2022 21:59:54 -0500 (EST) |
branch: elpa/xkcd
commit 91be72384eff7d6697dd624da19694142f7ff03b
Author: Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com>
Commit: Heikki Lehvaslaiho <heikki.lehvaslaiho@gmail.com>
Open current xkcd in external browser
Two new functions: open the strip at the xkcd website in default
browser, and open the same strip at the xkcd explanation
website. Defined key bindings 'o' and 'e' for these functions.
---
xkcd.el | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/xkcd.el b/xkcd.el
index 0c78843ebc..92b445d4b9 100644
--- a/xkcd.el
+++ b/xkcd.el
@@ -47,6 +47,8 @@
(define-key xkcd-mode-map (kbd "r") 'xkcd-rand)
(define-key xkcd-mode-map (kbd "t") 'xkcd-alt-text)
(define-key xkcd-mode-map (kbd "q") 'xkcd-kill-buffer)
+(define-key xkcd-mode-map (kbd "o") 'xkcd-open-browser)
+(define-key xkcd-mode-map (kbd "e") 'xkcd-open-explanation-browser)
(defvar xkcd-alt nil)
(defvar xkcd-cur nil)
@@ -236,6 +238,17 @@ If the image is a gif, animate it."
(setq xkcd-latest (string-to-number
(buffer-substring-no-properties (point-min)
(point-max))))
(kill-buffer (current-buffer)))))
+(defun xkcd-open-browser ()
+ "Open current xkcd in default browser"
+ (interactive)
+ (browse-url-default-browser (concat "http://xkcd.com/"
+ (number-to-string xkcd-cur))))
+
+(defun xkcd-open-explanation-browser ()
+ "Open explanation of current xkcd in default browser"
+ (interactive)
+ (browse-url-default-browser (concat
"http://www.explainxkcd.com/wiki/index.php/"
+ (number-to-string xkcd-cur))))
(provide 'xkcd)
;;; xkcd.el ends here
- [nongnu] elpa/xkcd f2650dc392 46/82: Retrieve correct substring, (continued)
- [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
- [nongnu] elpa/xkcd 6166a690b5 73/82: Add MELPA badge., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 91be72384e 61/82: Open current xkcd in external browser,
ELPA Syncer <=
- [nongnu] elpa/xkcd e0b7938714 54/82: Add docs for xkcd-handle-links., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 7148c2c135 57/82: Add (require 'image) to supress build warnings., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 97235a9fbd 58/82: Add autoloads., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 763b73d6de 69/82: * README.md: Remove feature from customize table which is still to be added., ELPA Syncer, 2022/12/12