aboutsummaryrefslogtreecommitdiff
path: root/piem-eww.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-08-27 23:19:17 -0400
committerKyle Meyer <kyle@kyleam.com>2020-08-28 23:05:56 -0400
commitd200092f77fa8613db0bf58a5670fe91353e8b96 (patch)
tree3a95b39a1068aa91959b240f0acae5daa736eee9 /piem-eww.el
parentad1cd6ae77e06c3d53938000b8d559ed436a1dad (diff)
downloadpiem-d200092f77fa8613db0bf58a5670fe91353e8b96.tar.gz
elfeed, eww: Don't assume inbox name in piem-inboxes and URL match
piem-elfeed-get-inbox and piem-eww-get-inbox match the URL against piem-link-re and take the second group as the inbox name. That's a bad approach because the inbox name in the URL doesn't necessarily match the one in piem-inboxes. For example, public-inbox's own archive is https://public-inbox.org/meta/, but my entry in piem-inboxes uses the name "public-inbox": ("public-inbox" :url "https://public-inbox.org/meta/" ...) The approach also fails if the URL isn't a public-inbox message URL because piem-link-re isn't very specific. (That will be improved in an upcoming commit.) Find the inbox name by matching the buffer URL against the :url values in piem-inboxes. Message-Id: <20200828031920.7515-2-kyle@kyleam.com>
Diffstat (limited to 'piem-eww.el')
-rw-r--r--piem-eww.el7
1 files changed, 1 insertions, 6 deletions
diff --git a/piem-eww.el b/piem-eww.el
index e8c77f5..5fb629b 100644
--- a/piem-eww.el
+++ b/piem-eww.el
@@ -38,12 +38,7 @@
"Return inbox name from an EWW buffer."
(when (derived-mode-p 'eww-mode)
(when-let ((link (plist-get eww-data :url)))
- ;; NEEDSWORK: This relies on the inbox name in the URL matching
- ;; the inbox name in `piem-inboxes', which might not be the
- ;; case. If there's a :url in `piem-inboxes', that could be
- ;; matched instead.
- (and (string-match piem-link-re link)
- (match-string 1 link)))))
+ (piem-inbox-by-url-match link))))
(defun piem-eww-get-mid ()
"Return the message ID of an EWW buffer."