From: Paul Reilly Date: Fri, 29 Aug 2008 04:27:46 +0000 (+0000) Subject: Resolve all byte compiler warnings and enable IMAP/movemail support. X-Git-Tag: emacs-pretest-23.0.90~3191 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=acdc20068b4f6947ba5af2ab3880381a3af53d4b;p=emacs.git Resolve all byte compiler warnings and enable IMAP/movemail support. --- diff --git a/lisp/mail/pmail.el b/lisp/mail/pmail.el index 712a921d27f..09ec42d13e3 100644 --- a/lisp/mail/pmail.el +++ b/lisp/mail/pmail.el @@ -2,7 +2,7 @@ ;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 -;; Free Software Foundation, Inc. +; Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: mail @@ -199,6 +199,11 @@ please report it with \\[report-emacs-bug].") (declare-function mail-position-on-field "sendmail" (field &optional soft)) (declare-function mail-text-start "sendmail" ()) (declare-function pmail-update-summary "pmailsum" (&rest ignore)) +(declare-function unrmail "unrmail" (file to-file)) +(declare-function rmail-dont-reply-to "mail-utils" (destinations)) +(declare-function pmail-summary-goto-msg "pmailsum" (&optional n nowarn skip-pmail)) +(declare-function pmail-summary-pmail-update "pmailsum" ()) +(declare-function pmail-summary-update "pmailsum" (n)) (defun pmail-probe (prog) "Determine what flavor of movemail PROG is. @@ -289,20 +294,20 @@ It is useful to set this variable in the site customization file.") ;;;###autoload (defcustom pmail-ignored-headers (concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:" - "\\|^status:\\|^received:\\|^content-transfer-encoding:" - "\\|^x400-\\(received\\|mts-identifier\\|content-type\\|originator\\|recipients\\):" - "\\|^list-\\(help\\|post\\|subscribe\\|id\\|unsubscribe\\|archive\\):" - "\\|^resent-\\(face\\|x-.*\\|organization\\|openpgp\\|date\\|message-id\\):" - "\\|^thread-\\(topic\\|index\\)" - "\\|^summary-line:\\|^precedence:\\|^message-id:" - "\\|^path:\\|^face:\\|^delivered-to:\\|^lines:" - "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:" - "\\|^content-\\(length\\|type\\|class\\|disposition\\):" + "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:" + "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:" + "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:" "\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^face:" + "\\|^x-mailer:\\|^delivered-to:\\|^lines:" + "\\|^content-transfer-encoding:\\|^x-coding-system:" + "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:" + "\\|^precedence:\\|^list-help:\\|^list-post:\\|^list-subscribe:" + "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:" + "\\|^content-length:\\|^nntp-posting-date:\\|^user-agent" "\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:" - "\\|^mbox-line:\\|^cancel-lock:\\|^in-reply-to:\\|^comment:" - "\\|^x-.*:\\|^domainkey-signature:" - "\\|^original-recipient:\\|^from ") + "\\|^mbox-line:\\|^cancel-lock:\\|^DomainKey-Signature:" + "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:" + "\\|^x-.*:\\|^domainkey-signature:\\|^original-recipient:\\|^from ") "*Regexp to match header fields that Pmail should normally hide. \(See also `pmail-nonignored-headers', which overrides this regexp.) This variable is used for reformatting the message header, @@ -867,7 +872,7 @@ If `pmail-display-summary' is non-nil, make a summary for this PMAIL file." (unwind-protect (progn (write-region (point-min) (point-max) old-file) - (unpmail old-file new-file) + (unrmail old-file new-file) (message "Replacing BABYL format with mbox format...") (let ((inhibit-read-only t)) (erase-buffer) @@ -1609,9 +1614,9 @@ is non-nil if the user has supplied the password interactively. (or pass supplied-password) got-password) (error "Emacs movemail does not support %s protocol" proto)) - (list file + (list (concat proto "://" user "@" host) (or (string-equal proto "pop") (string-equal proto "imap")) - supplied-password + (or supplied-password pass) got-password)))) ((string-match "^po:\\([^:]+\\)\\(:\\(.*\\)\\)?" file) @@ -1655,9 +1660,9 @@ is non-nil if the user has supplied the password interactively. ;; in case of multiple inboxes that need moving. (concat ".newmail-" (file-name-nondirectory - (if (memq system-type '(windows-nt cygwin)) - ;; cannot have "po:" in file name - (substring file 3) + (if (memq system-type '(windows-nt cygwin ms-dos)) + ;; cannot have colons in file name + (replace-regexp-in-string ":" "-" file) file))) ;; Use the directory of this pmail file ;; because it's a nuisance to use the homedir @@ -1695,7 +1700,7 @@ is non-nil if the user has supplied the password interactively. (buffer-disable-undo errors) (let ((args (append - (list pmail-movemail-program nil errors nil) + (list (or pmail-movemail-program "movemail") nil errors nil) (if pmail-preserve-inbox (list "-p") nil) @@ -2747,15 +2752,15 @@ use \\[mail-yank-original] to yank the original message into it." ;; Remove unwanted names from reply-to, since Mail-Followup-To ;; header causes all the names in it to wind up in reply-to, not ;; in cc. But if what's left is an empty list, use the original. - (let* ((reply-to-list (pmail-dont-reply-to reply-to))) + (let* ((reply-to-list (rmail-dont-reply-to reply-to))) (if (string= reply-to-list "") reply-to reply-to-list)) subject (pmail-make-in-reply-to-field from date message-id) (if just-sender nil ;; mail-strip-quoted-names is NOT necessary for - ;; pmail-dont-reply-to to do its job. - (let* ((cc-list (pmail-dont-reply-to + ;; rmail-dont-reply-to to do its job. + (let* ((cc-list (rmail-dont-reply-to (mail-strip-quoted-names (if (null cc) to (concat to ", " cc)))))) (if (string= cc-list "") nil cc-list))) @@ -3099,20 +3104,12 @@ specifying headers which should not be copied into the new message." ;; Now start sending new message; default header fields from original. ;; Turn off the usual actions for initializing the message body ;; because we want to get only the text from the failure message. - ;; - ;; NOTE: the use of pmail-msgref-vector is a red flag. I'm not - ;; sure (yet) what the right thing to do here is but I strongly - ;; suspect it needs something along the lines of: - ;; ...(pmail-desc-set-attribute pmail-desc-resent-index nil n)... - ;; The test to run to see the breakage and figure out what needs - ;; to be done is to cause a "resend" to happen and verify that it - ;; is either broken or works properly. For now the unbound - ;; variable is being left intact. -pmr 8/12/2008 (let (mail-signature mail-setup-hook) (if (pmail-start-mail nil nil nil nil nil pmail-this-buffer (list (list 'pmail-mark-message pmail-this-buffer - (aref pmail-msgref-vector msgnum) + (with-current-buffer pmail-buffer + (pmail-desc-get-start msgnum)) "retried"))) ;; Insert original text as initial text of new draft message. ;; Bind inhibit-read-only since the header delimiter diff --git a/lisp/mail/pmaildesc.el b/lisp/mail/pmaildesc.el index a6f5d6cc4bd..09887d4b76a 100644 --- a/lisp/mail/pmaildesc.el +++ b/lisp/mail/pmaildesc.el @@ -30,6 +30,9 @@ (require 'pmailhdr) +;; External function declarations +(declare-function pmail-narrow-to-header "pmail" (msg)) + (defvar pmail-desc-attributes nil "A private variable providing temporary access to message attributes.") diff --git a/lisp/mail/pmailhdr.el b/lisp/mail/pmailhdr.el index ca8da65ae3e..c626ce88ff2 100644 --- a/lisp/mail/pmailhdr.el +++ b/lisp/mail/pmailhdr.el @@ -173,7 +173,7 @@ The current buffer, possibly narrowed, contains a single message." "Show all headers. The current buffer, possibly narrowed, contains a single message." ;; Remove all the overlays used to control hiding headers. - (mapcar 'delete-overlay pmail-header-overlay-list) + (mapc 'delete-overlay pmail-header-overlay-list) (setq pmail-header-display-state nil)) (defun pmail-header-toggle-visibility (&optional arg) diff --git a/lisp/mail/pmailkwd.el b/lisp/mail/pmailkwd.el index 69300c975ae..485c4ddc65f 100644 --- a/lisp/mail/pmailkwd.el +++ b/lisp/mail/pmailkwd.el @@ -41,8 +41,6 @@ ;; completion. It is better to use strings with the label functions ;; and let them worry about making the label. -(provide 'pmailkwd) - (eval-when-compile (require 'mail-utils)) @@ -61,6 +59,25 @@ These have a well-defined meaning to the PMAIL system.") "Keywords used to label messages. These are all user-defined, unlike `pmail-attributes'.") + +;; External library declarations. +(declare-function mail-comma-list-regexp "mail-utils" (labels)) +(declare-function mail-parse-comma-list "mail-utils" ()) +(declare-function pmail-desc-add-keyword "pmaildesc" (keyword n)) +(declare-function pmail-desc-get-end "pmaildesc" (n)) +(declare-function pmail-desc-get-keywords "pmaildesc" (n)) +(declare-function pmail-desc-get-start "pmaildesc" (n)) +(declare-function pmail-desc-remove-keyword "pmaildesc" (keyword n)) +(declare-function pmail-display-labels "pmail" ()) +(declare-function pmail-maybe-set-message-counters "pmail" ()) +(declare-function pmail-message-labels-p "pmail" (msg labels)) +(declare-function pmail-msgbeg "pmail" (n)) +(declare-function pmail-set-attribute "pmail" (attr state &optional msgnum)) +(declare-function pmail-set-message-deleted-p "pmail" (n state)) +(declare-function pmail-show-message "pmail" (&optional n no-summary)) +(declare-function pmail-summary-exists "pmail" ()) +(declare-function pmail-summary-update "pmailsum" (n)) + ;;;; Low-level functions. (defun pmail-attribute-p (s) @@ -143,15 +160,6 @@ message." ;; return the string, not the symbol result))) -(declare-function pmail-maybe-set-message-counters "pmail" ()) -(declare-function pmail-display-labels "pmail" ()) -(declare-function pmail-msgbeg "pmail" (n)) -(declare-function pmail-set-message-deleted-p "pmail" (n state)) -(declare-function pmail-message-labels-p "pmail" (msg labels)) -(declare-function pmail-show-message "pmail" (&optional n no-summary)) -(declare-function mail-comma-list-regexp "mail-utils" (labels)) -(declare-function mail-parse-comma-list "mail-utils.el" ()) - (defun pmail-set-label (l state &optional n) "Add or remove label L in message N. The label L is added when STATE is non-nil, otherwise it is @@ -175,7 +183,7 @@ current buffer, possibly narrowed, displays a message." (pmail-desc-remove-keyword str n)))))) (pmail-display-labels) ;; Deal with the summary buffer. - (when pmail-summary-buffer + (when (pmail-summary-exists) (pmail-summary-update n))) ;; Motion on messages with keywords. @@ -223,5 +231,7 @@ With prefix argument N moves forward N messages with these labels." (when (> n 0) (message "No following message with labels %s" labels))))) +(provide 'pmailkwd) + ;; arch-tag: 1149979c-8e47-4333-9629-cf3dc887a6a7 ;;; pmailkwd.el ends here diff --git a/lisp/mail/pmailmm.el b/lisp/mail/pmailmm.el index 4b9337ded2f..551b12876be 100644 --- a/lisp/mail/pmailmm.el +++ b/lisp/mail/pmailmm.el @@ -39,6 +39,9 @@ ;;; Code: +;; For ... +(require 'pmail) + ;;; Variables (defcustom pmail-mime-media-type-handlers-alist @@ -190,10 +193,11 @@ format." ;; of the preceding part. ;; We currently don't handle that. (let ((boundary (cdr (assq 'boundary content-type))) - beg next) + beg end next) (unless boundary - (error "No boundary defined" content-type content-disposition - content-transfer-encoding)) + (pmail-mm-get-boundary-error-message + "No boundary defined" content-type content-disposition + content-transfer-encoding)) (setq boundary (concat "\n--" boundary)) ;; Hide the body before the first bodypart (goto-char (point-min)) @@ -216,8 +220,9 @@ format." ((looking-at "[ \t]*\n") (setq next (copy-marker (match-end 0)))) (t - (error "Malformed boundary" content-type - content-disposition content-transfer-encoding))) + (pmail-mm-get-boundary-error-message + "Malformed boundary" content-type content-disposition + content-transfer-encoding))) (delete-region end next) ;; Handle the part. (save-match-data @@ -396,6 +401,11 @@ This calls `pmail-mime-show' to do the real job." (pmail-mime-show t)) (view-buffer buf))) +(defun pmail-mm-get-boundary-error-message (message type disposition encoding) + "Return MESSAGE with more information on the main mime components." + (error "%s; type: %s; disposition: %s; encoding: %s" + message type disposition encoding)) + (provide 'pmailmm) ;; arch-tag: 3f2c5e5d-1aef-4512-bc20-fd737c9d5dd9 diff --git a/lisp/mail/pmailmsc.el b/lisp/mail/pmailmsc.el index 407e25ede4f..4cb782a0786 100644 --- a/lisp/mail/pmailmsc.el +++ b/lisp/mail/pmailmsc.el @@ -31,6 +31,7 @@ (defvar pmail-current-message) (defvar pmail-inbox-list) +(declare-function mail-parse-comma-list "mail-utils" ()) (declare-function pmail-parse-file-inboxes "pmail" ()) (declare-function pmail-show-message "pmail" (&optional n no-summary)) diff --git a/lisp/mail/pmailsort.el b/lisp/mail/pmailsort.el index 69e626f5c06..91d93bc12a7 100644 --- a/lisp/mail/pmailsort.el +++ b/lisp/mail/pmailsort.el @@ -33,6 +33,11 @@ (autoload 'timezone-make-date-sortable "timezone") +(declare-function pmail-dont-reply-to "mail-utils" (destinations)) +(declare-function pmail-desc-get-marker-end "pmailsort" (msgnum)) +(declare-function pmail-desc-get-marker-start "pmailsort" (msgnum)) +(declare-function pmail-update-summary "pmailsum" (&rest ignore)) + ;; Sorting messages in Pmail buffer ;;;###autoload @@ -151,8 +156,6 @@ KEYWORDS is a comma-separated list of labels." ;; Basic functions -(declare-function pmail-update-summary "pmailsum" (&rest ignore)) - (defun pmail-sort-messages (reverse keyfun) "Sort messages of current Pmail file. If 1st argument REVERSE is non-nil, sort them in reverse order. diff --git a/lisp/mail/pmailsum.el b/lisp/mail/pmailsum.el index 4dc3682a6f0..224d1480e1b 100644 --- a/lisp/mail/pmailsum.el +++ b/lisp/mail/pmailsum.el @@ -213,6 +213,15 @@ map) "Keymap for `pmail-summary-mode'.") +(declare-function pmail-abort-edit "pmailedit" ()) +(declare-function pmail-cease-edit "pmailedit"()) +(declare-function pmail-set-label "pmailkwd" (l state &optional n)) +(declare-function pmail-output-read-file-name "pmailout" ()) +(declare-function pmail-output-read-pmail-file-name "pmailout" ()) +(declare-function mail-comma-list-regexp "mail-utils" (labels)) +(declare-function mail-send-and-exit "sendmail" (&optional arg)) +(declare-function mail-strip-quoted-names "mail-utils" (address)) + ;; Entry points for making a summary buffer. ;; Regenerate the contents of the summary @@ -1053,13 +1062,6 @@ argument says to read a file name and use that file as the inbox." (end-of-buffer)) (forward-line -1)) -(declare-function pmail-abort-edit "pmailedit" ()) -(declare-function pmail-cease-edit "pmailedit"()) -(declare-function pmail-set-label "pmailkwd" (l state &optional n)) -(declare-function pmail-output-read-file-name "pmailout" ()) -(declare-function pmail-output-read-pmail-file-name "pmailout" ()) -(declare-function mail-send-and-exit "sendmail" (&optional arg)) - (defvar pmail-summary-edit-map (let ((map (nconc (make-sparse-keymap) text-mode-map))) (define-key map "\C-c\C-c" 'pmail-cease-edit)