Change M-x imail-input, M-x imail, and M-x imail-get-new-mail to more
authorChris Hanson <org/chris-hanson/cph>
Tue, 30 May 2000 20:21:52 +0000 (20:21 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 30 May 2000 20:21:52 +0000 (20:21 +0000)
closely mimic their RMAIL counterparts.

v7/src/imail/imail-top.scm
v7/src/imail/load.scm

index 0ede75e99873897cf93c2d43024edb6d52a6ac31..ebe5238aebd142eb15883f992aa7cc9908c6fa71 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: imail-top.scm,v 1.112 2000/05/26 18:47:21 cph Exp $
+;;; $Id: imail-top.scm,v 1.113 2000/05/30 20:21:33 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
@@ -159,7 +159,7 @@ regardless of the folder type."
        (if buffer
            (begin
              (select-buffer buffer)
-             ((ref-command imail-get-new-mail)))
+             ((ref-command imail-get-new-mail) #f))
            (begin
              (let ((buffer
                     (new-buffer
@@ -1156,9 +1156,17 @@ An error if signalled if the folder already exists."
          (message "Folder not deleted")))))
 
 (define-command imail-input
+  "Run IMAIL on a specified folder."
+  (lambda ()
+    (list (prompt-for-imail-url-string "Run IMAIL on folder"
+                                      'HISTORY 'IMAIL)))
+  (lambda (url-string)
+    ((ref-command imail) url-string)))
+
+(define-command imail-input-from-folder
   "Append messages to this folder from a specified folder."
   (lambda ()
-    (list (prompt-for-imail-url-string "Input from folder"
+    (list (prompt-for-imail-url-string "Get messages from folder"
                                       'HISTORY 'IMAIL-INPUT
                                       'HISTORY-INDEX 0)))
   (lambda (url-string)
@@ -1175,7 +1183,7 @@ An error if signalled if the folder already exists."
                              "/"
                              (number->string n))
             (lambda () (append-message (get-message from i) to))))
-         ((ref-command imail-get-new-mail))
+         ((ref-command imail-get-new-mail) #f)
          (message (number->string n)
                   " message"
                   (if (= n 1) "" "s")
@@ -1448,34 +1456,45 @@ While composing the reply, use \\[mail-yank-original] to yank the
 (define-command imail-get-new-mail
   "Probe the mail server for new mail.
 Selects the first new message if any new mail.
-Currently useful only for IMAP folders."
-  ()
+ (Currently useful only for IMAP folders.)
+
+You can also specify another folder to get mail from.
+A prefix argument says to prompt for a URL and append all messages
+ from that folder to the current one."
   (lambda ()
-    (let* ((folder (selected-folder))
-          (count (folder-modification-count folder))
-          ;; NAVIGATOR/LAST-MESSAGE must run _after_
-          ;; FOLDER-MODIFICATION-COUNT as it can potentially change
-          ;; its value.  (E.g. when IMAP folder is closed, this
-          ;; reopens it, reads new information from the server, and
-          ;; changes the modification count.)
-          (last (navigator/last-message folder)))
-      (probe-folder folder)
-      (if (> (folder-modification-count folder) count)
-         (select-message
-          folder
-          (or (cond ((not last)
-                     (navigator/first-message folder))
-                    ((message-attached? last folder)
-                     (navigator/next-message last))
-                    ((message-index last)
-                     => (lambda (index)
-                          (let ((index (+ index 1)))
-                            (if (< index (folder-length folder))
-                                (get-message folder index)
-                                (navigator/first-unseen-message folder)))))
-                    (else (navigator/first-unseen-message folder)))
-              (selected-message #f)))
-         (message "(No changes to mail folder)")))))
+    (list (and (command-argument)
+              (prompt-for-imail-url-string "Get messages from folder"
+                                           'HISTORY 'IMAIL-INPUT
+                                           'HISTORY-INDEX 0))))
+  (lambda (url-string)
+    (if url-string
+       (let* ((folder (selected-folder))
+              (count (folder-modification-count folder))
+              ;; NAVIGATOR/LAST-MESSAGE must run _after_
+              ;; FOLDER-MODIFICATION-COUNT as it can potentially change
+              ;; its value.  (E.g. when IMAP folder is closed, this
+              ;; reopens it, reads new information from the server, and
+              ;; changes the modification count.)
+              (last (navigator/last-message folder)))
+         (probe-folder folder)
+         (if (> (folder-modification-count folder) count)
+             (select-message
+              folder
+              (or (cond ((not last)
+                         (navigator/first-message folder))
+                        ((message-attached? last folder)
+                         (navigator/next-message last))
+                        ((message-index last)
+                         => (lambda (index)
+                              (let ((index (+ index 1)))
+                                (if (< index (folder-length folder))
+                                    (get-message folder index)
+                                    (navigator/first-unseen-message
+                                     folder)))))
+                        (else (navigator/first-unseen-message folder)))
+                  (selected-message #f)))
+             (message "(No changes to mail folder)")))
+       ((ref-command imail-input-from-folder) url-string))))
 
 (define-command imail-save-folder
   "Save the currently selected IMAIL folder."
index c6f0498d35747be517e46143d2db68193cd9d96b..7985d214211093fdb22311829e747e24938973b8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: load.scm,v 1.11 2000/05/25 05:06:45 cph Exp $
+;;; $Id: load.scm,v 1.12 2000/05/30 20:21:52 cph Exp $
 ;;;
 ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology
 ;;;
@@ -49,6 +49,7 @@
            edwin-command$imail-forward
            edwin-command$imail-get-new-mail
            edwin-command$imail-input
+           edwin-command$imail-input-from-folder
            edwin-command$imail-kill-flag
            edwin-command$imail-last-message
            edwin-command$imail-mail