diff options
Diffstat (limited to 'lisp/gnus/gnus-score.el')
-rw-r--r-- | lisp/gnus/gnus-score.el | 51 |
1 files changed, 29 insertions, 22 deletions
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index ade0897a16a..ce64dcef041 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -528,7 +528,8 @@ permanence, and the string to be used. The numerical prefix will be used as SCORE. A symbolic prefix of `a' (the SYMP parameter) says to use the `all.SCORE' file for the command instead of the current score file." - (interactive (gnus-interactive "P\ny")) + (interactive (gnus-interactive "P\ny") + gnus-article-mode gnus-summary-mode) (gnus-summary-increase-score (- (gnus-score-delta-default score)) symp)) (defun gnus-score-kill-help-buffer () @@ -544,7 +545,8 @@ permanence, and the string to be used. The numerical prefix will be used as SCORE. A symbolic prefix of `a' (the SYMP parameter) says to use the `all.SCORE' file for the command instead of the current score file." - (interactive (gnus-interactive "P\ny")) + (interactive (gnus-interactive "P\ny") + gnus-article-mode gnus-summary-mode) (let* ((nscore (gnus-score-delta-default score)) (prefix (if (< nscore 0) ?L ?I)) (increase (> nscore 0)) @@ -931,15 +933,16 @@ TYPE is the score type. SCORE is the score to add. EXTRA is the possible non-standard header." (interactive (list (gnus-completing-read "Header" - (mapcar + (mapcar #'car (seq-filter (lambda (x) (fboundp (nth 2 x))) gnus-header-index)) - t) + t) (read-string "Match: ") (if (y-or-n-p "Use regexp match? ") 'r 's) - (string-to-number (read-string "Score: ")))) + (string-to-number (read-string "Score: "))) + gnus-article-mode gnus-summary-mode) (save-excursion (unless (and (stringp match) (> (length match) 0)) (error "No match")) @@ -974,7 +977,8 @@ EXTRA is the possible non-standard header." "Automatically mark articles with score below SCORE as read." (interactive (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) - (string-to-number (read-string "Mark below: "))))) + (string-to-number (read-string "Mark below: ")))) + gnus-article-mode gnus-summary-mode) (setq score (or score gnus-summary-default-score 0)) (gnus-score-set 'mark (list score)) (gnus-score-set 'touched '(t)) @@ -1008,14 +1012,15 @@ EXTRA is the possible non-standard header." "Automatically expunge articles with score below SCORE." (interactive (list (or (and current-prefix-arg (prefix-numeric-value current-prefix-arg)) - (string-to-number (read-string "Set expunge below: "))))) + (string-to-number (read-string "Set expunge below: ")))) + gnus-article-mode gnus-summary-mode) (setq score (or score gnus-summary-default-score 0)) (gnus-score-set 'expunge (list score)) (gnus-score-set 'touched '(t))) (defun gnus-score-followup-article (&optional score) "Add SCORE to all followups to the article in the current buffer." - (interactive "P") + (interactive "P" gnus-article-mode gnus-summary-mode) (setq score (gnus-score-delta-default score)) (when (gnus-buffer-live-p gnus-summary-buffer) (save-excursion @@ -1030,7 +1035,7 @@ EXTRA is the possible non-standard header." (defun gnus-score-followup-thread (&optional score) "Add SCORE to all later articles in the thread the current buffer is part of." - (interactive "P") + (interactive "P" gnus-article-mode gnus-summary-mode) (setq score (gnus-score-delta-default score)) (when (gnus-buffer-live-p gnus-summary-buffer) (save-excursion @@ -1064,13 +1069,13 @@ EXTRA is the possible non-standard header." (defun gnus-summary-raise-score (n) "Raise the score of the current article by N." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (gnus-summary-set-score (+ (gnus-summary-article-score) (or n gnus-score-interactive-default-score )))) (defun gnus-summary-set-score (n) "Set the score of the current article to N." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (save-excursion (gnus-summary-show-thread) (let ((buffer-read-only nil)) @@ -1089,7 +1094,7 @@ EXTRA is the possible non-standard header." (defun gnus-summary-current-score (arg) "Return the score of the current article. With prefix ARG, return the total score of the current (sub)thread." - (interactive "P") + (interactive "P" gnus-article-mode gnus-summary-mode) (message "%s" (if arg (gnus-thread-total-score (gnus-id-to-thread @@ -1099,14 +1104,16 @@ EXTRA is the possible non-standard header." (defun gnus-score-change-score-file (file) "Change current score alist." (interactive - (list (read-file-name "Change to score file: " gnus-kill-files-directory))) + (list (read-file-name "Change to score file: " gnus-kill-files-directory)) + gnus-article-mode gnus-summary-mode) (gnus-score-load-file file) (gnus-set-mode-line 'summary)) (defvar gnus-score-edit-exit-function) (defun gnus-score-edit-current-scores (file) "Edit the current score alist." - (interactive (list gnus-current-score-file)) + (interactive (list gnus-current-score-file) + gnus-article-mode gnus-summary-mode) (if (not gnus-current-score-file) (error "No current score file") (let ((winconf (current-window-configuration))) @@ -2496,7 +2503,7 @@ score in `gnus-newsgroup-scored' by SCORE." (defun gnus-score-find-trace () "Find all score rules that applies to the current article." - (interactive) + (interactive nil gnus-article-mode gnus-summary-mode) (let ((old-scored gnus-newsgroup-scored)) (let ((gnus-newsgroup-headers (list (gnus-summary-article-header))) @@ -2611,7 +2618,7 @@ the score file and its full name, including the directory.") (defun gnus-summary-rescore () "Redo the entire scoring process in the current summary." - (interactive) + (interactive nil gnus-article-mode gnus-summary-mode) (gnus-score-save) (setq gnus-score-cache nil) (setq gnus-newsgroup-scored nil) @@ -2642,7 +2649,7 @@ the score file and its full name, including the directory.") (defun gnus-summary-raise-same-subject-and-select (score) "Raise articles which has the same subject with SCORE and select the next." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (let ((subject (gnus-summary-article-subject))) (gnus-summary-raise-score score) (while (gnus-summary-find-subject subject) @@ -2651,7 +2658,7 @@ the score file and its full name, including the directory.") (defun gnus-summary-raise-same-subject (score) "Raise articles which has the same subject with SCORE." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (let ((subject (gnus-summary-article-subject))) (gnus-summary-raise-score score) (while (gnus-summary-find-subject subject) @@ -2664,7 +2671,7 @@ the score file and its full name, including the directory.") (defun gnus-summary-raise-thread (&optional score) "Raise the score of the articles in the current thread with SCORE." - (interactive "P") + (interactive "P" gnus-article-mode gnus-summary-mode) (setq score (gnus-score-delta-default score)) (let (e) (save-excursion @@ -2683,17 +2690,17 @@ the score file and its full name, including the directory.") (defun gnus-summary-lower-same-subject-and-select (score) "Raise articles which has the same subject with SCORE and select the next." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (gnus-summary-raise-same-subject-and-select (- score))) (defun gnus-summary-lower-same-subject (score) "Raise articles which has the same subject with SCORE." - (interactive "p") + (interactive "p" gnus-article-mode gnus-summary-mode) (gnus-summary-raise-same-subject (- score))) (defun gnus-summary-lower-thread (&optional score) "Lower score of articles in the current thread with SCORE." - (interactive "P") + (interactive "P" gnus-article-mode gnus-summary-mode) (gnus-summary-raise-thread (- (gnus-score-delta-default score)))) ;;; Finding score files. |