Gnus development mailing list
 help / color / mirror / Atom feed
From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Cc: Dave Love <fx@gnu.org>
Subject: Re: FIXMEs in imap.el and nnimap.el
Date: Thu, 08 Jan 2009 22:04:19 +0100	[thread overview]
Message-ID: <878wplcxws.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <86d4eyvryx.fsf@lifelogs.com> (Ted Zlatanov's message of "Wed, 07 Jan 2009 13:25:26 -0600")

On Wed, Jan 07 2009, Ted Zlatanov wrote:

> On Fri, 02 Jan 2009 23:57:08 +0100 Reiner Steib <reinersteib+gmane@imap.cc> wrote: 
>
>>> (defun imap-message-copyuid-1 (mailbox)
>>> +   (imap-message-copyuid-or-appenduid-1 mailbox t))
>>> + 
>>> + (defun imap-message-appenduid-1 (mailbox)
>>> +   (imap-message-copyuid-or-appenduid-1 mailbox nil))
>>> + 
>>> + (defun imap-message-copyuid-or-appenduid-1 (mailbox copy)
>>> (if (imap-capability 'UIDPLUS)
>>> !       (if copy
>
> RS> I'd rather use
> RS>   (defun imap-message-copyuid-1 (mailbox &optional append)
> RS> or 
> RS>   (defun imap-message-appenduid-1 (mailbox &optional copy)
> RS> and adjust the callers.
>
> Why?  The two functions are clearly mapped to separate IMAP concepts, 

Dunno, I'm not familiar with those.

> so merging them and requiring all the callers to adjust is
> unnecessary pain.

The number of callers is very limited: imap-message-appenduid and
imap-message-append.

I'm not sure if the later should in fact call imap-message-appenduid
instead of imap-message-appenduid-1 (see its use of imap-utf7-encode).

OTOH, keeping imap-message-appenduid-1 as a simple wrapper won't hurt.

How about this?

--- imap.el	08 Jan 2009 21:49:23 +0100	7.52
+++ imap.el	08 Jan 2009 21:55:02 +0100	
@@ -1821,10 +1821,12 @@
 	   (imap-fetch (cdr uids) props receive nouidfetch))
        (signal (car data) (cdr data))))))
 
-(defun imap-message-copyuid-1 (mailbox)
+(defun imap-message-copyuid-1 (mailbox &optional append)
   (if (imap-capability 'UIDPLUS)
-      (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox))
-	    (string-to-number (nth 2 (imap-mailbox-get-1 'copyuid mailbox))))
+      (if append
+	  (imap-mailbox-get-1 'appenduid mailbox)
+	(list (nth 0 (imap-mailbox-get-1 'copyuid mailbox))
+	      (string-to-number (nth 2 (imap-mailbox-get-1 'copyuid mailbox)))))
     (let ((old-mailbox imap-current-mailbox)
 	  (state imap-state)
 	  (imap-message-data (make-vector 2 0)))
@@ -1866,23 +1868,8 @@
 	    (or no-copyuid
 		(imap-message-copyuid-1 mailbox)))))))
 
-;; FIXME: Amalgamate with imap-message-copyuid-1, using an extra arg, since it
-;; shares most of the code?  -- fx
 (defun imap-message-appenduid-1 (mailbox)
-  (if (imap-capability 'UIDPLUS)
-      (imap-mailbox-get-1 'appenduid mailbox)
-    (let ((old-mailbox imap-current-mailbox)
-	  (state imap-state)
-	  (imap-message-data (make-vector 2 0)))
-      (when (imap-mailbox-examine-1 mailbox)
-	(prog1
-	    (and (imap-fetch-safe '("*" . "*:*") "UID")
-		 (list (imap-mailbox-get-1 'uidvalidity mailbox)
-		       (apply 'max (imap-message-map
-				    (lambda (uid prop) uid) 'UID))))
-	  (if old-mailbox
-	      (imap-mailbox-select old-mailbox (eq state 'examine))
-	    (imap-mailbox-unselect)))))))
+  (imap-message-copyuid-1 mailbox t))
 
 (defun imap-message-appenduid (mailbox &optional buffer)
   (with-current-buffer (or buffer (current-buffer))


Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/



  reply	other threads:[~2009-01-08 21:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87iqphil5p.fsf@liv.ac.uk>
2008-12-22 22:38 ` imap.el workaround for Exchange 2007 Reiner Steib
2008-12-23 15:41   ` Dave Love
2009-01-01 18:34     ` Reiner Steib
2009-01-02 22:20       ` Ted Zlatanov
2009-01-02 22:38         ` Reiner Steib
2009-01-09 12:00       ` Simon Josefsson
2009-01-01 18:55     ` FIXMEs in imap.el and nnimap.el (was: imap.el workaround for Exchange 2007) Reiner Steib
2009-01-02 22:19       ` FIXMEs in imap.el and nnimap.el Ted Zlatanov
2009-01-02 22:57         ` Reiner Steib
2009-01-04 23:10           ` Dave Love
2009-01-07 21:07             ` Dave Love
2009-01-08 20:42               ` Reiner Steib
2009-01-07 19:25           ` Ted Zlatanov
2009-01-08 21:04             ` Reiner Steib [this message]
2009-01-13 10:40               ` Dave Love
2009-01-13 17:00                 ` IMAP and Exchange 2007 - imap-fetch-safe (was: FIXMEs in imap.el and nnimap.el) Reiner Steib
2009-01-13 17:20                   ` IMAP and Exchange 2007 - imap-fetch-safe Simon Josefsson
2009-01-17 20:58                     ` Dave Love
2009-01-28  1:18                       ` Dave Love
2009-01-31 15:27                       ` Reiner Steib
2009-02-01 15:43                         ` Bjorn Solberg
2009-02-02 14:54                           ` Dave Goldberg
2009-02-02 19:19                             ` Reiner Steib
2009-02-03 16:21                               ` Stephen J. Turnbull
2009-02-08 18:00                               ` Dave Love
2009-02-08 18:38                                 ` Dave Goldberg
2009-02-02 19:15                           ` Reiner Steib
2009-01-13 18:28                   ` Bjorn Solberg
2009-01-13 20:18                     ` Bjorn Solberg
2009-01-17 20:59                     ` Dave Love
2009-01-04 20:08       ` FIXMEs in imap.el and nnimap.el Dave Love
2009-01-05 16:13       ` Dave Love
2009-01-05 20:35         ` Conventions (was: FIXMEs in imap.el and nnimap.el) Reiner Steib
2009-01-06 11:33           ` Conventions Tassilo Horn

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=878wplcxws.fsf@marauder.physik.uni-ulm.de \
    --to=reinersteib+gmane@imap.cc \
    --cc=Reiner.Steib@gmx.de \
    --cc=ding@gnus.org \
    --cc=fx@gnu.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).