[Top][All Lists]

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

Re: Score on same subject to avoid read message with this subject in fut

From: Oleksandr Gavenko
Subject: Re: Score on same subject to avoid read message with this subject in future...
Date: Thu, 11 Apr 2013 00:14:52 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

On 2013-04-08, Oleksandr Gavenko wrote:

> So I try to implement killing by subject:
>   (defun my-gnus-summary-kill-same-subject (&optional unmark)
>     (interactive "P")
>     (when (or (not (integerp unmark)) (< 0 unmark))
>       (gnus-summary-score-entry
>        "subject" (gnus-simplify-subject-fuzzy (gnus-summary-article-subject))
>        's (- gnus-score-interactive-default-score) (current-time-string)))
>     (gnus-summary-kill-same-subject unmark))
>   (eval-after-load 'gnus-summary
>     '(define-key gnus-summary-mode-map (kbd "C-k") 
> #'my-gnus-summary-kill-same-subject))
> I know about 'I' key binding but it require a lot of typing and attention...

My latest implementation:

  (defvar my-gnus-summary-kill-same-subject-min-len 8
    "Minimal length of subject string to ignore this subject.")
  (defun my-gnus-summary-kill-same-subject (&optional unmark)
    "Add negative scores for all articles with same subject."
    (interactive "P")
    (when (or (not (integerp unmark)) (< 0 unmark))
      (let ( (subj (gnus-simplify-subject-fuzzy 
(gnus-summary-article-subject))) )
        (when (<= (length subj) my-gnus-summary-kill-same-subject-min-len)
           "subject" subj
           's (- gnus-score-interactive-default-score) (current-time-string)))))
    (gnus-summary-kill-same-subject unmark))
  (eval-after-load 'gnus-sum
    '(define-key gnus-summary-mode-map (kbd "C-k") 

It like defadvice for 'gnus-summary-kill-same-subject' but only for key

Also I put limits for too short subjects to prevent false matches.

After using this function to group.SCORE file added entries like:

    ("How to deal with \"Archive\" and \"delete\" in gmail?" -100 734966 s))

Best regards!

reply via email to

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