Mercurial > emacs
comparison lisp/gnus/gnus-kill.el @ 91085:880960b70474
Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-283
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 11 Nov 2007 00:56:44 +0000 |
parents | f55f9811f5d7 a3c27999decb |
children | 53108e6cea98 |
comparison
equal
deleted
inserted
replaced
91084:a4347a111894 | 91085:880960b70474 |
---|---|
495 "If FIELD of an article matches REGEXP, execute COMMAND. | 495 "If FIELD of an article matches REGEXP, execute COMMAND. |
496 Optional 1st argument COMMAND is default to | 496 Optional 1st argument COMMAND is default to |
497 (gnus-summary-mark-as-read nil \"X\"). | 497 (gnus-summary-mark-as-read nil \"X\"). |
498 If optional 2nd argument ALL is non-nil, articles marked are also applied to. | 498 If optional 2nd argument ALL is non-nil, articles marked are also applied to. |
499 If FIELD is an empty string (or nil), entire article body is searched for. | 499 If FIELD is an empty string (or nil), entire article body is searched for. |
500 COMMAND must be a lisp expression or a string representing a key sequence." | 500 COMMAND must be a Lisp expression or a string representing a key sequence." |
501 ;; We don't want to change current point nor window configuration. | 501 ;; We don't want to change current point nor window configuration. |
502 (let ((old-buffer (current-buffer))) | 502 (let ((old-buffer (current-buffer))) |
503 (save-excursion | 503 (save-excursion |
504 (save-window-excursion | 504 (save-window-excursion |
505 ;; Selected window must be summary buffer to execute keyboard | 505 ;; Selected window must be summary buffer to execute keyboard |
623 (t | 623 (t |
624 (eval form))))))) | 624 (eval form))))))) |
625 did-kill))) | 625 did-kill))) |
626 | 626 |
627 (defun gnus-execute (field regexp form &optional backward unread) | 627 (defun gnus-execute (field regexp form &optional backward unread) |
628 "If FIELD of article header matches REGEXP, execute lisp FORM (or a string). | 628 "If FIELD of article header matches REGEXP, execute Lisp FORM (or a string). |
629 If FIELD is an empty string (or nil), entire article body is searched for. | 629 If FIELD is an empty string (or nil), entire article body is searched for. |
630 If optional 1st argument BACKWARD is non-nil, do backward instead. | 630 If optional 1st argument BACKWARD is non-nil, do backward instead. |
631 If optional 2nd argument UNREAD is non-nil, articles which are | 631 If optional 2nd argument UNREAD is non-nil, articles which are |
632 marked as read or ticked are ignored." | 632 marked as read or ticked are ignored." |
633 (save-excursion | 633 (save-excursion |
689 (gnus-expert-user t) | 689 (gnus-expert-user t) |
690 (nnmail-spool-file nil) | 690 (nnmail-spool-file nil) |
691 (mail-sources nil) | 691 (mail-sources nil) |
692 (gnus-use-dribble-file nil) | 692 (gnus-use-dribble-file nil) |
693 (gnus-batch-mode t) | 693 (gnus-batch-mode t) |
694 info group newsrc entry | 694 info group newsrc unread |
695 ;; Disable verbose message. | 695 ;; Disable verbose message. |
696 gnus-novice-user gnus-large-newsgroup | 696 gnus-novice-user gnus-large-newsgroup |
697 gnus-options-subscribe gnus-auto-subscribed-groups | 697 gnus-options-subscribe gnus-auto-subscribed-groups |
698 gnus-options-not-subscribe) | 698 gnus-options-not-subscribe) |
699 ;; Eat all arguments. | 699 ;; Eat all arguments. |
701 (gnus-slave) | 701 (gnus-slave) |
702 ;; Apply kills to specified newsgroups in command line arguments. | 702 ;; Apply kills to specified newsgroups in command line arguments. |
703 (setq newsrc (cdr gnus-newsrc-alist)) | 703 (setq newsrc (cdr gnus-newsrc-alist)) |
704 (while (setq info (pop newsrc)) | 704 (while (setq info (pop newsrc)) |
705 (setq group (gnus-info-group info) | 705 (setq group (gnus-info-group info) |
706 entry (gnus-gethash group gnus-newsrc-hashtb)) | 706 unread (gnus-group-unread group)) |
707 (when (and (<= (gnus-info-level info) gnus-level-subscribed) | 707 (when (and (<= (gnus-info-level info) gnus-level-subscribed) |
708 (and (car entry) | 708 (and unread |
709 (or (eq (car entry) t) | 709 (or (eq unread t) |
710 (not (zerop (car entry)))))) | 710 (not (zerop unread))))) |
711 (ignore-errors | 711 (ignore-errors |
712 (gnus-summary-read-group group nil t nil t)) | 712 (gnus-summary-read-group group nil t nil t)) |
713 (when (eq (current-buffer) (get-buffer gnus-summary-buffer)) | 713 (when (eq (current-buffer) (get-buffer gnus-summary-buffer)) |
714 (gnus-summary-exit)))) | 714 (gnus-summary-exit)))) |
715 ;; Exit Emacs. | 715 ;; Exit Emacs. |