Go to the first, previous, next, last section, table of contents.

Advanced Kill Processing

Internally, applying kills means to run the hook gnus-Apply-kill-hook. It is called after the Subject buffer is prepared for a selected newsgroup. The default hook is the function gnus-apply-kill-file which loads a global KILL file and a local KILL file in this order. A different style of the kill processing can be implemented by customizing this hook.

For example, if you think a global KILL file is unnecessary, you can use the following hook which applies only a local KILL file. This change can save the time for checking the existence of a global KILL file.

(setq gnus-Apply-kill-hook
      '(lambda ()
         ;; Apply a local KILL file.
         (load (gnus-newsgroup-kill-file gnus-newsgroup-name) t nil t)))

On the contrary, the following example enables only a global KILL file.

(setq gnus-Apply-kill-hook
      '(lambda ()
         ;; Apply a global KILL file.
         (load (gnus-newsgroup-kill-file nil) t nil t)))

Here is an advanced example that drastically reduces the time for applying KILL files. This hook does the kill processing directly without loading the KILL files.

(setq gnus-Apply-kill-hook
      '(lambda ()
         ;; Apply to the newsgroup `control'
         ;; if the NNTP server is flab.
         (and (string-equal gnus-nntp-server "flab")
              (string-equal gnus-newsgroup-name "control")
              (progn
                (gnus-kill "Subject" "ihave flab\\|sendme")
                (gnus-kill "Subject" "cancel\\|newgroup\\|rmgroup" "d")
                (gnus-expunge "X")))))

Go to the first, previous, next, last section, table of contents.