aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/elfeed-config.el41
-rw-r--r--modules/markdown-config.el12
-rw-r--r--modules/prog-general.el5
3 files changed, 45 insertions, 13 deletions
diff --git a/modules/elfeed-config.el b/modules/elfeed-config.el
index 7712f48db..7b4d7d745 100644
--- a/modules/elfeed-config.el
+++ b/modules/elfeed-config.el
@@ -29,21 +29,26 @@
(require 'system-lib)
(require 'media-utils)
+(declare-function elfeed "elfeed")
+(declare-function elfeed-update "elfeed")
+(declare-function elfeed-entry-link "elfeed")
+(declare-function elfeed-untag "elfeed")
+(declare-function elfeed-search-selected "elfeed")
+(declare-function elfeed-search-tag-all "elfeed")
+(declare-function elfeed-search-update-entry "elfeed")
+(declare-function elfeed-search-update--force "elfeed")
+(declare-function elfeed-search-untag-all-unread "elfeed")
+(declare-function eww-browse-url "eww")
+(declare-function eww-readable "eww")
+
;; ------------------------------- Elfeed Config -------------------------------
(use-package elfeed
:bind
- ("M-S-r" . cj/elfeed-open) ;; was M-R
(:map elfeed-show-mode-map
("w" . eww-open-in-new-buffer))
(:map elfeed-search-mode-map
- ("w" . cj/elfeed-eww-open) ;; opens in eww
- ("b" . cj/elfeed-browser-open) ;; opens in external browser
- ("d" . cj/elfeed-youtube-dl) ;; async download with yt-dlp and tsp
- ("v" . cj/play-with-video-player)) ;; async play with mpv
- ("V" . cj/select-media-player) ;; Capital V to select player
- ("R" . cj/elfeed-mark-all-as-read) ;; capital marks all as read, since upper case marks one as read
- ("U" . cj/elfeed-mark-all-as-unread) ;; capital marks all as unread, since lower case marks one as unread
+ ("V" . cj/select-media-player)) ;; Capital V to select player
:config
(setq elfeed-db-directory (concat user-emacs-directory ".elfeed-db"))
(setq-default elfeed-search-title-max-width 150)
@@ -90,19 +95,22 @@
(elfeed)
(elfeed-update)
(elfeed-search-update--force))
+(keymap-global-set "M-S-r" #'cj/elfeed-open) ;; was M-R
;; -------------------------- Elfeed Filter Functions --------------------------
(defun cj/elfeed-mark-all-as-read ()
"Remove the \='unread\=' tag from all visible entries in search buffer."
(interactive)
- (mark-whole-buffer)
+ (goto-char (point-min))
+ (push-mark (point-max) nil t)
(elfeed-search-untag-all-unread))
(defun cj/elfeed-mark-all-as-unread ()
"Add the \='unread\=' tag from all visible entries in the search buffer."
(interactive)
- (mark-whole-buffer)
+ (goto-char (point-min))
+ (push-mark (point-max) nil t)
(elfeed-search-tag-all 'unread))
(defun cj/elfeed-set-filter-and-update (filterstring)
@@ -302,5 +310,18 @@ TYPE should be either \='channel or \='playlist."
(insert result))
result))
+;; --------------------------- Search-Mode Keybindings -------------------------
+;; Bound here (not in use-package :bind) because these commands are defined in
+;; this file; a :bind autoload stub plus the defun triggers a "defined multiple
+;; times" byte-compile warning.
+
+(with-eval-after-load 'elfeed
+ (keymap-set elfeed-search-mode-map "w" #'cj/elfeed-eww-open) ;; opens in eww
+ (keymap-set elfeed-search-mode-map "b" #'cj/elfeed-browser-open) ;; opens in external browser
+ (keymap-set elfeed-search-mode-map "d" #'cj/elfeed-youtube-dl) ;; async download with yt-dlp and tsp
+ (keymap-set elfeed-search-mode-map "v" #'cj/play-with-video-player) ;; async play with mpv
+ (keymap-set elfeed-search-mode-map "R" #'cj/elfeed-mark-all-as-read) ;; capital R marks all read (lower case marks one)
+ (keymap-set elfeed-search-mode-map "U" #'cj/elfeed-mark-all-as-unread)) ;; capital U marks all unread (lower case marks one)
+
(provide 'elfeed-config)
;;; elfeed-config.el ends here.
diff --git a/modules/markdown-config.el b/modules/markdown-config.el
index 16935425d..424c09cc8 100644
--- a/modules/markdown-config.el
+++ b/modules/markdown-config.el
@@ -20,14 +20,13 @@
:mode (("README\\.md\\'" . gfm-mode)
("\\.md\\'" . markdown-mode)
("\\.markdown\\'" . markdown-mode))
- :bind (:map markdown-mode-map
- ("<f2>" . cj/markdown-preview)) ;; use same key as compile for consistency
:init (setq markdown-command "multimarkdown"))
;; Register markdown as a known org-src-block language so `org-lint'
;; stops warning on `#+begin_src markdown ... #+end_src' and `C-c ''
;; inside such a block opens it in `markdown-mode' instead of falling
;; back to fundamental-mode.
+(defvar org-src-lang-modes)
(with-eval-after-load 'org
(add-to-list 'org-src-lang-modes '("markdown" . markdown)))
@@ -40,6 +39,8 @@
;;;; --------------------- WIP: Markdown-Preview ---------------------
+(declare-function imp--notify-clients "impatient-mode")
+
(defun cj/markdown-preview-server-start ()
"Start the simple-httpd listener that serves the live markdown preview.
Idempotent: re-running while the server is already up is a no-op."
@@ -75,5 +76,12 @@ lives in a separate command."
(buffer-substring-no-properties (point-min) (point-max))))
(current-buffer)))
+;; Bind the preview key after the defun so use-package's `:bind' autoload
+;; stub doesn't collide with this file's own definition of the command
+;; (that collision is the "defined multiple times" byte-compile warning).
+;; Same key as compile, for consistency.
+(with-eval-after-load 'markdown-mode
+ (keymap-set markdown-mode-map "<f2>" #'cj/markdown-preview))
+
(provide 'markdown-config)
;;; markdown-config.el ends here
diff --git a/modules/prog-general.el b/modules/prog-general.el
index 968032831..99b3cbfab 100644
--- a/modules/prog-general.el
+++ b/modules/prog-general.el
@@ -59,13 +59,16 @@
(declare-function treesit-auto-add-to-auto-mode-alist "treesit-auto")
(declare-function treesit-auto-recipe-lang "treesit-auto")
(declare-function highlight-indent-guides-mode "highlight-indent-guides")
+(declare-function electric-pair-default-inhibit "elec-pair")
+(declare-function yas-reload-all "yasnippet")
+(declare-function yas-activate-extra-mode "yasnippet")
;; Forward declarations for treesit-auto variables
(defvar treesit-auto-recipe-list)
+(defvar electric-pair-inhibit-predicate)
;; Forward declarations for functions defined later in this file
(declare-function cj/project-switch-actions "prog-general")
-(declare-function cj/deadgrep--initial-term "prog-general")
(defun cj/find-project-root-file (regexp)
"Return first file in the current Projectile project root matching REGEXP.