Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rpi!rpi.edu!tale From: tale@pawl.rpi.edu (David C Lawrence) Newsgroups: gnu.emacs.gnus Subject: Retaining marked articles (and a little Re: GNUS suggestions) Message-ID: Date: 27 Feb 89 04:33:34 GMT References: Sender: usenet@rpi.edu Reply-To: tale@pawl.rpi.edu Distribution: gnu Organization: The Octagon Room Lines: 107 In-reply-to: tale@pawl.rpi.edu's message of 20 Feb 89 01:44:56 GMT In article mcgrath@paris.Berkeley.EDU (Roland McGrath) wrote: rmg> A GNUS-specific poster would be very nice. In , I responded: Tale> Why? Is there any need to reinvent the wheel and add even more Tale> memory usage into the picture that way? Looking at it a second time, I think I now understood what was originally meant here. I had thought that Roland wanted inews (or whatever poster) to be remade; it is infinitely more logical and reasonable to see that what he meant was, roughly, "Why all of this rnews stuff?" This of course would most likely cut down on memory usage and not increase it. Now, so as not to make this posting just some sort of self-indulgent realization account, I might as well make it a little useful. In , I voiced my desire to have two functions (gnus-kill and gnus-Subject-catch-up-and-exit) not blast away articles marked as unread. I've been keeping a separate file (gnus-etc.el) which both defines some functions I'd like to behave differently and adds some new ones. Included here are the four functions (two originals, but renamed) I use for "catch-up"; I still haven't done the kill-file change yet or even looked to see how feasible it is. I'll be posting some other routines from it, but rather than just throw out the whole file, I'll group them according to function so it is easier to just snarf up what you find useful. (By the way, while making documentation strings and prompts it occurred to me that saying something is "marked as -unread-" could be confusing to novice users. (In fact, it is a little confusing at times in the code to me. I'll be working on something and have to ask myself whether gnus-newsgroup-unreads includes articles with marks. (It does.)) Would it be perhaps somewhat clearer/better to say that an article is marked as "preserved" or such?) Dave --- Cut here 8<--- (and cut the .signature) (define-key gnus-Group-mode-map "C" 'gnus-Group-catch-up-all) (defun gnus-Group-catch-up-all (&optional quietly) "Mark all articles in current newsgroup as read. If optional NO-CONFIRM is non-nil, do without confirmation. Cross references (Xref: field) of articles are ignored." ; Renamed from gnus-Group-catch-up. NO-CONFIRM changed to &optional ; QUIETLY for consistency with gnus-Subject-catch-up[-all]-and-exit (interactive "P") (let ((group (gnus-Group-group-name))) (if (and group (or quietly (y-or-n-p "Mark all articles as read? "))) (progn (message "") ;Erase "Yes or No" question. (gnus-update-unread-articles group nil nil) (gnus-Group-update-group group) (gnus-Group-next-group 1))))) (defun gnus-Group-catch-up (&optional quietly) "Mark all articles not marked as unread in current newsgroup as read. If optional NO-CONFIRM is non-nil, do without confirmations. Cross references (Xref: field) of articles are ignored." (interactive "P") (let* ((group (gnus-Group-group-name)) (marked (cdr (assoc group gnus-marked-assoc)))) (if (and group (or quietly (y-or-n-p "Delete all articles not marked as read? "))) (progn (message "") ;Erase "Yes or No" question. ; Any marked articles will be preserved. (gnus-update-unread-articles group marked marked) (gnus-Group-update-group group) (gnus-Group-next-group 1))))) (define-key gnus-Subject-mode-map "C" 'gnus-Subject-catch-up-all-and-exit) (defun gnus-Subject-catch-up-all-and-exit (&optional quietly) "Mark all articles in this newsgroup as read, and then exit." ; Renamed from gnus-Subject-catch-up-and-exit (interactive "P") (if (or quietly (y-or-n-p "Mark all articles as read? ")) (let ((unreads gnus-newsgroup-unreads)) (message "") ;Erase "Yes or No" question. (while unreads (gnus-mark-article-as-read (car unreads)) (setq unreads (cdr unreads))) (gnus-Subject-exit)))) (defun gnus-Subject-catch-up-and-exit (&optional quietly) "Mark all articles not marked as unread in this newsgroup as read, and then exit." (interactive "P") (if (or quietly (y-or-n-p "Delete all articles not marked as unread? ")) (let ((unmarked (gnus-set-difference gnus-newsgroup-unreads gnus-newsgroup-marked))) (message "") (while unmarked (gnus-mark-article-as-read (car unmarked)) (setq unmarked (cdr unmarked))) (gnus-Subject-exit)))) --- Cut here 8<---------------------------------------------------------------- -- tale@rpitsmts.bitnet, tale%mts@rpitsgw.rpi.edu, tale@pawl.rpi.edu