aboutsummaryrefslogtreecommitdiff
path: root/piem.el
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-05-12 00:46:51 -0400
committerKyle Meyer <kyle@kyleam.com>2020-05-12 00:55:58 -0400
commit58d3961b06f73baa33e8defe52710d708324f428 (patch)
treee79adfd653764f37c709f8a751f0691fe32b240f /piem.el
parent486552c2903cc252e1839589b41c4becc80f313d (diff)
downloadpiem-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.el')
-rw-r--r--piem.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/piem.el b/piem.el
index 872da22..f014cbc 100644
--- a/piem.el
+++ b/piem.el
@@ -87,6 +87,19 @@ should return a function that takes no arguments and inserts the
mbox's contents in the current buffer."
:type 'hook)
+(defvar piem-link-re
+ (rx "/" (group (one-or-more (not (any "/" "\n"))))
+ "/" (group (one-or-more (not (any "/" "\n"))))
+ "/" (group (zero-or-one
+ (or "raw"
+ "t.mbox.gz"
+ (and (or "t" "T") "/#"
+ (one-or-more (not (any "/" "\n")))))))
+ string-end)
+ "Regular expression matching public-inbox HTTP link.
+The first group is the inbox, the second is the message ID, and
+the rest is any trailing endpoint.")
+
(defun piem-inbox-by-header-match ()
"Return inbox based on matching message headers.
This should be called from a buffer containing a message and is