From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68036 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: FIXMEs in imap.el and nnimap.el Date: Fri, 02 Jan 2009 16:19:12 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86mye95p27.fsf@lifelogs.com> 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> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1230934780 28209 80.91.229.12 (2 Jan 2009 22:19:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 2 Jan 2009 22:19:40 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M16481@lists.math.uh.edu Fri Jan 02 23:20:49 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 1LIsNs-0005oc-8c for ding-account@gmane.org; Fri, 02 Jan 2009 23:20:48 +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 1LIsMG-00077S-Sv; Fri, 02 Jan 2009 16:19:08 -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 1LIsME-000777-TV for ding@lists.math.uh.edu; Fri, 02 Jan 2009 16:19:06 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LIsMA-0001Aj-Uy for ding@lists.math.uh.edu; Fri, 02 Jan 2009 16:19:06 -0600 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LIsMQ-0004oC-00 for ; Fri, 02 Jan 2009 23:19:18 +0100 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LIsM5-0000ED-Oo for ding@gnus.org; Fri, 02 Jan 2009 22:18:57 +0000 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Jan 2009 22:18:57 +0000 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 02 Jan 2009 22:18:57 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 104 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:r4bX/zftwVM4+AvfBfvRs103qZk= X-Spam-Score: -1.5 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68036 Archived-At: --=-=-= On Thu, 01 Jan 2009 19:55:36 +0100 Reiner Steib wrote: RS> On Tue, Dec 23 2008, Dave Love wrote: >> Sorry it's conflated with some random doc/commentary changes -- I >> should use darcs in parallel... You might want to note or zap the >> `fixme' comments in particular. 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. Ted --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=copyuid+appenduid.merge.patch 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 ! (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 ---- --=-=-=--