Remove nnml-retrieve-groups that is unnecessary and somewhat problematic
[gnus] / lisp / sieve-manage.el
index 23ab241..72f22e7 100644 (file)
@@ -1,6 +1,6 @@
 ;;; sieve-manage.el --- Implementation of the managesieve protocol in elisp
 
-;; Copyright (C) 2001-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2001-2015 Free Software Foundation, Inc.
 
 ;; Author: Simon Josefsson <simon@josefsson.org>
 ;;         Albert Krewinkel <tarleb@moltkeplatz.de>
 
 ;;; Code:
 
-;; For Emacs <22.2 and XEmacs.
-(eval-and-compile
-  (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
-
 (if (locate-library "password-cache")
     (require 'password-cache)
   (require 'password))
                                         plain
                                         login)
   "Priority of authenticators to consider when authenticating to server."
+  ;; FIXME Improve this.  It's not `set'.
+  ;; It's like (repeat (choice (const ...))), where each choice can
+  ;; only appear once.
+  :type '(repeat symbol)
   :group 'sieve-manage)
 
 (defcustom sieve-manage-authenticator-alist
 NAME names the authenticator.  CHECK is a function returning non-nil if
 the server support the authenticator and AUTHENTICATE is a function
 for doing the actual authentication."
+  :type '(repeat (list (symbol :tag "Name") (function :tag "Check function")
+                      (function :tag "Authentication function")))
   :group 'sieve-manage)
 
 (defcustom sieve-manage-default-port "sieve"
@@ -168,6 +170,8 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
 (defvar sieve-manage-capability nil)
 
 ;; Internal utility functions
+(autoload 'mm-enable-multibyte "mm-util")
+
 (defun sieve-manage-make-process-buffer ()
   (with-current-buffer
       (generate-new-buffer (format " *sieve %s:%s*"
@@ -206,15 +210,15 @@ Return the buffer associated with the connection."
          :success "^OK.*\n"
          :return-list t
          :starttls-function
-         '(lambda (capabilities)
-            (when (string-match "\\bSTARTTLS\\b" capabilities)
-              "STARTTLS\r\n")))
+         (lambda (capabilities)
+           (when (string-match "\\bSTARTTLS\\b" capabilities)
+             "STARTTLS\r\n")))
       (setq sieve-manage-process proc)
       (setq sieve-manage-capability
-            (sieve-manage-parse-capability (getf props :capabilities)))
+            (sieve-manage-parse-capability (plist-get props :capabilities)))
       ;; Ignore new capabilities issues after successful STARTTLS
       (when (and (memq stream '(nil network starttls))
-                 (eq (getf props :type) 'tls))
+                 (eq (plist-get props :type) 'tls))
         (sieve-manage-drop-next-answer))
       (current-buffer))))
 
@@ -502,9 +506,9 @@ If NAME is nil, return the full server list of capabilities."
 (defun sieve-manage-parse-capability (str)
   "Parse managesieve capability string `STR'.
 Set variable `sieve-manage-capability' to "
-  (let ((capas (remove-if #'null
-                          (mapcar #'split-string-and-unquote
-                                  (split-string str "\n")))))
+  (let ((capas (delq nil
+                     (mapcar #'split-string-and-unquote
+                             (split-string str "\n")))))
     (when (string= "OK" (caar (last capas)))
       (setq sieve-manage-state 'nonauth))
     capas))