[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

interface to KILL file (was: Re: Standard way to use Gnus?)

From: Emanuel Berg
Subject: interface to KILL file (was: Re: Standard way to use Gnus?)
Date: Fri, 20 Mar 2015 22:12:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Emanuel Berg <> writes:

> Other than that, I miss a fast way to insert to the
> KILL file from an article buffer.
> Like "gnus-article-kill-author" that would forever
> expunge that e-mail from your system. Just extract
> header data, make a line, and append it to a file.

I got something to this extent but it assumes the type
of KILL file I described and not (apparently) what was
originally refered to.

Here is the code in context - not that there is any
(context), but anyway:

By the way, "lamer" isn't exactly a good word for it.
Rather, plonks should be spammers, flamers/haters, and
such folks. And when this is used, no one should be
told it happened. It doesn't make the *plonk*
sound, even.

In terms of the code, the most interesting thing was
the iso-8859-1 thing which deal with the strange

    =?iso-8859-1?q? ... ?=

enclosure - this is describe here:

at the entry fro `mail-encode-encoded-word-string'.

The code:

(defun lamer ()
    (if (string= major-mode "gnus-summary-mode") ; so possible to invoke in
                 (gnus-summary-select-article) ) ; summary as well as article 
    (let*((killfile (format "%s%s" gnus-directory gnus-kill-file-name))
          (header "From")
           (mail-decode-encoded-word-string      ; handle special iso-8859-1 
            (gnus-article-header-value header))) ; in header, e.g. 'ü'
            "(gnus-kill \"%s\" \"%s\" \'(gnus-summary-mark-as-read nil \"X\") 
            header header-value)) )
      (if (not (file-exists-p killfile))
          (with-temp-file killfile (insert "(gnus-expunge \"X\")\n")) )
      (with-current-buffer (find-file-noselect killfile t) ; NOWARN
        (revert-buffer t t) ; IGNORE-AUTO NOCONFIRM
        (goto-char (point-min))
        (insert entry)
        (save-buffer) ))))

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]