16
Sep
Gnus has a feature called “kill thread”. When reading high traffic mailing lists you often only read specific threads. All the others you are not interested in, you just “kill”. Then all follow-up mails are automatically marked read. Easy but very effective.
I finally managed to have the same in Apple’s Mail.app. The idea is to use the great Mailtags extension and the Act-on extension by the same author. It does not work yet with the 2.1 release, only with a snapshot from the author. Hope the needed parent feature is added soon to the release as well.
The latter is used to add an Act-on rule to add the “Killed” keyword to the current mail (use this to kill a thread):
The former is used to kill incoming mails when a (grand*)parent is “Killed”:
The script being used there is “Mail Assassin.applescript”:
on Logger(str)
do shell script "logger Mail Assassin - " & str
end Logger
on assassinate(msg)
set kill to false
set threadMsg to msg
try
repeat until false
using terms from application "MailTagsScriptingSupport"
set threadMsg to parent of threadMsg
set kwds to keywords of threadMsg
end using terms from
if kwds contains "Killed" then
set kill to true
end if
end repeat
end try
if kill is true then
Logger("Have to kill: " & subject of msg & "")
using terms from application "Mail"
set read status of msg to true
end using terms from
else
-- Logger("Lucky mail: " & subject of msg & "")
end if
end assassinate
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
repeat with msg in theMessages
assassinate(msg)
end repeat
end perform mail action with messages
end using terms from
12
Dec
I thought it would be pretty clever to automatically encrypt emails in my Gnus installation whenever all the addressees have a corresponding PGP key in my keyring. Defaulting to encryption whenever possible is the right thing ™ … theoretically. The practice:
[Encrypted data not shown.]
that couldn’t be decrypted by my mail client - Error in my PGP setup? Can you send it again without encryption, please?
Content-Type: application/pgp-encrypted
Wie ich Dir bereits letztes Mal mitteilte, bin ich nicht mehr im Besitz meines Schluessels bzw meines Passwortes. Ich kann daher Deine verschluesselten Mails nicht lesen.
And some more of the same kind. Of course people who use webmail frequently are unable to decrypt in general. And even the others seem to avoid the trouble to setup encryption again in their mail setup and feel unconfortable when receiving encrypted mails. So I won’t bother them anymore and give up on email encryption.
07
Dec
Sure, without much trouble using jhg-cload.el and the following snippet to make compiling a bit smarter: store the .elc in ~/.elc and avoid recompiling, especially if there were errors before. Normally there is no sense to try it again and again:
(require ‘jhg-cload)
(setq load-path (cons "~/.elc" load-path))
(defun jhg-cload-compile (file)
"Compile FILE if it is ok and out of date."
(let* ((file-name (locate-library file))
(path-base (file-name-sans-extension file-name))
(path-el (concat path-base ".el"))
(path-elc-before (concat path-base ".elc"))
(path-elc (concat "~/.elc/"
(file-name-sans-extension
(file-name-nondirectory file-name))
".elc"))
(path-elc-error (concat path-elc "-error")))
(if (and (jhg-cload-oktocompile-p path-base)
(not (file-exists-p path-elc-error)))
(if (file-newer-than-file-p path-el path-elc)
(progn
;; remove the old file — viano and linux disagree over gids
(condition-case nil (make-directory elc-dir) (error nil))
(condition-case nil (delete-file path-elc) (error nil))
(condition-case nil (delete-file path-elc-before) (error nil))
;; set about compiling it
(jhg-cload-msg 1 "cload: compiling ‘%s’…" path-el)
(save-excursion (write-region (point-min) (point-min) path-elc-error))
(byte-compile-file path-el)
(when (file-exists-p path-elc-before)
(rename-file path-elc-before path-elc)
(delete-file path-elc-error)
(jhg-cload-msg 2 "cload: ok ‘%s’" file)))
(jhg-cload-msg 2 "cload: skipping ‘%s’…" file)))))
27
Nov
Planner allows you to create tasks which link to Gnus articles. It also makes sense to have links to emails in other muse Wiki pages, but Planner does not provide this. The following code does:
(defun gnus-copy-muse-url-from-summary
() (interactive
)
(kill-new
(planner-gnus-annotation-from-summary
)))
(defun gnus-copy-muse-url-from-article() (interactive)
(kill-new (planner-gnus-annotation-from-message)))
(define-key gnus-summary-mode-map (kbd "C-c C-w") ‘gnus-copy-muse-url-from-summary)
(define-key gnus-summary-mode-map (kbd "C-c C-w") ‘gnus-copy-muse-url-from-summary)
(require ‘planner-gnus)
(planner-gnus-insinuate)
Use C-c C-w from the Gnus summary or article buffer to copy the article link into the clipboard. Insert it as usual into one of the muse Wiki pages:
21
Nov
And yet another Emacs hack: open an article from the Gnus summary buffer in another elscreen tab by pressing C-RET. Gnus does not support multiple article buffers for the same group, so I select the article below the cursor, rename the buffer to something else and restore the previous selected article. Works fine ™. Only drawback: most Gnus command like “reply” will not work, or more precisely they will be relative to the current article in the real *Article* buffer.
(defun my-show-article-other-window
()
(interactive
)
"Show article in a seperate window from Gnus summary buffer"
(mapcar
(lambda (article
)
(elscreen-find-and-goto-by-buffer gnus-summary-buffer
)
(let ((show-article
(lambda ()
(gnus-summary-select-article
nil ‘force ‘pseudo article
)
(gnus-summary-select-article-buffer
)
(let ((new-
name (concat
"*Article " gnus-newsgroup-
name
"/" (number-to-string article
) "*")))
(if (get-buffer new-
name) (kill-buffer
(get-buffer new-
name)))
(rename-buffer new-
name)
new-
name))))
(elscreen-create
)
(switch-to-buffer
(save-window-excursion
(save-excursion
(if (gnus-buffer-live-p gnus-article-buffer
)
(let ((old-article
(cdr gnus-article-current
))
(new-
name (funcall show-article
)))
(gnus-summary-select-article
nil ‘force ‘pseudo old-article
)
new-
name)
(funcall show-article
))))))
(gnus-summary-work-articles
nil))))
(define-key gnus-summary-mode-map [(control return)] ‘my-show-article-other-window)