summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-10-13 19:18:44 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-10-13 19:18:44 -0700
commitf888af1134dd7b422afab7dc58c37a991f9ad6b7 (patch)
treed862a92bc32a039c9e362ca5f6e625a002c6d390
parent438b0ff1c81ce5a3ffa91565cbdaa78cff5e774e (diff)
downloaddotfiles-f888af1134dd7b422afab7dc58c37a991f9ad6b7.tar.gz
notmuch C-c g o: add support for opening WSJ print edition PDFs
-rw-r--r--.emacs.d/notmuch-config.el25
1 files changed, 17 insertions, 8 deletions
diff --git a/.emacs.d/notmuch-config.el b/.emacs.d/notmuch-config.el
index 579b314b..8a61a35c 100644
--- a/.emacs.d/notmuch-config.el
+++ b/.emacs.d/notmuch-config.el
@@ -219,14 +219,23 @@ Two ways to read:
(interactive)
(with-current-buffer (or notmuch-tree-message-buffer (current-buffer))
(save-excursion
- (re-search-forward "^URL:\\( \\|\n\\)")
- (let ((url (buffer-substring-no-properties (point) (line-end-position))))
- ;; alternative to eww readable view:
- ;; (start-process "firefox" nil "firefox"
- ;; "-new-window"
- ;; (concat "about:reader?url=" url))
- (spw/next-eww-readable)
- (eww url)))))
+ (cond
+ ((re-search-forward
+ "https://www.wsj.com/.*-WSJNewsPaper-[0-9-]+\\.pdf" nil t)
+ (call-process-shell-command
+ (format "evince %s"
+ (shell-quote-argument
+ (buffer-substring-no-properties (match-beginning 0) (point))))
+ nil 0))
+ (t
+ (re-search-forward "^URL:\\( \\|\n\\)")
+ (let ((url (buffer-substring-no-properties (point) (line-end-position))))
+ ;; alternative to eww readable view:
+ ;; (start-process "firefox" nil "firefox"
+ ;; "-new-window"
+ ;; (concat "about:reader?url=" url))
+ (spw/next-eww-readable)
+ (eww url)))))))
(defvar spw/lists-browse-searches nil
"Internal cache variable.")