[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xkcd 6338b49627 40/82: Use major mode instead of minor mod
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/xkcd 6338b49627 40/82: Use major mode instead of minor mode |
Date: |
Mon, 12 Dec 2022 21:59:52 -0500 (EST) |
branch: elpa/xkcd
commit 6338b49627de40ebe926a7561a352362e1f227c1
Author: Raphaël Cauderlier <cauderlier@crans.org>
Commit: Raphaël Cauderlier <cauderlier@crans.org>
Use major mode instead of minor mode
---
xkcd.el | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/xkcd.el b/xkcd.el
index 94963bf61c..5a51f65c99 100644
--- a/xkcd.el
+++ b/xkcd.el
@@ -37,17 +37,16 @@
(require 'url)
;;;###autoload
-(define-minor-mode xkcd-mode
- "Minor mode for viewing xkcd in Emacs"
- :lighter " xkcd"
- :global nil
- :keymap (let ((map (make-sparse-keymap)))
- (define-key map (kbd "<right>") 'xkcd-next)
- (define-key map (kbd "<left>") 'xkcd-prev)
- (define-key map (kbd "r") 'xkcd-rand)
- (define-key map (kbd "t") 'xkcd-alt-text)
- (define-key map (kbd "q") 'xkcd-kill-buffer)
- map))
+(define-derived-mode xkcd-mode special-mode "xkcd"
+ "Major mode for viewing xkcd (http://xkcd.com/) comics."
+ :group 'xkcd
+ )
+
+(define-key xkcd-mode-map (kbd "<right>") 'xkcd-next)
+(define-key xkcd-mode-map (kbd "<left>") 'xkcd-prev)
+(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)
(defvar xkcd-alt nil)
(defvar xkcd-cur nil)
@@ -117,11 +116,11 @@ be located in xkcd-cache-dir"
(xkcd-update-latest)
(get-buffer-create "*xkcd*")
(switch-to-buffer "*xkcd*")
+ (if (and (boundp 'xkcd-mode) (not xkcd-mode))
+ (xkcd-mode))
(if buffer-read-only
(toggle-read-only))
(erase-buffer)
- (if (and (boundp 'xkcd-mode) (not xkcd-mode))
- (xkcd-mode))
(setq xkcd-cur num)
(let ((out (if (eq num 0)
(xkcd-get-json "http://xkcd.com/info.0.json" 0)
- [nongnu] elpa/xkcd b88b3df8b2 27/82: Update to reflect rename., (continued)
- [nongnu] elpa/xkcd b88b3df8b2 27/82: Update to reflect rename., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd a565d632fd 41/82: Support gif and jpg image extensions., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 11c428c1b7 17/82: Fix xkcd-rand., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 26954c3cfc 48/82: Use image-animated-p instead of image-multi-frame-p for Emacs < 24.4, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 311abf717c 20/82: Add autoload cookie for main entry point, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 746acbab54 23/82: Add .travis.yml., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 775a194d77 26/82: Screenshot should show the alt-text capabilities., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 0911bd3f5c 32/82: json 1.4 not strictly required. Fixes #5., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 86acb5dcb2 55/82: Fix typo in variable name., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 502a36d15e 38/82: Add `xkcd' as an alias for `xkcd-get-latest', ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 6338b49627 40/82: Use major mode instead of minor mode,
ELPA Syncer <=
- [nongnu] elpa/xkcd c13dacaf70 56/82: Correct table., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd e5d4ab24f6 18/82: Add xkcd-kill-buffer and a keybinding to the function., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 2923195a57 53/82: Add customization option for handling links., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 2db04f9015 66/82: Merge pull request #13 from TobiMarg/master, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 66eceb7896 62/82: Remove xkcd-handle-urls and friends., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd f539b436cc 60/82: Remove xkcd-handle-link parts to prevent links from being broken., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd f940c7646a 74/82: Add line between MELPA badge and text., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 20e24f1c9b 70/82: Code block is in emacs-lisp, fix directories., ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 8f0009f159 77/82: Merge pull request #16 from kaushalmodi/next-prev-args-and-copy-link, ELPA Syncer, 2022/12/12
- [nongnu] elpa/xkcd 4845ef86f1 76/82: Add prefix arg to next/prev fn, add copy-link fn, ELPA Syncer, 2022/12/12