# HG changeset patch # User Glenn Morris # Date 1233815774 0 # Node ID c47e321c9092e8fe22b49c7ccd1c719e6c2d8e32 # Parent c7ce5de26833d65a8cdb990757f3dd4009a36231 (rmail-buffer): Remove unneeded eval-when-compile. (rmail-narrow-to-non-pruned-header): Remove autoload. (mairix-rmail-fetch-field): Handle mbox Rmail. diff -r c7ce5de26833 -r c47e321c9092 lisp/net/mairix.el --- a/lisp/net/mairix.el Thu Feb 05 06:23:19 2009 +0000 +++ b/lisp/net/mairix.el Thu Feb 05 06:36:14 2009 +0000 @@ -228,8 +228,7 @@ (autoload 'rmail "rmail") (autoload 'rmail-summary-displayed "rmail") (autoload 'rmail-summary "rmailsum") -(eval-when-compile - (defvar rmail-buffer)) +(defvar rmail-buffer) (defun mairix-rmail-display (folder) "Display mbox file FOLDER with RMail." @@ -253,17 +252,20 @@ (rmail-summary)))) ;; Fetching mail header field: -(autoload 'rmail-narrow-to-non-pruned-header "rmail") (defun mairix-rmail-fetch-field (field) "Get mail header FIELD for current message using RMail." (unless (and (boundp 'rmail-buffer) rmail-buffer) (error "No RMail buffer available")) - (save-excursion - (set-buffer rmail-buffer) - (save-restriction - (rmail-narrow-to-non-pruned-header) - (mail-fetch-field field)))) + ;; At this point, we are in rmail mode, so the rmail funcs are loaded. + (if (fboundp 'rmail-get-header) ; Emacs 23 + (rmail-get-header field) + (save-excursion + (set-buffer rmail-buffer) + (save-restriction + ;; Don't warn about this when compiling Emacs 23. + (with-no-warnings (rmail-narrow-to-non-pruned-header)) + (mail-fetch-field field))))) ;;; Gnus (eval-when-compile