comparison lisp/gnus/gnus-sum.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 8fc7fe29b841
children 441bb1e64a06
comparison
equal deleted inserted replaced
23:0edd3412f124 24:4103f0995bd7
157 (sexp :menu-tag "on" t))) 157 (sexp :menu-tag "on" t)))
158 158
159 (defcustom gnus-summary-default-score 0 159 (defcustom gnus-summary-default-score 0
160 "*Default article score level. 160 "*Default article score level.
161 If this variable is nil, scoring will be disabled." 161 If this variable is nil, scoring will be disabled."
162 :group 'gnus-score 162 :group 'gnus-score-default
163 :type '(choice (const :tag "disable") 163 :type '(choice (const :tag "disable")
164 integer)) 164 integer))
165 165
166 (defcustom gnus-summary-zcore-fuzz 0 166 (defcustom gnus-summary-zcore-fuzz 0
167 "*Fuzziness factor for the zcore in the summary buffer. 167 "*Fuzziness factor for the zcore in the summary buffer.
487 487
488 (defcustom gnus-summary-mark-below 0 488 (defcustom gnus-summary-mark-below 0
489 "*Mark all articles with a score below this variable as read. 489 "*Mark all articles with a score below this variable as read.
490 This variable is local to each summary buffer and usually set by the 490 This variable is local to each summary buffer and usually set by the
491 score file." 491 score file."
492 :group 'gnus-score 492 :group 'gnus-score-default
493 :type 'integer) 493 :type 'integer)
494 494
495 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number) 495 (defcustom gnus-article-sort-functions '(gnus-article-sort-by-number)
496 "*List of functions used for sorting articles in the summary buffer. 496 "*List of functions used for sorting articles in the summary buffer.
497 This variable is only used when not using a threaded display." 497 This variable is only used when not using a threaded display."
536 :group 'gnus-summary-sort 536 :group 'gnus-summary-sort
537 :type 'function) 537 :type 'function)
538 538
539 (defcustom gnus-summary-expunge-below nil 539 (defcustom gnus-summary-expunge-below nil
540 "All articles that have a score less than this variable will be expunged." 540 "All articles that have a score less than this variable will be expunged."
541 :group 'gnus-score 541 :group 'gnus-score-default
542 :type '(choice (const :tag "off" nil) 542 :type '(choice (const :tag "off" nil)
543 integer)) 543 integer))
544 544
545 (defcustom gnus-thread-expunge-below nil 545 (defcustom gnus-thread-expunge-below nil
546 "All threads that have a total score less than this variable will be expunged. 546 "All threads that have a total score less than this variable will be expunged.
547 See `gnus-thread-score-function' for en explanation of what a 547 See `gnus-thread-score-function' for en explanation of what a
548 \"thread score\" is." 548 \"thread score\" is."
549 :group 'gnus-treading 549 :group 'gnus-treading
550 :group 'gnus-score 550 :group 'gnus-score-default
551 :type '(choice (const :tag "off" nil) 551 :type '(choice (const :tag "off" nil)
552 integer)) 552 integer))
553 553
554 (defcustom gnus-summary-mode-hook nil 554 (defcustom gnus-summary-mode-hook nil
555 "*A hook for Gnus summary mode. 555 "*A hook for Gnus summary mode.
1034 (equal (gnus-simplify-subject-fully s1) 1034 (equal (gnus-simplify-subject-fully s1)
1035 (gnus-simplify-subject-fully s2))) 1035 (gnus-simplify-subject-fully s2)))
1036 (t 1036 (t
1037 (equal s1 1037 (equal s1
1038 (gnus-simplify-subject-fully s2))))) 1038 (gnus-simplify-subject-fully s2)))))
1039
1040 (defun gnus-offer-save-summaries ()
1041 "Offer to save all active summary buffers."
1042 (save-excursion
1043 (let ((buflist (buffer-list))
1044 buffers bufname)
1045 ;; Go through all buffers and find all summaries.
1046 (while buflist
1047 (and (setq bufname (buffer-name (car buflist)))
1048 (string-match "Summary" bufname)
1049 (save-excursion
1050 (set-buffer bufname)
1051 ;; We check that this is, indeed, a summary buffer.
1052 (and (eq major-mode 'gnus-summary-mode)
1053 ;; Also make sure this isn't bogus.
1054 gnus-newsgroup-prepared))
1055 (push bufname buffers))
1056 (setq buflist (cdr buflist)))
1057 ;; Go through all these summary buffers and offer to save them.
1058 (when buffers
1059 (map-y-or-n-p
1060 "Update summary buffer %s? "
1061 (lambda (buf) (set-buffer buf) (gnus-summary-exit))
1062 buffers)))))
1063 1039
1064 (defun gnus-summary-bubble-group () 1040 (defun gnus-summary-bubble-group ()
1065 "Increase the score of the current group. 1041 "Increase the score of the current group.
1066 This is a handy function to add to `gnus-summary-exit-hook' to 1042 This is a handy function to add to `gnus-summary-exit-hook' to
1067 increase the score of each group you read." 1043 increase the score of each group you read."
3906 "..."))) 3882 "...")))
3907 ;; Pad the mode string a bit. 3883 ;; Pad the mode string a bit.
3908 (setq mode-string (format (format "%%-%ds" max-len) mode-string)))) 3884 (setq mode-string (format (format "%%-%ds" max-len) mode-string))))
3909 ;; Update the mode line. 3885 ;; Update the mode line.
3910 (setq mode-line-buffer-identification 3886 (setq mode-line-buffer-identification
3911 (gnus-mode-line-buffer-identification 3887 (gnus-mode-line-buffer-identification (list mode-string)))
3912 (list mode-string)))
3913 (set-buffer-modified-p t)))) 3888 (set-buffer-modified-p t))))
3914 3889
3915 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads) 3890 (defun gnus-create-xref-hashtb (from-newsgroup headers unreads)
3916 "Go through the HEADERS list and add all Xrefs to a hash table. 3891 "Go through the HEADERS list and add all Xrefs to a hash table.
3917 The resulting hash table is returned, or nil if no Xrefs were found." 3892 The resulting hash table is returned, or nil if no Xrefs were found."
5393 article." 5368 article."
5394 (interactive "P") 5369 (interactive "P")
5395 (setq gnus-summary-buffer (current-buffer)) 5370 (setq gnus-summary-buffer (current-buffer))
5396 (gnus-set-global-variables) 5371 (gnus-set-global-variables)
5397 (let ((article (gnus-summary-article-number)) 5372 (let ((article (gnus-summary-article-number))
5398 (article-window (get-buffer-window gnus-article-buffer)) 5373 (article-window (get-buffer-window gnus-article-buffer t))
5399 (endp nil)) 5374 (endp nil))
5400 (gnus-configure-windows 'article) 5375 (gnus-configure-windows 'article)
5401 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark) 5376 (if (eq (cdr (assq article gnus-newsgroup-reads)) gnus-canceled-mark)
5402 (if (and (eq gnus-summary-goto-unread 'never) 5377 (if (and (eq gnus-summary-goto-unread 'never)
5403 (not (gnus-summary-last-article-p article))) 5378 (not (gnus-summary-last-article-p article)))
5429 "Show previous page of selected article. 5404 "Show previous page of selected article.
5430 Argument LINES specifies lines to be scrolled down." 5405 Argument LINES specifies lines to be scrolled down."
5431 (interactive "P") 5406 (interactive "P")
5432 (gnus-set-global-variables) 5407 (gnus-set-global-variables)
5433 (let ((article (gnus-summary-article-number)) 5408 (let ((article (gnus-summary-article-number))
5434 (article-window (get-buffer-window gnus-article-buffer))) 5409 (article-window (get-buffer-window gnus-article-buffer t)))
5435 (gnus-configure-windows 'article) 5410 (gnus-configure-windows 'article)
5436 (if (or (null gnus-current-article) 5411 (if (or (null gnus-current-article)
5437 (null gnus-article-current) 5412 (null gnus-article-current)
5438 (/= article (cdr gnus-article-current)) 5413 (/= article (cdr gnus-article-current))
5439 (not (equal (car gnus-article-current) gnus-newsgroup-name))) 5414 (not (equal (car gnus-article-current) gnus-newsgroup-name)))
6686 "Move the current article to a different newsgroup. 6661 "Move the current article to a different newsgroup.
6687 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to. 6662 If TO-NEWSGROUP is string, do not prompt for a newsgroup to move to.
6688 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but 6663 If SELECT-METHOD is non-nil, do not move to a specific newsgroup, but
6689 re-spool using this method." 6664 re-spool using this method."
6690 (interactive "P") 6665 (interactive "P")
6691 (gnus-summary-move-article n nil select-method 'copy)) 6666 (gnus-summary-move-article n to-newsgroup select-method 'copy))
6692 6667
6693 (defun gnus-summary-crosspost-article (&optional n) 6668 (defun gnus-summary-crosspost-article (&optional n)
6694 "Crosspost the current article to some other group." 6669 "Crosspost the current article to some other group."
6695 (interactive "P") 6670 (interactive "P")
6696 (gnus-summary-move-article n nil nil 'crosspost)) 6671 (gnus-summary-move-article n nil nil 'crosspost))
8274 (when (assq 'execute (car ps)) 8249 (when (assq 'execute (car ps))
8275 (setcdr (assq 'execute (car ps)) 8250 (setcdr (assq 'execute (car ps))
8276 (funcall (if (string-match "%s" action) 8251 (funcall (if (string-match "%s" action)
8277 'format 'concat) 8252 'format 'concat)
8278 action 8253 action
8279 (mapconcat (lambda (f) f) files " "))))) 8254 (mapconcat
8255 (lambda (f)
8256 (if (equal f " ")
8257 f
8258 (gnus-quote-arg-for-sh-or-csh f)))
8259 files " ")))))
8280 (setq ps (cdr ps))))) 8260 (setq ps (cdr ps)))))
8281 (if (and gnus-view-pseudos (not not-view)) 8261 (if (and gnus-view-pseudos (not not-view))
8282 (while pslist 8262 (while pslist
8283 (when (assq 'execute (car pslist)) 8263 (when (assq 'execute (car pslist))
8284 (gnus-execute-command (cdr (assq 'execute (car pslist))) 8264 (gnus-execute-command (cdr (assq 'execute (car pslist)))
8531 info (if (> (length read) 1) (nreverse read) read)) 8511 info (if (> (length read) 1) (nreverse read) read))
8532 ;; Set the number of unread articles in gnus-newsrc-hashtb. 8512 ;; Set the number of unread articles in gnus-newsrc-hashtb.
8533 (gnus-get-unread-articles-in-group info (gnus-active group)) 8513 (gnus-get-unread-articles-in-group info (gnus-active group))
8534 t))) 8514 t)))
8535 8515
8516 (defun gnus-offer-save-summaries ()
8517 "Offer to save all active summary buffers."
8518 (save-excursion
8519 (let ((buflist (buffer-list))
8520 buffers bufname)
8521 ;; Go through all buffers and find all summaries.
8522 (while buflist
8523 (and (setq bufname (buffer-name (car buflist)))
8524 (string-match "Summary" bufname)
8525 (save-excursion
8526 (set-buffer bufname)
8527 ;; We check that this is, indeed, a summary buffer.
8528 (and (eq major-mode 'gnus-summary-mode)
8529 ;; Also make sure this isn't bogus.
8530 gnus-newsgroup-prepared
8531 ;; Also make sure that this isn't a dead summary buffer.
8532 (not gnus-dead-summary-mode)))
8533 (push bufname buffers))
8534 (setq buflist (cdr buflist)))
8535 ;; Go through all these summary buffers and offer to save them.
8536 (when buffers
8537 (map-y-or-n-p
8538 "Update summary buffer %s? "
8539 (lambda (buf) (switch-to-buffer buf) (gnus-summary-exit))
8540 buffers)))))
8541
8536 (provide 'gnus-sum) 8542 (provide 'gnus-sum)
8537 8543
8538 (run-hooks 'gnus-sum-load-hook) 8544 (run-hooks 'gnus-sum-load-hook)
8539 8545
8540 ;;; gnus-sum.el ends here 8546 ;;; gnus-sum.el ends here