Gnus development mailing list
 help / color / mirror / Atom feed
From: Dan Christensen <jdc@uwo.ca>
To: ding@gnus.org
Subject: Re: article editing in nnimap
Date: Wed, 22 Sep 2010 13:45:16 -0400	[thread overview]
Message-ID: <87mxr9pt8z.fsf@uwo.ca> (raw)
In-Reply-To: <87pqw5hpay.fsf@lifelogs.com>

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

Ted Zlatanov <tzz@lifelogs.com> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnimap-reuse-move.patch --]
[-- Type: text/x-diff, Size: 2754 bytes --]

--- 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

      parent reply	other threads:[~2010-09-22 17:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-20  1:09 Dan Christensen
2010-09-21 21:30 ` Lars Magne Ingebrigtsen
2010-09-21 22:24   ` Dan Christensen
2010-09-21 22:52     ` Lars Magne Ingebrigtsen
2010-09-21 23:01       ` Dan Christensen
2010-09-22 13:37       ` Ted Zlatanov
2010-09-22 16:49         ` Lars Magne Ingebrigtsen
2010-09-22 17:45         ` Dan Christensen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxr9pt8z.fsf@uwo.ca \
    --to=jdc@uwo.ca \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).