I wanted to hike again in Point Reyes today, but I missed my carpool ride. Every time this happens I feel as if I don't want to try it again, it is quite demoralizing.
So I went back home and fought Gnus. I found a case where an news article was encoded in utf-8 but Gnus didn't know about it and used iso-8859-1 coding system in the article buffer resulting in gibberish. It turns out some news posting software inserts an X-Coding-System header; I'm guessing this predates the MIME standard. Gnus already has a command which translates a numeric prefix argument into a coding system and redisplays the article with that coding system; I simply replaced it (in the summary mode keymap) with a command that looks for X-Coding-System first:
(setq itz-coding-system-charsets '(("\\`utf-8\\(\\'\\|-\\)" . utf-8) ("\\`iso-8859-1\\(\\'\\|-\\)" . iso-8859-1))) (defun itz-article-handle-x-coding-system () (require 'gnus-art) (let ((inhibit-point-motion-hooks t) (case-fold-search t) (inhibit-read-only t)) (save-excursion (save-restriction (article-narrow-to-head) (setq ng (message-fetch-field "Newsgroups")) (when ng (setq xcs (message-fetch-field "X-Coding-System")) (when xcs (setq xcs (mail-header-strip xcs)) (setq charset nil) (dolist (cs itz-coding-system-charsets charset) (when (string-match-p (car cs) xcs) (setq charset (cdr cs)))))))))) (defun itz-summary-show-article-xcs (&optional arg) "Like `gnus-summary-show-article' but try to deduce coding system by checking for an X-Coding-System header." (interactive "P") (unless arg (let ((gnus-visible-headers ".*")) (gnus-summary-show-article t)) (let ((cs (with-current-buffer gnus-article-buffer (itz-article-handle-x-coding-system)))) (when cs (setq arg (car (rassq cs gnus-summary-show-article-charset-alist)))))) (gnus-summary-show-article arg))
It seems the official branch of Gnus has no native support for X-Coding-System but I got a few search engine hits which suggest hackers have tried to do something similar in Emacs ports such as the Aquamacs.
Lastly, I want to record a link to an obscure bug I run into when preparing the buildbot environment for besport: when compiling the lwt package, better make sure than only one of libev3 and libev4 is installed.