From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bojohan@dd.chalmers.se (=?iso-8859-1?q?Johan_Bockg=E5rd?=) Newsgroups: gmane.emacs.help Subject: Re: Gnus: mark-expirable vs. delete Date: Mon, 04 Aug 2003 17:09:12 +0200 Organization: Chalmers University of Technology, Sweden Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1060010905 32218 80.91.224.253 (4 Aug 2003 15:28:25 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 4 Aug 2003 15:28:25 +0000 (UTC) Cc: Joe Casadonte Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Aug 04 17:28:42 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19jhGM-0000R3-00 for ; Mon, 04 Aug 2003 17:28:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19jh3k-0006Xo-84 for geh-help-gnu-emacs@m.gmane.org; Mon, 04 Aug 2003 11:15:40 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsmi-us.news.garr.it!NewsITBone-GARR!news.mailgate.org!newsfeed.stueberl.de!feed.news.nacamar.de!uninett.no!news.net.uni-c.dk!newsfeed.sunet.se!news01.sunet.se!dd.chalmers.se!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-NNTP-Posting-Host: frealaf.dd.chalmers.se User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (usg-unix-v) Cancel-Lock: sha1:auC7SyPoQsk9HdDgStkH2Cs3U3k= Original-Xref: shelby.stanford.edu gnu.emacs.help:115653 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11568 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11568 "Joe Casadonte" writes: > On Mon, 16 Jun 2003, Johan Bockgård wrote: > >> Yes, I have thought about this too. It might be nice to have. I >> think Pine does this--you mark messages for deletion and it deletes >> them when you exit. > > That's exactly what I want! Only slightly tested: (defcustom gnus-expungable-mark ?D "*Mark used for articles that will be expunged on group exit." :group 'gnus-summary-marks :type 'character) (defvar gnus-interactive-expunge 'maybe "*If t, require your confirmation before expunging articles. If nil don't ask. Any other value means to do what `gnus-summary-delete-article' would do \(ask if `gnus-novice-user' is non-nil).") (defun gnus-summary-mark-as-expungable (n) "Mark next N articles as expungable. If N is negative, mark backward instead." (interactive "p") (gnus-summary-mark-forward n gnus-expungable-mark)) (add-hook 'gnus-summary-prepare-exit-hook 'gnus-summary-expunge-expungable-articles) ;; mostly copied from spam-mark-spam-as-expired-and-move-routine in spam.el (defun gnus-summary-expunge-expungable-articles () (unless gnus-group-is-exiting-without-update-p (gnus-summary-kill-process-mark) (let ((articles gnus-newsgroup-articles) article todelete) (dolist (article articles) (when (eq (gnus-summary-article-mark article) gnus-expungable-mark) (push article todelete))) ;; now do the actual deletion (condition-case data (when todelete (dolist (article todelete) (gnus-summary-set-process-mark article)) ;; should we ask before expunging? (let ((gnus-novice-user (cond ((null gnus-interactive-expunge) nil) ((eq gnus-interactive-expunge t) t) (t gnus-novice-user)))) (gnus-summary-delete-article)) ;; why does gnus-summary-work-articles push the marks on the stack? (gnus-summary-yank-process-mark) (gnus-message 6 "Expunging articles")) ;; is (cadr data) always a string? (error (gnus-message 3 "%s" (cadr data)))) (gnus-summary-yank-process-mark)))) ;;(define-key gnus-summary-mode-map "\C-cd" 'gnus-summary-mark-as-expungable) -- Join us on #emacs @ irc.freenode.net. http://www.emacswiki.org/cgi-bin/wiki.pl/EmacsChannel