diff options
author | Kyle Meyer <kyle@kyleam.com> | 2020-05-12 00:46:51 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2020-05-12 00:55:58 -0400 |
commit | 58d3961b06f73baa33e8defe52710d708324f428 (patch) | |
tree | e79adfd653764f37c709f8a751f0691fe32b240f /piem-elfeed.el | |
parent | 486552c2903cc252e1839589b41c4becc80f313d (diff) | |
download | piem-58d3961b06f73baa33e8defe52710d708324f428.tar.gz |
piem: Define extended link regexp and use in elfeed
The links in Elfeed entries only need the restricted variant, but the
extended one will be useful for EWW support.
Diffstat (limited to 'piem-elfeed.el')
-rw-r--r-- | piem-elfeed.el | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/piem-elfeed.el b/piem-elfeed.el index b5e7dc8..979c5ed 100644 --- a/piem-elfeed.el +++ b/piem-elfeed.el @@ -35,23 +35,18 @@ :link '(info-link "(piem)Elfeed integration") :group 'piem) -(defvar piem-elfeed--link-re - (rx "/" (group (one-or-more (not (any "/" "\n")))) - "/" (group (one-or-more (not (any "/" "\n")))) - "/" string-end)) - (defun piem-elfeed-get-inbox () "Return inbox name from an `elfeed-show-mode' buffer." (when (derived-mode-p 'elfeed-show-mode) (when-let ((link (elfeed-entry-link elfeed-show-entry))) - (and (string-match piem-elfeed--link-re link) + (and (string-match piem-link-re link) (match-string 1 link))))) (defun piem-elfeed-get-mid () "Return the message ID of an `elfeed-show-mode' buffer." (when (derived-mode-p 'elfeed-show-mode) (when-let ((link (elfeed-entry-link elfeed-show-entry))) - (and (string-match piem-elfeed--link-re link) + (and (string-match piem-link-re link) (match-string 2 link))))) (define-minor-mode piem-elfeed-mode |