Bind RET and TAB on images for better UX.
[gnus] / lisp / pop3.el
index ed311aa..a5470d7 100644 (file)
@@ -33,6 +33,7 @@
 
 ;;; Code:
 
+(eval-when-compile (require 'cl))
 (require 'mail-utils)
 (defvar parse-time-months)
 
@@ -145,7 +146,8 @@ Use streaming commands."
        (unless pop3-leave-mail-on-server
          (pop3-send-streaming-command
           process "DELE" message-count nil))))
-    (pop3-quit process)))
+    (pop3-quit process)
+    t))
 
 (defun pop3-send-streaming-command (process command count total-size)
   (erase-buffer)
@@ -203,7 +205,7 @@ Use streaming commands."
   (let ((responses 0))
     (save-excursion
       (goto-char (point-min))
-      (while (or (and (re-search-forward "^\\+OK " nil t)
+      (while (or (and (re-search-forward "^\\+OK" nil t)
                      (or (not endp)
                          (re-search-forward "^\\.\r?\n" nil t)))
                 (re-search-forward "^-ERR " nil t))
@@ -301,6 +303,13 @@ this is nil, `ssl' is assumed for connexions to port
                 (const :tag "SSL/TLS" ssl)
                 (const starttls)))
 
+(eval-and-compile
+  (if (fboundp 'set-process-query-on-exit-flag)
+      (defalias 'pop3-set-process-query-on-exit-flag
+       'set-process-query-on-exit-flag)
+    (defalias 'pop3-set-process-query-on-exit-flag
+      'process-kill-without-query)))
+
 (defun pop3-open-server (mailhost port)
   "Open TCP connection to MAILHOST on PORT.
 Returns the process associated with the connection."
@@ -361,7 +370,7 @@ Returns the process associated with the connection."
        (setq pop3-timestamp
              (substring response (or (string-match "<" response) 0)
                         (+ 1 (or (string-match ">" response) -1)))))
-      (set-process-query-on-exit-flag process nil)
+      (pop3-set-process-query-on-exit-flag process nil)
       process)))
 
 ;; Support functions