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