From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68040 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: FIXMEs in imap.el and nnimap.el Date: Fri, 02 Jan 2009 23:57:08 +0100 Message-ID: <878wpt48qj.fsf@marauder.physik.uni-ulm.de> References: <87iqphil5p.fsf@liv.ac.uk> <87ocz3n8d4.fsf@marauder.physik.uni-ulm.de> <87iqpa99wy.fsf@liv.ac.uk> <87wsde7t5j.fsf_-_@marauder.physik.uni-ulm.de> <86mye95p27.fsf@lifelogs.com> Reply-To: Reiner Steib NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1230937064 1740 80.91.229.12 (2 Jan 2009 22:57:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Jan 2009 22:57:44 +0000 (UTC) Cc: Dave Love , ding@gnus.org To: Ted Zlatanov Original-X-From: ding-owner+M16485@lists.math.uh.edu Fri Jan 02 23:58:52 2009 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 1LIsyf-0007wD-V9 for ding-account@gmane.org; Fri, 02 Jan 2009 23:58:50 +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 1LIsxE-0007QF-NI; Fri, 02 Jan 2009 16:57:20 -0600 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1LIsxD-0007Pp-4l for ding@lists.math.uh.edu; Fri, 02 Jan 2009 16:57:19 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LIsx9-0001HW-GL for ding@lists.math.uh.edu; Fri, 02 Jan 2009 16:57:19 -0600 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LIsxP-0005KO-00 for ; Fri, 02 Jan 2009 23:57:31 +0100 Original-Received: from bridgekeeper.physik.uni-ulm.de (bridgekeeper.physik.uni-ulm.de [134.60.10.175]) by mail.uni-ulm.de (8.14.2/8.14.2) with ESMTP id n02MvCsF025757; Fri, 2 Jan 2009 23:57:12 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id 1C68E1352B; Fri, 2 Jan 2009 23:57:12 +0100 (CET) X-Face: 1;h7XMU[7l}$T@J.D}5z*w8Tg'}B5ArAWc8>2X~otB;kOjKs8X%|hTC#dG:%Vpx")x7S/`v :VXU#fZW$X$zdhEU.RfVQ@<-m9IuN{Hm"fW{,5]6kR'M*vEs+{5Cj!L(JTRzA$(},?5J=sm;%Od, Dave Love , ding@gnus.org In-Reply-To: <86mye95p27.fsf@lifelogs.com> (Ted Zlatanov's message of "Fri, 02 Jan 2009 16:19:12 -0600") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-Misty-Metrics: poseidon 1170; Body=3 Fuz1=3 Fuz2=3 X-Virus-Scanned: by amavisd-new X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68040 Archived-At: On Fri, Jan 02 2009, Ted Zlatanov wrote: > On Thu, 01 Jan 2009 19:55:36 +0100 Reiner Steib wrote: > RS> Thanks, I've committed them with minor editing (sorry that this will > RS> cause merge conflicts for you): > RS> > > RS> Would someone take a look at the FIXMEs, please? > > I don't know about the rest of them, but the easy patch, which merges > copyuid and appenduid handling, is appended below. It's really trivial > and the code is almost exactly the same so if someone wants to try it to > verify it works, I'll commit it. I'm confused about '("*" . "*:*") vs. '("*" "*:*"). Shouldn't it be the former in both functions, Dave? --- /tmp/ediff2426614a 2009-01-02 23:42:49.000000000 +0100 +++ /tmp/ediff24266ouU 2009-01-02 23:42:49.000000000 +0100 @@ -1,13 +1,12 @@ -(defun imap-message-copyuid-1 (mailbox) +(defun imap-message-appenduid-1 (mailbox) (if (imap-capability 'UIDPLUS) - (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) - (string-to-number (nth 2 (imap-mailbox-get-1 'copyuid mailbox)))) + (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") + (and (imap-fetch-safe '("*" "*:*") "UID") (list (imap-mailbox-get-1 'uidvalidity mailbox) (apply 'max (imap-message-map (lambda (uid prop) uid) 'UID)))) > Index: imap.el > =================================================================== > RCS file: /usr/local/cvsroot/gnus/lisp/imap.el,v > retrieving revision 7.50 > diff -c -r7.50 imap.el > *** imap.el 1 Jan 2009 18:50:34 -0000 7.50 > --- imap.el 2 Jan 2009 22:14:42 -0000 > *************** > *** 1816,1830 **** > (signal (car data) (cdr data)))))) > > (defun imap-message-copyuid-1 (mailbox) > (if (imap-capability 'UIDPLUS) > ! (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))) > (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)))) > --- 1816,1838 ---- > (signal (car data) (cdr data)))))) > > (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 I'd rather use (defun imap-message-copyuid-1 (mailbox &optional append) or (defun imap-message-appenduid-1 (mailbox &optional copy) and adjust the callers. > ! (list (nth 0 (imap-mailbox-get-1 'copyuid mailbox)) > ! (string-to-number (nth 2 (imap-mailbox-get-1 'copyuid mailbox)))) > ! (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)))) > *************** > *** 1860,1883 **** > (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))))))) > - > (defun imap-message-appenduid (mailbox &optional buffer) > (with-current-buffer (or buffer (current-buffer)) > (imap-message-appenduid-1 (imap-utf7-encode mailbox)))) > --- 1868,1873 ---- > Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/