From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68109 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: Thu, 08 Jan 2009 22:04:19 +0100 Message-ID: <878wplcxws.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> <878wpt48qj.fsf@marauder.physik.uni-ulm.de> <86d4eyvryx.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 1231449566 18810 80.91.229.12 (8 Jan 2009 21:19:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Jan 2009 21:19:26 +0000 (UTC) Cc: Dave Love To: ding@gnus.org Original-X-From: ding-owner+M16554@lists.math.uh.edu Thu Jan 08 22:20:37 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 1LL24k-00049z-3t for ding-account@gmane.org; Thu, 08 Jan 2009 22:05:58 +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 1LL23L-0000Jv-Mx; Thu, 08 Jan 2009 15:04:31 -0600 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 1LL23J-0000JW-Nq for ding@lists.math.uh.edu; Thu, 08 Jan 2009 15:04:29 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1LL23G-0006OZ-H0 for ding@lists.math.uh.edu; Thu, 08 Jan 2009 15:04:29 -0600 Original-Received: from mail.uni-ulm.de ([134.60.1.11]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1LL23W-0003ea-00 for ; Thu, 08 Jan 2009 22:04:42 +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 n08L4NI6005063; Thu, 8 Jan 2009 22:04:23 +0100 (MET) Original-Received: from localhost (localhost [127.0.0.1]) by bridgekeeper.physik.uni-ulm.de (Postfix) with ESMTP id DFDCA13556; Thu, 8 Jan 2009 22:04:22 +0100 (CET) X-Face: mtjf/D:es1T0wHO:&CJ'ZXe"l;3C--rw\z!{`eFwL){|]RpI+4{u25L=5C /0>KuGeTsk<~<&NE-AKV1560e!+RJeyWmSskkrJm?[vUV#66{T_m|Ae<||Ku#Mk5`y&O`n~z2;n8eP J5#2h@2eQgV@E70IY_0WlEx!"&giy{+\%h1LJox$zv@/l%ZmU4^tZA>xQpnkUBVC5.jpg#0'(+2?Rs )NAr:>3<=WxHE$ktbLysDIM5TbmHu*3 In-Reply-To: <86d4eyvryx.fsf@lifelogs.com> (Ted Zlatanov's message of "Wed, 07 Jan 2009 13:25:26 -0600") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.1 (gnu/linux) X-DCC-INFN-TO-Metrics: poseidon 1233; Body=2 Fuz1=2 Fuz2=2 X-Virus-Scanned: by amavisd-new X-Spam-Score: -2.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68109 Archived-At: On Wed, Jan 07 2009, Ted Zlatanov wrote: > On Fri, 02 Jan 2009 23:57:08 +0100 Reiner Steib 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/