diff options
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/gnus/ChangeLog | 86 | ||||
-rw-r--r-- | lisp/gnus/gmm-utils.el | 6 | ||||
-rw-r--r-- | lisp/gnus/gnus-util.el | 10 | ||||
-rw-r--r-- | lisp/gnus/ietf-drums.el | 1 | ||||
-rw-r--r-- | lisp/gnus/message.el | 59 | ||||
-rw-r--r-- | lisp/gnus/mm-decode.el | 12 | ||||
-rw-r--r-- | lisp/gnus/mm-encode.el | 2 | ||||
-rw-r--r-- | lisp/gnus/mml-sec.el | 4 | ||||
-rw-r--r-- | lisp/gnus/mml.el | 7 | ||||
-rw-r--r-- | lisp/gnus/mml1991.el | 7 | ||||
-rw-r--r-- | lisp/gnus/mml2015.el | 8 | ||||
-rw-r--r-- | lisp/gnus/nneething.el | 1 | ||||
-rw-r--r-- | lisp/gnus/nnheader.el | 7 | ||||
-rw-r--r-- | lisp/gnus/nnimap.el | 11 | ||||
-rw-r--r-- | lisp/gnus/nntp.el | 12 | ||||
-rw-r--r-- | lisp/gnus/rfc2047.el | 5 | ||||
-rw-r--r-- | lisp/gnus/sieve-mode.el | 6 | ||||
-rw-r--r-- | lisp/gnus/spam-stat.el | 5 | ||||
-rw-r--r-- | lisp/password-cache.el | 8 | ||||
-rw-r--r-- | lisp/url/ChangeLog | 4 | ||||
-rw-r--r-- | lisp/url/url.el | 7 |
22 files changed, 224 insertions, 49 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6f2f2e5105..4cdff3848be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-03-19 Glenn Morris <rgm@gnu.org> + + * password-cache.el (password-cache, password-cache-expiry): + Autoload. + 2010-03-18 Glenn Morris <rgm@gnu.org> * emacs-lisp/autoload.el (autoload-rubric): Doc fix. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index f71c7a4300b..8a3aee285d1 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,89 @@ +2010-03-19 Glenn Morris <rgm@gnu.org> + + Stop message.el from loading about 40 libraries it doesn't always need. + The general approach is to autoload rather than require, and to + require in the specific functions rather than the file. (Bug#5642) + + * gmm-utils.el: Don't require wid-edit. + (widget-create-child-value, widget-convert, widget-default-get): + Autoload. + + * gnus-util.el: Don't require time-date, netrc. + (message-fetch-field, gnus-group-name-decode): Declare rather than + autoloading. + (gnus-fetch-field): Require message. + (gnus-decode-newsgroups): Require gnus-group. + + * ietf-drums.el: Don't require time-date. + + * message.el: Don't require hashcash, canlock, ecomplete. + Do require mail-utils. Require nnheader only when compiling. + (smtpmail-default-smtp-server): Remove declaration. + (message-send-mail-function): Check smtpmail-default-smtp-server + is bound rather than requiring smtpmail. + (message-auto-save-directory, message-insert-signature): Use + expand-file-name rather than nnheader-concat. + (nnheader-insert-file-contents): Autoload. + (hashcash-wait-async): Declare. + (message-send-mail): Only call gnus-setup-posting-charset if + gnus-group-posting-charset-alist is bound. Require hashcash if needed. + (message-send-mail-with-sendmail): Require sendmail. + (canlock-password, canlock-password-for-verify): Declare. + (message-canlock-password): Require canlock. + (nnheader-get-report): Autoload. + (gnus-setup-posting-charset): Declare. + (message-send-news): Require gnus-msg. + (message-make-references, message-make-in-reply-to): Use mail-header-id + rather than the alias mail-header-message-id. + (ecomplete-add-item, ecomplete-save): Declare. + (message-put-addresses-in-ecomplete): Require ecomplete. + (ecomplete-display-matches): Autoload. + + * mm-decode.el: Don't require mailcap, gnus-util. + (gnus-map-function, gnus-replace-in-string, gnus-read-shell-command) + (message-fetch-field, mailcap-parse-mailcaps, mailcap-mime-info): + Autoload. + (mailcap-mime-extensions): Declare. + + * mm-encode.el: Don't require mailcap. + (mailcap-extension-to-mime): Autoload. + + * mml-sec.el: Don't require password-cache. + + * mml.el (gnus-setup-posting-charset): Declare rather than autoload. + (mailcap-parse-mimetypes, mailcap-mime-types): Declare. + (mml-minibuffer-read-type): Require mailcap. + (mml-preview): Require gnus-msg. + + * mml1991.el: Require password-cache. + (password-cache-expiry): Remove declaration. + + * mml2015.el: Require password-cache. + (password-cache-expiry): Remove declaration. + + * nneething.el (mailcap): Require mailcap. + + * nnheader.el: (declare-function): Add compatibility stub. + (message-remove-header): Declare rather than autoload. + (nnheader-replace-header): Require message. + + * nnimap.el (declare-function): Add compatibility stub. + (netrc-parse, netrc-machine-user-or-password): Declare. + (nnimap-open-connection): Require netrc. + + * nntp.el (declare-function): Add compatibility stub. + (netrc-parse, netrc-machine, netrc-get): Declare. + (nntp-send-authinfo): Require netrc. + + * rfc2047.el: Don't require qp. + (quoted-printable-encode-region, quoted-printable-decode-string): + Autoload. + + * sieve-mode.el: Don't require easymenu. + (easy-menu-add-item): Autoload it. + + * spam-stat.el (time-to-number-of-days): Autoload it. + 2010-03-17 Kevin Ryde <user42@zip.com.au> * mml.el (mml-read-tag): Unquote values with `read' to reverse diff --git a/lisp/gnus/gmm-utils.el b/lisp/gnus/gmm-utils.el index b44d3c08c4a..640eb50a022 100644 --- a/lisp/gnus/gmm-utils.el +++ b/lisp/gnus/gmm-utils.el @@ -28,8 +28,6 @@ ;;; Code: -(require 'wid-edit) - (defgroup gmm nil "Utility functions for Gnus, Message and MML." :prefix "gmm-" @@ -95,6 +93,10 @@ ARGS are passed to `message'." "Non-nil if SYMBOL is a widget." (get symbol 'widget-type)) +(autoload 'widget-create-child-value "wid-edit") +(autoload 'widget-convert "wid-edit") +(autoload 'widget-default-get "wid-edit") + ;; Copy of the `nnmail-lazy' code from `nnmail.el': (define-widget 'gmm-lazy 'default "Base widget for recursive datastructures. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index d101047280c..f011cda31a4 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -53,10 +53,6 @@ (defvar gnus-original-article-buffer) (defvar gnus-user-agent) -(require 'time-date) -(require 'netrc) - -(autoload 'message-fetch-field "message") (autoload 'gnus-get-buffer-window "gnus-win") (autoload 'nnheader-narrow-to-headers "nnheader") (autoload 'nnheader-replace-chars-in-string "nnheader") @@ -206,8 +202,11 @@ Uses `gnus-extract-address-components'." Uses `gnus-extract-address-components'." (nth 1 (gnus-extract-address-components from))) +(declare-function message-fetch-field "message" (header &optional not-all)) + (defun gnus-fetch-field (field) "Return the value of the header FIELD of current article." + (require 'message) (save-excursion (save-restriction (let ((inhibit-point-motion-hooks t)) @@ -228,13 +227,14 @@ Uses `gnus-extract-address-components'." (point))))) (declare-function gnus-find-method-for-group "gnus" (group &optional info)) -(autoload 'gnus-group-name-decode "gnus-group") +(declare-function gnus-group-name-decode "gnus-group" (string charset)) (declare-function gnus-group-name-charset "gnus-group" (method group)) ;; gnus-group requires gnus-int which requires message. (declare-function message-tokenize-header "message" (header &optional separator)) (defun gnus-decode-newsgroups (newsgroups group &optional method) + (require 'gnus-group) (let ((method (or method (gnus-find-method-for-group group)))) (mapconcat (lambda (group) (gnus-group-name-decode group (gnus-group-name-charset diff --git a/lisp/gnus/ietf-drums.el b/lisp/gnus/ietf-drums.el index 87012405ef9..ffcb6fa60e0 100644 --- a/lisp/gnus/ietf-drums.el +++ b/lisp/gnus/ietf-drums.el @@ -39,7 +39,6 @@ ;;; Code: (eval-when-compile (require 'cl)) -(require 'time-date) (require 'mm-util) (defvar ietf-drums-no-ws-ctl-token "\001-\010\013\014\016-\037\177" diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index d255e3410bd..abdc163bb16 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -34,11 +34,12 @@ (eval-when-compile (require 'cl)) -(require 'hashcash) -(require 'canlock) (require 'mailheader) (require 'gmm-utils) -(require 'nnheader) +(require 'mail-utils) +;; Only for the trivial macros mail-header-from, mail-header-date +;; mail-header-references, mail-header-subject, mail-header-id +(eval-when-compile (require 'nnheader)) ;; This is apparently necessary even though things are autoloaded. ;; Because we dynamically bind mail-abbrev-mode-regexp, we'd better ;; require mailabbrev here. @@ -48,7 +49,6 @@ (require 'mail-parse) (require 'mml) (require 'rfc822) -(require 'ecomplete) (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ @@ -655,8 +655,6 @@ Done before generating the new subject of a forward." :link '(custom-manual "(message)Canceling News") :type 'string) -(defvar smtpmail-default-smtp-server) - (defun message-send-mail-function () "Return suitable value for the variable `message-send-mail-function'." (cond ((and (require 'sendmail) @@ -665,14 +663,13 @@ Done before generating the new subject of a forward." (executable-find sendmail-program)) 'message-send-mail-with-sendmail) ((and (locate-library "smtpmail") - (require 'smtpmail) + (boundp 'smtpmail-default-smtp-server) smtpmail-default-smtp-server) 'message-smtpmail-send-it) ((locate-library "mailclient") 'message-send-mail-with-mailclient) (t - (lambda () - (error "Don't know how to send mail. Please customize `message-send-mail-function'"))))) + (error "Don't know how to send mail. Please customize `message-send-mail-function'")))) ;; Useful to set in site-init.el (defcustom message-send-mail-function @@ -1282,7 +1279,7 @@ text and it replaces `self-insert-command' with the other command, e.g. :type '(repeat function)) (defcustom message-auto-save-directory - (file-name-as-directory (nnheader-concat message-directory "drafts")) + (file-name-as-directory (expand-file-name "drafts" message-directory)) "*Directory where Message auto-saves buffers if Gnus isn't running. If nil, Message won't auto-save." :group 'message-buffers @@ -1958,6 +1955,8 @@ is used by default." (setq paren nil)))) (nreverse elems))))) +(autoload 'nnheader-insert-file-contents "nnheader") + (defun message-mail-file-mbox-p (file) "Say whether FILE looks like a Unix mbox file." (when (and (file-exists-p file) @@ -3410,8 +3409,8 @@ Message buffers and is not meant to be called directly." ;; if message-signature-file contains a path. (not (file-name-directory message-signature-file))) - (nnheader-concat message-signature-directory - message-signature-file) + (expand-file-name message-signature-file + message-signature-directory) message-signature-file)) (file-exists-p signature-file)))) (when signature @@ -4414,6 +4413,8 @@ This function could be useful in `message-setup-hook'." (erase-buffer))) (kill-buffer tembuf)))) +(declare-function hashcash-wait-async "hashcash" (&optional buffer)) + (defun message-send-mail (&optional arg) (require 'mail-utils) (let* ((tembuf (message-generate-new-buffer-clone-locals " message temp")) @@ -4421,14 +4422,26 @@ This function could be useful in `message-setup-hook'." (news (message-news-p)) (mailbuf (current-buffer)) (message-this-is-mail t) + ;; gnus-setup-posting-charset is autoloaded in mml.el (FIXME + ;; maybe it should not be), which this file requires. Hence + ;; the fboundp test is always true. Loading it from gnus-msg + ;; loads many Gnus files (Bug#5642). If + ;; gnus-group-posting-charset-alist hasn't been customized, + ;; this is just going to return nil anyway. FIXME it would + ;; be good to improve this further, because even if g-g-p-c-a + ;; has been customized, that is likely to just be for news. + ;; Eg either move the definition from gnus-msg, or separate out + ;; the mail and news parts. (message-posting-charset - (if (fboundp 'gnus-setup-posting-charset) + (if (and (fboundp 'gnus-setup-posting-charset) + (boundp 'gnus-group-posting-charset-alist)) (gnus-setup-posting-charset nil) message-posting-charset)) (headers message-required-mail-headers)) (when (and message-generate-hashcash (not (eq message-generate-hashcash 'opportunistic))) (message "Generating hashcash...") + (require 'hashcash) ;; Wait for calculations already started to finish... (hashcash-wait-async) ;; ...and do calculations not already done. mail-add-payment @@ -4550,6 +4563,7 @@ If you always want Gnus to send messages in one piece, set (defun message-send-mail-with-sendmail () "Send off the prepared buffer with sendmail." + (require 'sendmail) (let ((errbuf (if message-interactive (message-generate-new-buffer-clone-locals " sendmail errors") @@ -4713,10 +4727,14 @@ Do not use this for anything important, it is cryptographically weak." (prin1-to-string (recent-keys)) (prin1-to-string (garbage-collect)))))) +(defvar canlock-password) +(defvar canlock-password-for-verify) + (defun message-canlock-password () "The password used by message for cancel locks. This is the value of `canlock-password', if that option is non-nil. Otherwise, generate and save a value for `canlock-password' first." + (require 'canlock) (unless canlock-password (customize-save-variable 'canlock-password (message-canlock-generate)) (setq canlock-password-for-verify canlock-password)) @@ -4727,7 +4745,12 @@ Otherwise, generate and save a value for `canlock-password' first." (message-canlock-password) (canlock-insert-header))) +(autoload 'nnheader-get-report "nnheader") + +(declare-function gnus-setup-posting-charset "gnus-msg" (group)) + (defun message-send-news (&optional arg) + (require 'gnus-msg) (let* ((tembuf (message-generate-new-buffer-clone-locals " *message temp*")) (case-fold-search nil) (method (if (functionp message-post-method) @@ -5466,7 +5489,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." (defun message-make-references () "Return the References header for this message." (when message-reply-headers - (let ((message-id (mail-header-message-id message-reply-headers)) + (let ((message-id (mail-header-id message-reply-headers)) (references (mail-header-references message-reply-headers))) (if (or references message-id) (concat (or references "") (and references " ") @@ -5478,7 +5501,7 @@ In posting styles use `(\"Expires\" (make-expires-date 30))'." (when message-reply-headers (let ((from (mail-header-from message-reply-headers)) (date (mail-header-date message-reply-headers)) - (msg-id (mail-header-message-id message-reply-headers))) + (msg-id (mail-header-id message-reply-headers))) (when from (let ((name (mail-extract-address-components from))) (concat @@ -8003,7 +8026,11 @@ From headers in the original article." (not result) result))) +(declare-function ecomplete-add-item "ecomplete" (type key text)) +(declare-function ecomplete-save "ecomplete" ()) + (defun message-put-addresses-in-ecomplete () + (require 'ecomplete) (dolist (header '("to" "cc" "from" "reply-to")) (let ((value (message-field-value header))) (dolist (string (mail-header-parse-addresses value 'raw)) @@ -8014,6 +8041,8 @@ From headers in the original article." string)))) (ecomplete-save)) +(autoload 'ecomplete-display-matches "ecomplete") + (defun message-display-abbrev (&optional choose) "Display the next possible abbrev for the text before point." (interactive (list t)) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index a511253dddb..8bc659f5184 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -29,12 +29,14 @@ (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (require 'mail-parse) -(require 'mailcap) (require 'mm-bodies) -(require 'gnus-util) (eval-when-compile (require 'cl) (require 'term)) +(autoload 'gnus-map-function "gnus-util") +(autoload 'gnus-replace-in-string "gnus-util") +(autoload 'gnus-read-shell-command "gnus-util") + (autoload 'mm-inline-partial "mm-partial") (autoload 'mm-inline-external-body "mm-extern") (autoload 'mm-extern-cache-contents "mm-extern") @@ -550,6 +552,8 @@ Postpone undisplaying of viewers for types in (message "Destroying external MIME viewers") (mm-destroy-parts mm-postponed-undisplay-list))) +(autoload 'message-fetch-field "message") + (defun mm-dissect-buffer (&optional no-strict-mime loose-mime from) "Dissect the current buffer and return a list of MIME handles." (save-excursion @@ -688,6 +692,9 @@ Postpone undisplaying of viewers for types in (goto-char (point-max))) (mapcar 'mm-display-parts handle)))) +(autoload 'mailcap-parse-mailcaps "mailcap") +(autoload 'mailcap-mime-info "mailcap") + (defun mm-display-part (handle &optional no-default) "Display the MIME part represented by HANDLE. Returns nil if the part is removed; inline if displayed inline; @@ -747,6 +754,7 @@ external if displayed external." handle 'mailcap-save-binary-file))))))))) (declare-function gnus-configure-windows "gnus-win" (setting &optional force)) +(defvar mailcap-mime-extensions) ; mailcap-mime-info autoloads (defun mm-display-external (handle method) "Display HANDLE using METHOD." diff --git a/lisp/gnus/mm-encode.el b/lisp/gnus/mm-encode.el index a32927b8ae3..0d609e56cbb 100644 --- a/lisp/gnus/mm-encode.el +++ b/lisp/gnus/mm-encode.el @@ -26,7 +26,7 @@ (eval-when-compile (require 'cl)) (require 'mail-parse) -(require 'mailcap) +(autoload 'mailcap-extension-to-mime "mailcap") (autoload 'mm-body-7-or-8 "mm-bodies") (autoload 'mm-long-lines-p "mm-bodies") diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 98142298c04..e394593ec12 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -26,10 +26,6 @@ (eval-when-compile (require 'cl)) -(if (locate-library "password-cache") - (require 'password-cache) - (require 'password)) - (autoload 'mml2015-sign "mml2015") (autoload 'mml2015-encrypt "mml2015") (autoload 'mml1991-sign "mml1991") diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el index 87fcdf5b09c..f262dc6b3cb 100644 --- a/lisp/gnus/mml.el +++ b/lisp/gnus/mml.el @@ -35,7 +35,7 @@ (eval-when-compile (require 'cl)) (autoload 'message-make-message-id "message") -(autoload 'gnus-setup-posting-charset "gnus-msg") +(declare-function gnus-setup-posting-charset "gnus-msg" (group)) (autoload 'gnus-make-local-hook "gnus-util") (autoload 'message-fetch-field "message") (autoload 'message-mark-active-p "message") @@ -1173,7 +1173,11 @@ If not set, `default-directory' will be used." (error "Permission denied: %s" file)) file)) +(declare-function mailcap-parse-mimetypes "mailcap" (&optional path force)) +(declare-function mailcap-mime-types "mailcap" ()) + (defun mml-minibuffer-read-type (name &optional default) + (require 'mailcap) (mailcap-parse-mimetypes) (let* ((default (or default (mm-default-file-encoding name) @@ -1445,6 +1449,7 @@ or the `pop-to-buffer' function." (setq mml-preview-buffer (generate-new-buffer (concat (if raw "*Raw MIME preview of " "*MIME preview of ") (buffer-name)))) + (require 'gnus-msg) ; for gnus-setup-posting-charset (save-excursion (let* ((buf (current-buffer)) (message-options message-options) diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el index c523dccc055..a3ada29fa66 100644 --- a/lisp/gnus/mml1991.el +++ b/lisp/gnus/mml1991.el @@ -28,7 +28,11 @@ ;; For Emacs < 22.2. (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) + + (if (locate-library "password-cache") + (require 'password-cache) + (require 'password))) (eval-when-compile (require 'cl) @@ -329,7 +333,6 @@ Whether the passphrase is cached at all is controlled by ;; epg wrapper (defvar epg-user-id-alist) -(defvar password-cache-expiry) (autoload 'epg-make-context "epg") (autoload 'epg-passphrase-callback-function "epg") diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 65cf1a8f426..6725709c044 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -30,7 +30,11 @@ ;; For Emacs < 22.2. (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) + + (if (locate-library "password-cache") + (require 'password-cache) + (require 'password))) (eval-when-compile (require 'cl)) (require 'mm-decode) @@ -986,8 +990,6 @@ Whether the passphrase is cached at all is controlled by (autoload 'epg-expand-group "epg-config") (autoload 'epa-select-keys "epa") -(defvar password-cache-expiry) - (defvar mml2015-epg-secret-key-id-list nil) (defun mml2015-epg-passphrase-callback (context key-id ignore) diff --git a/lisp/gnus/nneething.el b/lisp/gnus/nneething.el index f92c47eba04..2a80d867e56 100644 --- a/lisp/gnus/nneething.el +++ b/lisp/gnus/nneething.el @@ -28,6 +28,7 @@ (eval-when-compile (require 'cl)) +(require 'mailcap) (require 'nnheader) (require 'nnmail) (require 'nnoo) diff --git a/lisp/gnus/nnheader.el b/lisp/gnus/nnheader.el index f3283022db9..6a24f21efc1 100644 --- a/lisp/gnus/nnheader.el +++ b/lisp/gnus/nnheader.el @@ -27,6 +27,8 @@ ;;; Code: +(eval-and-compile + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (defvar nnmail-extra-headers) @@ -121,7 +123,6 @@ on your system, you could say something like: (autoload 'nnmail-message-id "nnmail") (autoload 'mail-position-on-field "sendmail") -(autoload 'message-remove-header "message") (autoload 'gnus-buffer-live-p "gnus-util") ;;; Header access macros. @@ -662,8 +663,12 @@ the line could be found." ;; without inserting extra newline. (fill-region-as-paragraph begin (1+ (point)))))) +(declare-function message-remove-header "message" + (header &optional is-regexp first reverse)) + (defun nnheader-replace-header (header new-value) "Remove HEADER and insert the NEW-VALUE." + (require 'message) (save-excursion (save-restriction (nnheader-narrow-to-headers) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 6d97c060a96..b939f50e0fc 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -59,6 +59,10 @@ ;;; Code: +;; For Emacs < 22.2. +(eval-and-compile + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (require 'imap) (require 'nnoo) (require 'nnmail) @@ -789,12 +793,17 @@ If EXAMINE is non-nil the group is selected read-only." (nnheader-nov-delete-outside-range low high)))) 'nov))) +(declare-function netrc-parse "netrc" (file)) +(declare-function netrc-machine-user-or-password "netrc" + (mode authinfo-file-or-list machines ports defaults)) + (defun nnimap-open-connection (server) ;; Note: `nnimap-open-server' that calls this function binds ;; `imap-logout-timeout' to `nnimap-logout-timeout'. (if (not (imap-open nnimap-address nnimap-server-port nnimap-stream nnimap-authenticator nnimap-server-buffer)) (nnheader-report 'nnimap "Can't open connection to server %s" server) + (require 'netrc) (unless (or (imap-capability 'IMAP4 nnimap-server-buffer) (imap-capability 'IMAP4rev1 nnimap-server-buffer)) (imap-close nnimap-server-buffer) @@ -805,7 +814,7 @@ If EXAMINE is non-nil the group is selected read-only." (port (if nnimap-server-port (int-to-string nnimap-server-port) "imap")) - (auth-info + (auth-info (auth-source-user-or-password '("login" "password") server port)) (auth-user (nth 0 auth-info)) (auth-passwd (nth 1 auth-info)) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 6e42a1fa31d..03e0168de49 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -26,6 +26,10 @@ ;;; Code: +;; For Emacs < 22.2. +(eval-and-compile + (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) + (require 'nnheader) (require 'nnoo) (require 'gnus-util) @@ -1168,6 +1172,11 @@ It will make innd servers spawn an nnrpd process to allow actual article reading." (nntp-send-command "^.*\n" "MODE READER")) +(declare-function netrc-parse "netrc" (file)) +(declare-function netrc-machine "netrc" + (list machine &optional port defaultport)) +(declare-function netrc-get "netrc" (alist type)) + (defun nntp-send-authinfo (&optional send-if-force) "Send the AUTHINFO to the nntp server. It will look in the \"~/.authinfo\" file for matching entries. If @@ -1176,10 +1185,11 @@ and a password. If SEND-IF-FORCE, only send authinfo to the server if the .authinfo file has the FORCE token." + (require 'netrc) (let* ((list (netrc-parse nntp-authinfo-file)) (alist (netrc-machine list nntp-address "nntp")) (force (or (netrc-get alist "force") nntp-authinfo-force)) - (auth-info + (auth-info (auth-source-user-or-password '("login" "password") nntp-address "nntp")) (auth-user (nth 0 auth-info)) (auth-passwd (nth 1 auth-info)) diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 793aa1f32dc..e13dffccdac 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -31,7 +31,6 @@ (require 'cl)) (defvar message-posting-charset) -(require 'qp) (require 'mm-util) (require 'ietf-drums) ;; Fixme: Avoid this (used for mail-parse-charset) mm dependence on gnus. @@ -827,6 +826,8 @@ Point moves to the end of the region." "Base64-encode the header contained in STRING." (base64-encode-string string t)) +(autoload 'quoted-printable-encode-region "qp") + (defun rfc2047-q-encode-string (string) "Quoted-printable-encode the header in STRING." (mm-with-unibyte-buffer @@ -929,6 +930,8 @@ only be used for decoding, not for encoding." 'raw-text cs))) +(autoload 'quoted-printable-decode-string "qp") + (defun rfc2047-decode-encoded-words (words) "Decode successive encoded-words in WORDS and return a decoded string. Each element of WORDS looks like (CHARSET ENCODING ENCODED-TEXT diff --git a/lisp/gnus/sieve-mode.el b/lisp/gnus/sieve-mode.el index 99ec57ce38b..f765589e7a0 100644 --- a/lisp/gnus/sieve-mode.el +++ b/lisp/gnus/sieve-mode.el @@ -1,7 +1,7 @@ ;;; sieve-mode.el --- Sieve code editing commands for Emacs -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Simon Josefsson <simon@josefsson.org> @@ -49,7 +49,6 @@ (autoload 'sieve-manage "sieve") (autoload 'sieve-upload "sieve") -(require 'easymenu) (eval-when-compile (require 'font-lock)) @@ -186,6 +185,7 @@ "Menubar used in sieve mode.") ;; Code for Sieve editing mode. +(autoload 'easy-menu-add-item "easymenu") ;;;###autoload (define-derived-mode sieve-mode c-mode "Sieve" diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 45c596539c9..69fc2016a65 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -1,6 +1,7 @@ ;;; spam-stat.el --- detecting spam based on statistics -;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Keywords: network @@ -557,6 +558,8 @@ check the variable `spam-stat-score-data'." (when (re-search-forward "^Xref:.*\n" nil t) (delete-region (match-beginning 0) (match-end 0))))) +(autoload 'time-to-number-of-days "time-date") + (defun spam-stat-process-directory (dir func) "Process all the regular files in directory DIR using function FUNC." (let* ((files (directory-files dir t "^[^.]")) diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 301201ea0eb..126205a532f 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -1,7 +1,7 @@ ;;; password-cache.el --- Read passwords, possibly using a password cache. -;; Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -;; Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +;; 2010 Free Software Foundation, Inc. ;; Author: Simon Josefsson <simon@josefsson.org> ;; Created: 2003-12-21 @@ -51,11 +51,15 @@ ;;; Code: +;; Options are autoloaded since they are used by eg mml-sec.el. + +;;;###autoload (defcustom password-cache t "Whether to cache passwords." :group 'password :type 'boolean) +;;;###autoload (defcustom password-cache-expiry 16 "How many seconds passwords are cached, or nil to disable expiring. Whether passwords are cached at all is controlled by `password-cache'." diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 7309402a848..639c919924e 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,7 @@ +2010-03-19 Glenn Morris <rgm@gnu.org> + + * url.el: Move mailcap require earlier in the file. + 2010-03-12 Chong Yidong <cyd@stupidchicken.com> * url-vars.el (url): Put in comm group. diff --git a/lisp/url/url.el b/lisp/url/url.el index 9f47e104043..6f7b810f0ed 100644 --- a/lisp/url/url.el +++ b/lisp/url/url.el @@ -1,7 +1,7 @@ ;;; url.el --- Uniform Resource Locator retrieval tool -;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, -;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004, 2005, 2006, 2007, +;; 2008, 2009, 2010 Free Software Foundation, Inc. ;; Author: Bill Perry <wmperry@gnu.org> ;; Keywords: comm, data, processes, hypermedia @@ -29,11 +29,12 @@ (eval-when-compile (require 'cl)) +(require 'mailcap) + (eval-when-compile (require 'mm-decode) (require 'mm-view)) -(require 'mailcap) (require 'url-vars) (require 'url-cookie) (require 'url-history) |