From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/66523 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: drafts and expiry-target problem and solution Date: Tue, 18 Mar 2008 21:53:33 +0900 Organization: Emacsen advocacy group Message-ID: References: <87r6eevweh.fsf@pascal.matem.unam.mx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205844965 814 80.91.229.12 (18 Mar 2008 12:56:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Mar 2008 12:56:05 +0000 (UTC) Cc: bugs@gnus.org, ding@gnus.org To: nils-dated-1213237429.39274f@ackermath.info Original-X-From: ding-owner+M15011@lists.math.uh.edu Tue Mar 18 13:56:34 2008 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1JbbMn-0008Q1-Nz for ding-account@gmane.org; Tue, 18 Mar 2008 13:56:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1JbbLD-0007YH-Fj; Tue, 18 Mar 2008 07:54:55 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1JbbLC-0007Y6-5Z for ding@lists.math.uh.edu; Tue, 18 Mar 2008 07:54:54 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1JbbL5-0000aN-Hs for ding@lists.math.uh.edu; Tue, 18 Mar 2008 07:54:54 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1JbbLC-0006Zg-00; Tue, 18 Mar 2008 13:54:54 +0100 Original-Received: from [66.225.201.151] (port=46410 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.68) (envelope-from ) id 1JbbKQ-0001RD-9r; Tue, 18 Mar 2008 07:54:11 -0500 X-Hashcash: 1:20:080318:nils-dated-1213237429.39274f@ackermath.info::q49M5346q3XjZS2H:0000000000000000004ow9 X-Hashcash: 1:20:080318:bugs@gnus.org::QA2ZlZA40AsTlzeb:00000u0D X-Hashcash: 1:20:080318:ding@gnus.org::aC4KXYD6EmTln+pD:00000fQG X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:akPGtMY+ccjLwLtr9pABFqle84o= X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:66523 Archived-At: >>>>> Nils Ackermann wrote: > This seems to be a long standing bug, I have found messages dating > back to 2001 reporting it. > Minimal setup: > In a pristine environment, using the following .gnus: > (setq gnus-select-method '(nnnil "")) > (setq nnml-get-new-mail nil) > (setq nnml-directory "~/Mail/nnml") > (setq nnml-active-file "~/Mail/nnml/active") > (setq nnml-inhibit-expiry t) > (setq gnus-secondary-select-methods > '((nnml "") > )) > (setq nnmail-expiry-target "nnml:archive") > (setq gnus-message-archive-group "nnml:archive") > (setq gnus-parameters '(("nndraft:drafts" (expiry-target . delete)))) > do the following: > Write email, save it, send it. Do it again. Second time gives > error: `nnml-save-mail: Selecting deleted buffer'. > Expectation would be no error, because overriding expiry-target in > drafts group parameters. I made a temporary user account and tested that configuration several hours. The error seems to be triggered by changing of the nnml server by `nnoo-change-server' (even if it remains the same server) because `message-disassociate-draft' doesn't specify the draft group name fully. > Background: > I like to archive all incoming and all outgoing email in the same nnml > archive folder. Therefore I set `total-expire' in the group > parameters globally (via topics), and I set `nnmail-expiry-target' and > `gnus-message-archive-group' to the same group, globally. > In the drafts group a problem appears: message mode uses the internal > expiry function `nnmh-request-expire-articles' from nnmh.el to delete > the message, immediately. If `nnmail-expiry-target' is set to a > folder, the email is not deleted but moved to this folder instead. > Of course, since the values of `nnmail-expiry-target' and > `gnus-message-archive-group' coincide, gnus tries to save the message > in this folder twice, but gives an error, I don't know why. I think > it should succeed without an error, and warn about it (with variable > to turn the warning off). This is one bug. But doesn't your patch to message.el solve it? Although I tried modifying the `nnml-open-nov' function as follows, before applying your patch, it is unnecessary, isn't it? (defun nnml-open-nov (group) (let ((buffer (cdr (assoc group nnml-nov-buffer-alist)))) (if (gnus-buffer-live-p buffer) buffer (setq buffer (nnml-get-nov-buffer group)) (push (cons group buffer) nnml-nov-buffer-alist) buffer))) > The second bug is that setting the group parameter `expiry-target' for > the drafts group to 'delete doesn't change anything. This clearly > contradicts the manual, where it is stated that group parameters > override global settings. (By the way, in my real setup the parameter > is set via the groups buffer, and not via the variable, but the result > is the same.) The reason is that `nnmh-request-expire-articles' does > not honor the group parameter `expiry-target' at all. > The following patch fixes the second bug for me, minimally. It is not > enough to change `nnmh-request-expire-articles', I also had to change > `message-disassociate-draft' from message.el to use the full group > specification "nndraft:drafts". It seems that > `gnus-group-find-parameter' needs this to find the parameters. > A quick grep through source (by parameter names) showed that there are > many places where (general) group parameters aren't honored, even if > they should be. Potentially this gives rise to a lot of bugs that > seem unrelated. Probably there are also more places where the full > group specification is missing in using `gnus-group-find-parameter'. Indeed. The patches look good to me. It is the best if you have signed a paper to FSF, but it seems to be able to treat as a tiny change. How do you wish to do? > --- nnmh.el.orig 2008-01-21 11:12:29.000000000 -0600 > +++ nnmh.el 2008-01-21 12:30:29.000000000 -0600 > @@ -256,6 +256,9 @@ > &optional server force) > (nnmh-possibly-change-directory newsgroup server) > (let* ((is-old t) > + ;; copied and modified from gnus-group.el, def of gnus-group-expire-articles-1: > + (nnmail-expiry-target > + (or (gnus-group-find-parameter group 'expiry-target t) nnmail-expiry-target)) ***** This should be the variable symbol `newsgroup'. =============================================== > article rest mod-time) > (nnheader-init-server-buffer) > --- message.el.orig 2008-03-13 20:44:50.000000000 -0600 > +++ message.el 2008-01-21 12:34:19.000000000 -0600 > @@ -5797,7 +5797,7 @@ > "Disassociate the message buffer from the drafts directory." > (when message-draft-article > (nndraft-request-expire-articles > - (list message-draft-article) "drafts" nil t))) > + (list message-draft-article) "nndraft:drafts" nil t))) > (defun message-insert-headers () > "Generate the headers for the article." > Gnus v5.11 > GNU Emacs 22.1.1 (i486-pc-linux-gnu, GTK+ Version 2.12.0) > of 2007-11-06 on terranova, modified by Ubuntu > ------------------ Environment follows ------------------ [...] Regards,