From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/71439 Path: news.gmane.org!not-for-mail From: Dan Christensen Newsgroups: gmane.emacs.gnus.general Subject: Re: article editing in nnimap Date: Wed, 22 Sep 2010 13:45:16 -0400 Message-ID: <87mxr9pt8z.fsf@uwo.ca> References: <87vd6143w9.fsf@uwo.ca> <87aanaka5q.fsf@uwo.ca> <87pqw5hpay.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1285177811 11097 80.91.229.12 (22 Sep 2010 17:50:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 22 Sep 2010 17:50:11 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M19812@lists.math.uh.edu Wed Sep 22 19:50:10 2010 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.69) (envelope-from ) id 1OyTSL-0005Vb-DI for ding-account@gmane.org; Wed, 22 Sep 2010 19:50:09 +0200 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 1OyTSJ-0004iL-FD; Wed, 22 Sep 2010 12:50:07 -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 1OyTSH-0004i4-Mx for ding@lists.math.uh.edu; Wed, 22 Sep 2010 12:50:05 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OyTSG-0003ow-Hv for ding@lists.math.uh.edu; Wed, 22 Sep 2010 12:50:05 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OyTSF-00044S-00 for ; Wed, 22 Sep 2010 19:50:03 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OyTSF-0005SN-EO for ding@gnus.org; Wed, 22 Sep 2010 19:50:03 +0200 Original-Received: from bas3-london14-1096786111.dsl.bell.ca ([65.95.160.191]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Sep 2010 19:50:03 +0200 Original-Received: from jdc by bas3-london14-1096786111.dsl.bell.ca with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 22 Sep 2010 19:50:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 84 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: bas3-london14-1096786111.dsl.bell.ca User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:iswZhxDq7lSQbYQOzIBRz7gW4NE= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:71439 Archived-At: --=-=-= Content-Type: text/plain Ted Zlatanov writes: > I don't see (but perhaps I've missed it in the discussion) why not just > implement -replace-article (maybe it can use -copy-article internally)? That's what my proposal is, as suggested in the original (non-working) patch against the old nnimap.el (included again below). In short, when asked to replace an article, nnimap could instead move the article from the group to the same group, but instead of using the old buffer, use the edited buffer. Dan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=nnimap-reuse-move.patch --- nnimap.orig.el 2009-09-30 12:56:46.000000000 -0400 +++ nnimap-nogood.el 2009-10-24 20:42:16.000000000 -0400 @@ -52,7 +52,6 @@ ;; o IMAP2BIS compatibility? (RFC2061) ;; o ACAP stuff (perhaps a different project, would be nice to ACAPify ;; .newsrc.eld) -;; o What about Gnus's article editing, can we support it? NO! ;; o Use \Draft to support the draft group?? ;; o Duplicate suppression ;; o Rewrite UID SEARCH UID X as UID FETCH X (UID) for those with slow servers @@ -1564,6 +1563,7 @@ (deffoo nnimap-request-move-article (art (nnimap-current-move-article article) (nnimap-current-move-group group) (nnimap-current-move-server nnimap-current-server) + (move-is-internal (and move-is-internal (not nnimap-request-accept-buffer))) result) (gnus-message 10 "nnimap-request-move-article: this is an %s move" (if move-is-internal @@ -1584,6 +1584,7 @@ (deffoo nnimap-request-move-article (art "\\Deleted" 'silent nnimap-server-buffer)) result)))) +(setq nnimap-request-accept-buffer nil) (deffoo nnimap-request-accept-article (group &optional server last) (when (nnimap-possibly-change-server server) (let (uid) @@ -1596,7 +1597,7 @@ (deffoo nnimap-request-accept-article (g nnimap-current-move-article) group 'dontcreate nil nnimap-server-buffer)) - (with-current-buffer (current-buffer) + (with-current-buffer (or nnimap-request-accept-buffer (current-buffer)) (goto-char (point-min)) ;; remove any 'From blabla' lines, some IMAP servers ;; reject the entire message otherwise. @@ -1619,6 +1620,16 @@ (deffoo nnimap-request-accept-article (g (cons group (nth 1 uid)) (nnheader-report 'nnimap (imap-error-text nnimap-server-buffer)))))) +(deffoo nnimap-request-replace-article (article group buffer) + (let ((nnimap-request-accept-buffer buffer) + (gnusgroup (gnus-group-prefixed-name + group (gnus-server-to-method + (format "nnimap:%s" nnimap-current-server))))) + ; With or without the next line I get a backtrace, but it changes: + ;(nnimap-request-article article group) + (message "%s" (list article group nnimap-request-accept-buffer gnusgroup)) + (gnus-summary-move-article 1 gnusgroup))) + (deffoo nnimap-request-delete-group (group force &optional server) (when (nnimap-possibly-change-server server) (when (string= group (imap-current-mailbox nnimap-server-buffer)) @@ -1789,6 +1800,7 @@ (defun nnimap-mark-permanent-p (mark &op nnimap-request-expire-articles nnimap-request-move-article nnimap-request-accept-article + nnimap-request-replace-article nnimap-request-delete-group nnimap-request-rename-group gnus-group-nnimap-expunge --=-=-=--