changeset 110215:1a9f718ae483

nnimap.el (nnimap-debug): Removed; imap.el: Remove an optional buffer parameter from many functions.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Mon, 06 Sep 2010 00:06:55 +0000
parents b6a0e73c6b46
children 6f3cc5774150
files lisp/ChangeLog lisp/gnus/ChangeLog lisp/gnus/nnimap.el lisp/net/imap.el
diffstat 4 files changed, 54 insertions(+), 110 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Sep 05 23:56:42 2010 +0000
+++ b/lisp/ChangeLog	Mon Sep 06 00:06:55 2010 +0000
@@ -1,3 +1,13 @@
+2010-09-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+	* net/imap.el (imap-message-map): Removed optional buffer parameter,
+	since no callers use it.
+	(imap-message-get): Ditto.
+	(imap-message-put): Ditto.
+	(imap-mailbox-map): Ditto.
+	(imap-mailbox-put): Ditto.
+	(imap-mailbox-get): Ditto.
+
 2010-09-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* net/imap.el (imap-fetch-safe): Removed function, and altered all
--- a/lisp/gnus/ChangeLog	Sun Sep 05 23:56:42 2010 +0000
+++ b/lisp/gnus/ChangeLog	Mon Sep 06 00:06:55 2010 +0000
@@ -2,6 +2,7 @@
 
 	* nnimap.el (nnimap-request-list): Servers may return \NoSelect
 	case-insensitively.
+	(nnimap-debug): Removed.
 
 	* mail-source.el (mail-source-fetch): Don't message if we're fetching
 	mail from a file, and the file doesn't exist.
--- a/lisp/gnus/nnimap.el	Sun Sep 05 23:56:42 2010 +0000
+++ b/lisp/gnus/nnimap.el	Mon Sep 06 00:06:55 2010 +0000
@@ -589,10 +589,11 @@
 	(let (minuid maxuid)
 	  (when (> (imap-mailbox-get 'exists) 0)
 	    (imap-fetch "1:*" "UID" nil 'nouidfetch)
-	    (imap-message-map (lambda (uid Uid)
-				(setq minuid (if minuid (min minuid uid) uid)
-				      maxuid (if maxuid (max maxuid uid) uid)))
-			      'UID))
+	    (imap-message-map
+	     (lambda (uid Uid)
+	       (setq minuid (if minuid (min minuid uid) uid)
+		     maxuid (if maxuid (max maxuid uid) uid)))
+	     'UID))
 	  (list (imap-mailbox-get 'exists) minuid maxuid))))))
 
 (defun nnimap-possibly-change-group (group &optional server)
@@ -1813,68 +1814,6 @@
   "Return t if MARK can be permanently (between IMAP sessions) saved on articles, in GROUP."
   (imap-message-flag-permanent-p (nnimap-mark-to-flag mark)))
 
-(when nnimap-debug
-  (require 'trace)
-  (buffer-disable-undo (get-buffer-create nnimap-debug-buffer))
-  (mapc (lambda (f) (trace-function-background f nnimap-debug-buffer))
-	'(
-	  nnimap-possibly-change-server
-	  nnimap-verify-uidvalidity
-	  nnimap-find-minmax-uid
-	  nnimap-before-find-minmax-bugworkaround
-	  nnimap-possibly-change-group
-	  ;;nnimap-replace-whitespace
-	  nnimap-retrieve-headers-progress
-	  nnimap-retrieve-which-headers
-	  nnimap-group-overview-filename
-	  nnimap-retrieve-headers-from-file
-	  nnimap-retrieve-headers-from-server
-	  nnimap-retrieve-headers
-	  nnimap-open-connection
-	  nnimap-open-server
-	  nnimap-server-opened
-	  nnimap-close-server
-	  nnimap-request-close
-	  nnimap-status-message
-	  ;;nnimap-demule
-	  nnimap-request-article-part
-	  nnimap-request-article
-	  nnimap-request-head
-	  nnimap-request-body
-	  nnimap-request-group
-	  nnimap-close-group
-	  nnimap-pattern-to-list-arguments
-	  nnimap-request-list
-	  nnimap-request-post
-	  nnimap-retrieve-groups
-	  nnimap-request-update-info-internal
-	  nnimap-request-type
-	  nnimap-request-set-mark
-	  nnimap-split-to-groups
-	  nnimap-split-find-rule
-	  nnimap-split-find-inbox
-	  nnimap-split-articles
-	  nnimap-request-scan
-	  nnimap-request-newgroups
-	  nnimap-request-create-group
-	  nnimap-time-substract
-	  nnimap-date-days-ago
-	  nnimap-request-expire-articles-progress
-	  nnimap-request-expire-articles
-	  nnimap-request-move-article
-	  nnimap-request-accept-article
-	  nnimap-request-delete-group
-	  nnimap-request-rename-group
-	  gnus-group-nnimap-expunge
-	  gnus-group-nnimap-edit-acl
-	  gnus-group-nnimap-edit-acl-done
-	  nnimap-group-mode-hook
-	  nnimap-mark-to-predicate
-	  nnimap-mark-to-flag-1
-	  nnimap-mark-to-flag
-	  nnimap-mark-permanent-p
-	  )))
-
 (provide 'nnimap)
 
 ;;; nnimap.el ends here
--- a/lisp/net/imap.el	Sun Sep 05 23:56:42 2010 +0000
+++ b/lisp/net/imap.el	Mon Sep 06 00:06:55 2010 +0000
@@ -1303,40 +1303,37 @@
 
 ;; Mailbox functions:
 
-(defun imap-mailbox-put (propname value &optional mailbox buffer)
-  (with-current-buffer (or buffer (current-buffer))
-    (if imap-mailbox-data
-	(put (intern (or mailbox imap-current-mailbox) imap-mailbox-data)
-	     propname value)
-      (error "Imap-mailbox-data is nil, prop %s value %s mailbox %s buffer %s"
-	     propname value mailbox (current-buffer)))
-    t))
+(defun imap-mailbox-put (propname value &optional mailbox)
+  (if imap-mailbox-data
+      (put (intern (or mailbox imap-current-mailbox) imap-mailbox-data)
+	   propname value)
+    (error "Imap-mailbox-data is nil, prop %s value %s mailbox %s buffer %s"
+	   propname value mailbox (current-buffer)))
+  t)
 
 (defsubst imap-mailbox-get-1 (propname &optional mailbox)
   (get (intern-soft (or mailbox imap-current-mailbox) imap-mailbox-data)
        propname))
 
-(defun imap-mailbox-get (propname &optional mailbox buffer)
-  (let ((mailbox (imap-utf7-encode mailbox)))
-    (with-current-buffer (or buffer (current-buffer))
-      (imap-mailbox-get-1 propname (or mailbox imap-current-mailbox)))))
+(defun imap-mailbox-get (propname &optional mailbox)
+  (imap-mailbox-get-1 propname (or (imap-utf7-encode mailbox)
+				   imap-current-mailbox)))
 
-(defun imap-mailbox-map-1 (func &optional mailbox-decoder buffer)
-  (with-current-buffer (or buffer (current-buffer))
-    (let (result)
-      (mapatoms
-       (lambda (s)
-	 (push (funcall func (if mailbox-decoder
-				 (funcall mailbox-decoder (symbol-name s))
-			       (symbol-name s))) result))
-       imap-mailbox-data)
-      result)))
+(defun imap-mailbox-map-1 (func &optional mailbox-decoder)
+  (let (result)
+    (mapatoms
+     (lambda (s)
+       (push (funcall func (if mailbox-decoder
+			       (funcall mailbox-decoder (symbol-name s))
+			     (symbol-name s))) result))
+     imap-mailbox-data)
+    result))
 
-(defun imap-mailbox-map (func &optional buffer)
+(defun imap-mailbox-map (func)
   "Map a function across each mailbox in `imap-mailbox-data', returning a list.
 Function should take a mailbox name (a string) as
 the only argument."
-  (imap-mailbox-map-1 func 'imap-utf7-decode buffer))
+  (imap-mailbox-map-1 func 'imap-utf7-decode))
 
 (defun imap-current-mailbox (&optional buffer)
   (with-current-buffer (or buffer (current-buffer))
@@ -1650,29 +1647,26 @@
 		    uids)
 	  (imap-message-get uids receive))))))
 
-(defun imap-message-put (uid propname value &optional buffer)
-  (with-current-buffer (or buffer (current-buffer))
-    (if imap-message-data
-	(put (intern (number-to-string uid) imap-message-data)
-	     propname value)
-      (error "Imap-message-data is nil, uid %s prop %s value %s buffer %s"
-	     uid propname value (current-buffer)))
-    t))
+(defun imap-message-put (uid propname value)
+  (if imap-message-data
+      (put (intern (number-to-string uid) imap-message-data)
+	   propname value)
+    (error "Imap-message-data is nil, uid %s prop %s value %s buffer %s"
+	   uid propname value (current-buffer)))
+  t)
 
-(defun imap-message-get (uid propname &optional buffer)
-  (with-current-buffer (or buffer (current-buffer))
-    (get (intern-soft (number-to-string uid) imap-message-data)
-	 propname)))
+(defun imap-message-get (uid propname)
+  (get (intern-soft (number-to-string uid) imap-message-data)
+       propname))
 
-(defun imap-message-map (func propname &optional buffer)
+(defun imap-message-map (func propname)
   "Map a function across each message in `imap-message-data', returning a list."
-  (with-current-buffer (or buffer (current-buffer))
-    (let (result)
-      (mapatoms
-       (lambda (s)
-	 (push (funcall func (get s 'UID) (get s propname)) result))
-       imap-message-data)
-      result)))
+  (let (result)
+    (mapatoms
+     (lambda (s)
+       (push (funcall func (get s 'UID) (get s propname)) result))
+     imap-message-data)
+    result))
 
 (defmacro imap-message-envelope-date (uid &optional buffer)
   `(with-current-buffer (or ,buffer (current-buffer))