Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: info-gnus-english@gnu.org
Subject: interface to KILL file (was: Re: Standard way to use Gnus?)
Date: Fri, 20 Mar 2015 22:12:58 +0100	[thread overview]
Message-ID: <87lhir1ig5.fsf_-_@debian.uxu> (raw)
In-Reply-To: <87h9tg7eu0.fsf@debian.uxu>

Emanuel Berg <embe8573@student.uu.se> 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:

    http://user.it.uu.se/~embe8573/conf/emacs-init/gnus/lamer.el

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:

    https://www.gnu.org/software/emacs/manual/html_mono/emacs-mime.html

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

The code:

(defun lamer ()
  (interactive)
  (save-window-excursion
    (if (string= major-mode "gnus-summary-mode") ; so possible to invoke in
                 (gnus-summary-select-article) ) ; summary as well as article mode
    (let*((killfile (format "%s%s" gnus-directory gnus-kill-file-name))
          (header "From")
          (header-value
           (mail-decode-encoded-word-string      ; handle special iso-8859-1 chars
            (gnus-article-header-value header))) ; in header, e.g. 'ü'
          (entry
           (format
            "(gnus-kill \"%s\" \"%s\" \'(gnus-summary-mark-as-read nil \"X\") t)\n"
            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
_______________________________________________
info-gnus-english mailing list
info-gnus-english@gnu.org
https://lists.gnu.org/mailman/listinfo/info-gnus-english

  parent reply	other threads:[~2015-03-20 21:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-17 21:59 Standard way to use Gnus? David Masterson
2015-03-18 19:59 ` Emanuel Berg
     [not found] ` <zfudnUkDnvD5lZbInZ2dnUU7-LudnZ2d@supernews.com>
2015-03-19 18:40   ` Non Gnuser
2015-03-19 22:13     ` Adam Sjøgren
     [not found]     ` <mailman.2344.1426803317.31049.info-gnus-english@gnu.org>
2015-03-19 23:22       ` Emanuel Berg
2015-03-20  6:23         ` Adam Sjøgren
2015-03-20 21:12         ` Emanuel Berg [this message]
2015-03-23 16:28       ` Non Gnuser
2015-03-19 23:14 ` Jeffrey DeLeo
2015-03-20  7:05 ` Glyn Millington
     [not found] ` <mailman.2362.1426837049.31049.info-gnus-english@gnu.org>
2015-03-20 23:18   ` David Masterson
2015-03-21  7:33     ` Glyn Millington
     [not found]     ` <mailman.2465.1426963087.31049.info-gnus-english@gnu.org>
2015-03-22 23:12       ` David Masterson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhir1ig5.fsf_-_@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=info-gnus-english@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).