blob: 755330bd1ceab41f306117becffb6ee353d96e24 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
Stuff that could make work on Emacs itself more smooth.
* Bug tracker
** Asynchronous client
It would be wonderful if ~debbugs-gnu~ and ~debbugs-gnu-search~ used
their own thread/process to wait & process the server's response,
instead of forcing me to twiddle my thumbs for minutes.
** Attachment management
Thanks to Bob Proulx, I learned that one can
1. send attachments to nnn-quiet@debbugs.gnu.org,
2. (for large attachments, wait for moderation,)
3. go to https://debbugs.gnu.org/nnn and grab the URLs for the
attachments,
4. send a followup mentioning these URLs to nnn@debbugs.gnu.org.
When compared to simply attaching files to one's messages, this
ensures (1) only large attachments get moderated: reports and patches
keep flowing freely (2) mail clients do not stall while browsing
threads, since messages sent to -quiet are not forwarded to the
mailing list.
It'd be neat if Debbugs had a way to automate the -quiet attachment
trick, e.g.
- send some attachments to nnn-attach@debbugs.gnu.org,
- Debbugs then sends a mail to nnn@debbugs.gnu.org saying:
#+begin_example
John Doe <jdoe@gnu.org> attached:
config.log (150 kB) <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=nnn;filename=config.log…>
repro.sh (400 B) <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=nnn;filename=repro.sh…>
#+end_example
([[https://lists.gnu.org/archive/html/help-debbugs/2020-07/msg00004.html][help-debbugs thread]])
* Mailing lists
** Message IDs
*** Summary buffer → Message-ID
#+begin_src emacs-lisp
(kill-new (mail-header-message-id (gnus-summary-article-header)))
#+end_src
*** TODO Message-ID → HTTP archive
- <https://lists.gnu.org>:
#+begin_example
https://lists.gnu.org/archive/cgi-bin/namazu.cgi
?query=%2Bmessage-id:<$MESSAGE_ID>
&submit=Search!
&idxname=$LIST
#+end_example
⇒
#+begin_src emacs-lisp
(defun messageid-to-lgo-url (list id)
"Find the lists.gnu.org URL for a given Message-ID."
(interactive
(list
(read-string "List: ") ; TODO: default to current list.
(let ((default-id
(mail-header-message-id (gnus-summary-article-header))))
(read-string (format-prompt "Message-ID" default-id)
nil nil default-id))))
(with-current-buffer
(url-retrieve-synchronously
(concat
;; For some reason, literal "+" chars cause the search to fail.
;; Escape them.
"https://lists.gnu.org/archive/cgi-bin/namazu.cgi"
"?query=%2Bmessage-id:"
(replace-regexp-in-string "\\+" "%2B" id)
"&submit=Search!"
"&idxname=" list))
(search-forward-regexp
(rx "<a href=\""
(group "/archive/html/" (literal list) "/"
(+ (any "0-9-")) "/msg" (+ (any "0-9")) ".html")
"\">"))
(let ((url (concat "https://lists.gnu.org" (match-string 1))))
(kill-new url)
(message url))))
#+end_src
- public-inbox: trivial
*** DONE HTTP archive → Message-ID
- <https://lists.gnu.org>: cf. =X-Message-Id= comment in HTML
⇒
#+begin_src emacs-lisp
(defun mhonarc-to-messageid (url)
"Retrieve the Message-ID from an article archived on MHonArc."
(interactive
(list
(let ((default (or (thing-at-point-url-at-point)
(and (derived-mode-p 'eww-mode)
(shr-url-at-point nil)))))
(read-string (format-prompt "URL" default) nil nil default))))
(with-current-buffer (url-retrieve-synchronously url)
(search-forward-regexp "^<!--X-Message-Id: \\(.+\\) -->$")
(let ((id (xml-substitute-numeric-entities (match-string 1))))
(kill-new id)
(message id))))
#+end_src
- public-inbox: cf. URL
|