changeset 68096:57c4e7929f99

* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string instead of mh-replace-in-string as mh-replace-in-string was replaced by a more appropriate defsubst in mh-xemacs.el. * mh-comp.el: Require cleanup, wrap compiler-shushing defvars with eval-when-compile. (mh-file-is-vcard-p): Removed redundant test. * mh-customize.el: Require cleanup, wrap compiler-shushing defvars with eval-when-compile. (mh-adaptive-cmd-note-flag, mh-invisible-header-fields) (mh-invisible-header-fields-default): Add forward definitions. (mh-invisible-header-fields-default): Alphabetize. * mh-e.el: Require cleanup, wrap compiler-shushing defvars with eval-when-compile. (mh-thread-scan-line-map-stack, tool-bar-mode): Delete unused variables. (mh-colors-available-p): Just call display-color-cells. It's on all supported Emacsen (and defaliased on XEmacs). * mh-funcs.el: mh-inc.el: mh-init.el: Wrap compiler-shushing defvars * with eval-when-compile. * mh-identity.el: Don't need (mh-require-cl). * mh-index.el: Don't need to load executable any more. * mh-mime.el: Wrap compiler-shushing defvars with eval-when-compile. (mh-have-file-command): Initialize variable to 'undefined. Add docstring. Update function of same name accordingly. Also don't need to load executable any more. (mh-mime-content-types): Delete. (mh-minibuffer-read-type): Prompt user for type if mh-file-mime-type returns application/octet-stream. Assume we have mailcap-mime-types. (mh-mime-display): Update error message. * mh-seq.el: Require cleanup, and wrap compiler-shushing defvars with eval-when-compile. * mh-utils.el: Require cleanup, and wrap compiler-shushing defvars with eval-when-compile. (mh-clean-msg-header): Don't set after-change-functions to nil. (mh-replace-in-string): Remove. Create defsubst in mh-xemacs.el instead.
author Bill Wohler <wohler@newt.com>
date Mon, 09 Jan 2006 06:28:49 +0000
parents 0a239e9952a6
children 0aad66a76c40
files lisp/mh-e/ChangeLog lisp/mh-e/mh-alias.el lisp/mh-e/mh-comp.el lisp/mh-e/mh-customize.el lisp/mh-e/mh-e.el lisp/mh-e/mh-funcs.el lisp/mh-e/mh-identity.el lisp/mh-e/mh-inc.el lisp/mh-e/mh-index.el lisp/mh-e/mh-init.el lisp/mh-e/mh-mime.el lisp/mh-e/mh-seq.el lisp/mh-e/mh-utils.el
diffstat 13 files changed, 184 insertions(+), 188 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mh-e/ChangeLog	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/ChangeLog	Mon Jan 09 06:28:49 2006 +0000
@@ -1,3 +1,62 @@
+2006-01-08  Bill Wohler  <wohler@newt.com>
+
+	Removed code that was marked as Emacs 20 compatible that was
+	easily found showing how important it is to document such
+	things (closes SF #1359240). Feel free to nuke any other Emacs 20
+	peculiarities that you find. Wrapped code for shushing compiler
+	with (eval-when-compile), sometimes moving the defvars closer to
+	where they were used.
+	
+	* mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
+	instead of mh-replace-in-string as mh-replace-in-string was
+	replaced by a more appropriate defsubst in mh-xemacs.el.
+
+	* mh-comp.el: Require cleanup, wrap compiler-shushing defvars with
+	eval-when-compile.
+	(mh-file-is-vcard-p): Removed redundant test.
+
+	* mh-customize.el: Require cleanup, wrap compiler-shushing defvars
+	with eval-when-compile.
+	(mh-adaptive-cmd-note-flag, mh-invisible-header-fields)
+	(mh-invisible-header-fields-default): Add forward definitions.
+	(mh-invisible-header-fields-default): Alphabetize.
+
+	* mh-e.el: Require cleanup, wrap compiler-shushing defvars with
+	eval-when-compile.
+	(mh-thread-scan-line-map-stack, tool-bar-mode): Delete unused
+	variables.
+	(mh-colors-available-p): Just call display-color-cells. It's on
+	all supported Emacsen (and defaliased on XEmacs).
+
+	* mh-funcs.el:
+	* mh-inc.el:
+	* mh-init.el: Wrap compiler-shushing defvars with
+	eval-when-compile.
+
+	* mh-identity.el: Don't need (mh-require-cl).
+
+	* mh-index.el: Don't need to load executable any more.
+
+	* mh-mime.el: Wrap compiler-shushing defvars with
+	eval-when-compile.
+	(mh-have-file-command): Initialize variable to 'undefined. Add
+	docstring. Update function of same name accordingly. Also don't
+	need to load executable any more.
+	(mh-mime-content-types): Delete.
+	(mh-minibuffer-read-type): Prompt user for type if
+	mh-file-mime-type returns application/octet-stream. Assume we have
+	mailcap-mime-types.
+	(mh-mime-display): Update error message.
+
+	* mh-seq.el: Require cleanup, and wrap compiler-shushing defvars
+	with eval-when-compile.
+
+	* mh-utils.el: Require cleanup, and wrap compiler-shushing defvars
+	with eval-when-compile.
+	(mh-clean-msg-header): Don't set after-change-functions to nil.
+	(mh-replace-in-string): Remove. Create defsubst in mh-xemacs.el
+	instead.
+	
 2006-01-07  Bill Wohler  <wohler@newt.com>
 
 	* mh-customize.el: Updated Faces documentation in header.
--- a/lisp/mh-e/mh-alias.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-alias.el	Mon Jan 09 06:28:49 2006 +0000
@@ -132,10 +132,10 @@
         (setq res (match-string 1 res)))
     ;; Replace "&" with capitalized username
     (if (string-match "&" res)
-        (setq res (mh-replace-in-string "&" (capitalize username) res)))
+        (setq res (replace-regexp-in-string "&" (capitalize username) res)))
     ;; Remove " character
     (if (string-match "\"" res)
-        (setq res (mh-replace-in-string "\"" "" res)))
+        (setq res (replace-regexp-in-string "\"" "" res)))
     ;; If empty string, use username instead
     (if (string-equal "" res)
         (setq res username))
--- a/lisp/mh-e/mh-comp.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-comp.el	Mon Jan 09 06:28:49 2006 +0000
@@ -35,24 +35,17 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
-(require 'mh-e)
+
+(require 'easymenu)
 (require 'gnus-util)
-(require 'easymenu)
+(require 'mh-e)
 (require 'mh-gnus)
+
 (eval-when (compile load eval)
   (ignore-errors (require 'mailabbrev)))
 
-;; Shush the byte-compiler
-(defvar adaptive-fill-first-line-regexp)
-(defvar font-lock-defaults)
-(defvar mark-active)
-(defvar sendmail-coding-system)
-(defvar mh-identity-list)
-(defvar mh-identity-default)
-(defvar mh-mml-mode-default)
-(defvar mh-identity-menu)
+
 
-
 ;;; Autoloads
 
 (autoload 'mail-mode-fill-paragraph "sendmail")
@@ -958,10 +951,12 @@
         (mail-mode-fill-paragraph arg)
       (fill-paragraph arg))))
 
-;; Avoid compiler warnings in XEmacs and Emacs 20
+;; Shush compiler.
 (eval-when-compile
-  (defvar tool-bar-mode)
-  (defvar tool-bar-map))
+  (defvar adaptive-fill-first-line-regexp)
+  (defvar tool-bar-map)
+    (defvar font-lock-defaults)
+)
 
 (defvar mh-letter-buttons-init-flag nil)
 
@@ -1177,8 +1172,7 @@
          (file-exists-p file)
          (or (and (not (mh-have-file-command))
                   (not (null (string-match "\.vcf$" file))))
-             (and (mh-have-file-command)
-                  (string-equal "text/x-vcard" (mh-file-mime-type file)))))))
+             (string-equal "text/x-vcard" (mh-file-mime-type file))))))
 
 ;;;###mh-autoload
 (defun mh-insert-signature (&optional file)
@@ -1469,6 +1463,8 @@
         unless (eq charset 'ascii) return nil
         finally return t))
 
+(eval-when-compile (defvar sendmail-coding-system)) ;shush compiler
+
 ;;;###mh-autoload
 (defun mh-send-letter (&optional arg)
   "Save draft and send message.
--- a/lisp/mh-e/mh-customize.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-customize.el	Mon Jan 09 06:28:49 2006 +0000
@@ -67,21 +67,17 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
-(require 'mh-loaddefs)
 
 (eval-and-compile
   (defvar mh-xemacs-flag (featurep 'xemacs)
-    "Non-nil means the current Emacs is XEmacs."))
-
-(when mh-xemacs-flag
-  (require 'mh-xemacs))
-
-;; XXX: Functions autoloaded from the following files are used to initialize
-;;  customizable variables. They are require'd here, since otherwise the
-;;  corresponding .elc would be loaded at compile time.
-(eval-when-compile
+    "Non-nil means the current Emacs is XEmacs.")
+  (when mh-xemacs-flag
+    (require 'mh-xemacs)))
+
+(eval-and-compile
+  (require 'mh-identity)
   (require 'mh-init)
-  (require 'mh-identity))
+  (require 'mh-loaddefs))
 
 ;; For compiler warnings...
 (eval-when-compile
@@ -1031,8 +1027,7 @@
 
 ;;; Scan Line Formats (:group 'mh-scan-line-formats)
 
-;; Forward definition to avoid compiler and runtime error.
-(defvar mh-scan-format-file t)
+(defvar mh-scan-format-file t) ;forward definition
 
 (defun mh-adaptive-cmd-note-flag-check (symbol value)
   "Check if desired setting is legal.
@@ -1045,6 +1040,8 @@
              "is set to \"Use MH-E scan Format\"")
     (set-default symbol value)))
 
+(defvar mh-adaptive-cmd-note-flag) ;forward definition
+
 (defun mh-scan-format-file-check (symbol value)
   "Check if desired setting is legal.
 Throw an error if user tries to set `mh-scan-format-file' to
@@ -1598,6 +1595,10 @@
 hidden that you wish to display, and add extra entries to hide in
 `mh-invisible-header-fields'.")
 
+;; Forward definition.
+(defvar mh-invisible-header-fields)
+(defvar mh-invisible-header-fields-default nil)
+
 (defun mh-invisible-headers ()
   "Make or remake the variable `mh-invisible-header-fields-compiled'.
 Done using `mh-invisible-header-fields-internal' as input, from
@@ -1623,23 +1624,6 @@
                  (regexp-opt fields t))))
       (setq mh-invisible-header-fields-compiled nil))))
 
-(defcustom mh-invisible-header-fields-default nil
-  "*List of hidden header fields.
-
-The header fields listed in this option are hidden, although you
-can check off any field that you would like to see.
-
-Header fields that you would like to hide that aren't listed can
-be added to the option `mh-invisible-header-fields'.
-
-See also `mh-clean-message-header-flag'."
-  :type `(set ,@(mapcar (lambda (x) `(const ,x))
-                        mh-invisible-header-fields-internal))
-  :set (lambda (symbol value)
-         (set-default symbol value)
-         (mh-invisible-headers))
-  :group 'mh-show)
-
 (defcustom mh-invisible-header-fields nil
   "*Additional header fields to hide.
 
@@ -1660,6 +1644,23 @@
          (mh-invisible-headers))
   :group 'mh-show)
 
+(defcustom mh-invisible-header-fields-default nil
+  "*List of hidden header fields.
+
+The header fields listed in this option are hidden, although you
+can check off any field that you would like to see.
+
+Header fields that you would like to hide that aren't listed can
+be added to the option `mh-invisible-header-fields'.
+
+See also `mh-clean-message-header-flag'."
+  :type `(set ,@(mapcar (lambda (x) `(const ,x))
+                        mh-invisible-header-fields-internal))
+  :set (lambda (symbol value)
+         (set-default symbol value)
+         (mh-invisible-headers))
+  :group 'mh-show)
+
 (defcustom mh-lpr-command-format "lpr -J '%s'"
   "*Command used to print\\<mh-folder-mode-map>.
 
--- a/lisp/mh-e/mh-e.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-e.el	Mon Jan 09 06:28:49 2006 +0000
@@ -51,7 +51,9 @@
 
 ;; MH-E is an Emacs interface to the MH mail system.
 
-;; MH-E is supported in GNU Emacs 20 and 21, with MH 6.8.4 and nmh 1.0.4.
+;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
+;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
+;; on, and GNU mailutils 0.4 on.
 
 ;; Mailing Lists:
 ;;   mh-e-users@lists.sourceforge.net
@@ -87,17 +89,11 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
-(require 'mh-utils)
-(require 'mh-init)
-(require 'mh-inc)
-(require 'mh-seq)
-(require 'gnus-util)
+
 (require 'easymenu)
-
-;; Shush the byte-compiler
-(eval-when-compile
-  (defvar font-lock-auto-fontify)
-  (defvar font-lock-defaults))
+(require 'gnus-util)
+(require 'mh-seq)
+(require 'mh-utils)
 
 (defconst mh-version "7.85+cvs" "Version number of MH-E.")
 
@@ -1184,8 +1180,6 @@
   (when (consp part-index) (setq part-index (car part-index)))
   (mh-folder-mime-action part-index #'mh-mime-save-part nil))
 
-(defvar mh-thread-scan-line-map-stack)
-
 (defun mh-reset-threads-and-narrowing ()
   "Reset all variables pertaining to threads and narrowing.
 Also removes all content from the folder buffer."
@@ -1761,18 +1755,19 @@
       ''write-file-functions            ;Emacs 21.4
     ''local-write-file-hooks))          ;<Emacs 21.4, XEmacs
 
-;; Avoid compiler warnings in non-bleeding edge versions of Emacs.
-(eval-when-compile
-  (defvar tool-bar-mode)
-  (defvar tool-bar-map)
-  (defvar desktop-save-buffer))         ;Emacs 21.4
-
 ;; Register mh-folder-mode as supporting which-function-mode...
 (load "which-func" t t)
 (when (and (boundp 'which-func-modes)
            (not (member 'mh-folder-mode which-func-modes)))
   (push 'mh-folder-mode which-func-modes))
 
+;; Shush compiler in non-bleeding edge versions of Emacs.
+(eval-when-compile
+  (defvar desktop-save-buffer)         ;Emacs 21.4
+  (defvar font-lock-auto-fontify)
+  (defvar font-lock-defaults)
+  (defvar tool-bar-map))
+
 (defvar mh-folder-buttons-init-flag nil)
 
 ;; Autoload cookie needed by desktop.el
@@ -1913,10 +1908,7 @@
 (defun mh-colors-available-p ()
   "Check if colors are available in the Emacs being used."
   (or mh-xemacs-flag
-      (let ((color-cells
-             (or (ignore-errors (mh-funcall-if-exists display-color-cells))
-                 (ignore-errors (mh-funcall-if-exists
-                                 x-display-color-cells)))))
+      (let ((color-cells (display-color-cells)))
         (and (numberp color-cells) (>= color-cells 8)))))
 
 (defun mh-colors-in-use-p ()
--- a/lisp/mh-e/mh-funcs.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-funcs.el	Mon Jan 09 06:28:49 2006 +0000
@@ -149,8 +149,7 @@
           (re-search-forward "^rmf: " (point-max) t))
     (display-buffer mh-temp-buffer)))
 
-;; Avoid compiler warning...
-(defvar view-exit-action)
+(eval-when-compile (defvar view-exit-action)) ;shush compile
 
 ;;;###mh-autoload
 (defun mh-list-folders ()
--- a/lisp/mh-e/mh-identity.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-identity.el	Mon Jan 09 06:28:49 2006 +0000
@@ -40,7 +40,7 @@
 ;;; Code:
 
 (eval-when-compile (require 'mh-acros))
-(mh-require-cl)
+
 (require 'mh-comp)
 
 (autoload 'mml-insert-tag "mml")
--- a/lisp/mh-e/mh-inc.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-inc.el	Mon Jan 09 06:28:49 2006 +0000
@@ -1,6 +1,6 @@
 ;;; mh-inc.el --- MH-E "inc" and separate mail spool handling
 ;;
-;; Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
 
 ;; Author: Peter S. Galbraith <psg@debian.org>
 ;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -73,8 +73,7 @@
                                         (char-to-string key)
                                         "] inc " folder " folder\n"))))
 
-;; Avoid compiler warning
-(defvar mh-inc-spool-list)
+(eval-when-compile (defvar mh-inc-spool-list)) ;shush compiler
 
 (defun mh-inc-spool-make ()
   "Make all commands and defines keys for contents of `mh-inc-spool-list'."
--- a/lisp/mh-e/mh-index.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-index.el	Mon Jan 09 06:28:49 2006 +0000
@@ -45,6 +45,7 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+
 (require 'mh-e)
 (require 'mh-mime)
 (require 'mh-pick)
@@ -52,7 +53,6 @@
 (autoload 'gnus-local-map-property "gnus-util")
 (autoload 'gnus-eval-format "gnus-spec")
 (autoload 'widget-convert-button "wid-edit")
-(autoload 'executable-find "executable")
 
 ;; Support different indexing programs
 (defvar mh-indexer-choices
--- a/lisp/mh-e/mh-init.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-init.el	Mon Jan 09 06:28:49 2006 +0000
@@ -43,9 +43,6 @@
 (mh-require-cl)
 (require 'mh-utils)
 
-;; Avoid compiler warnings.
-(eval-when-compile (defvar image-load-path))
-
 ;; Set for local environment:
 ;; mh-progs and mh-lib used to be set in paths.el, which tried to
 ;; figure out at build time which of several possible directories MH
@@ -300,6 +297,8 @@
 
 
 
+(eval-when-compile (defvar image-load-path)) ;shush compiler
+
 (defvar mh-image-load-path-called-flag nil)
 
 ;;;###mh-autoload
@@ -328,6 +327,8 @@
 
 
 
+;;; Support routines for mh-customize.el
+
 (defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
                                         (>= emacs-major-version 22))
   "Non-nil means defface supports min-colors display requirement.")
--- a/lisp/mh-e/mh-mime.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-mime.el	Mon Jan 09 06:28:49 2006 +0000
@@ -38,8 +38,9 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+
+(require 'gnus-util)
 (require 'mh-comp)
-(require 'gnus-util)
 (require 'mh-gnus)
 
 (autoload 'article-emphasize "gnus-art")
@@ -132,16 +133,16 @@
           "/[-.+a-zA-Z0-9]+")
   "Regexp matching valid media types used in MIME attachment compositions.")
 
-;; Just defvar the variable to avoid compiler warning... This doesn't bind
-;; the variable, so things should work exactly as before.
-(defvar mh-have-file-command)
+(defvar mh-have-file-command 'undefined
+  "Cached value of `mh-have-file-command'.
+Do not reference this variable directly as it might not have been
+initialized. Always use the command `mh-have-file-command'.")
 
 ;;;###mh-autoload
 (defun mh-have-file-command ()
   "Return t if 'file' command is on the system.
 'file -i' is used to get MIME type of composition insertion."
-  (when (not (boundp 'mh-have-file-command))
-    (load "executable" t t)        ; executable-find not autoloaded in emacs20
+  (when (eq mh-have-file-command 'undefined)
     (setq mh-have-file-command
           (and (fboundp 'executable-find)
                (executable-find "file") ; file command exists
@@ -183,9 +184,10 @@
 Returns nil if file command not on system."
   (cond
    ((not (mh-have-file-command))
-    nil)                                ;No file command, exit now.
-   ((not (and (file-exists-p filename)(file-readable-p filename)))
-    nil)
+    nil)                                ;no file command, exit now
+   ((not (and (file-exists-p filename)  
+              (file-readable-p filename))) 
+    nil)                               ;no file or not readable, ditto
    (t
     (save-excursion
       (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
@@ -200,36 +202,6 @@
                 (mh-file-mime-type-substitute (match-string 0) filename)))
           (kill-buffer tmp-buffer)))))))
 
-(defvar mh-mime-content-types
-  '(("application/mac-binhex40") ("application/msword")
-    ("application/octet-stream") ("application/pdf") ("application/pgp-keys")
-    ("application/pgp-signature") ("application/pkcs7-signature")
-    ("application/postscript") ("application/rtf")
-    ("application/vnd.ms-excel") ("application/vnd.ms-powerpoint")
-    ("application/vnd.ms-project") ("application/vnd.ms-tnef")
-    ("application/wordperfect5.1") ("application/wordperfect6.0")
-    ("application/zip")
-
-    ("audio/basic") ("audio/mpeg")
-
-    ("image/gif") ("image/jpeg") ("image/png")
-
-    ("message/delivery-status")
-    ("message/external-body") ("message/partial") ("message/rfc822")
-
-    ("text/enriched") ("text/html") ("text/plain") ("text/rfc822-headers")
-    ("text/richtext") ("text/x-vcard") ("text/xml")
-
-    ("video/mpeg") ("video/quicktime"))
-  "Valid MIME content types for Emacs 20.
-Obsolete; use `mailcap-mime-types'.
-
-See also \\[mh-mh-to-mime].")
-
-;; Delete mh-minibuffer-read-type and mh-mime-content-types and use
-;; mml-minibuffer-read-type when Emacs20 is no longer supported unless we
-;; think (mh-file-mime-type) is better than (mm-default-file-encoding).
-
 (defun mh-minibuffer-read-type (filename &optional default)
   "Return the content type associated with the given FILENAME.
 If the \"file\" command exists and recognizes the given file,
@@ -241,12 +213,12 @@
   (let* ((default (or default
 		      (mm-default-file-encoding filename)
 		      "application/octet-stream"))
-	 (type (or (mh-file-mime-type filename)
+         (probed-type (mh-file-mime-type filename))
+	 (type (or (and (not (equal probed-type "application/octet-stream"))
+                        probed-type)
                    (completing-read
                     (format "Content type (default %s): " default)
-                    (if (fboundp 'mailcap-mime-types)
-                        (mapcar 'list (mailcap-mime-types))
-                      mh-mime-content-types)))))
+                    (mapcar 'list (mailcap-mime-types))))))
     (if (not (equal type ""))
         type
       default)))
@@ -619,7 +591,7 @@
     (mml-insert-empty-tag 'part 'type type 'filename file
                           'disposition dispos 'description description)))
 
-(defvar mh-identity-pgg-default-user-id)
+(eval-when-compile (defvar mh-identity-pgg-default-user-id)) ;shush compiler
 
 (defun mh-secure-message (method mode &optional identity)
   "Add tag to encrypt or sign message.
@@ -969,8 +941,7 @@
                    (mh-mime-display-part handles))
                   (t (mh-signature-highlight))))
         (error
-         (message "Please report this error:\n %s"
-                  (error-message-string err))
+         (message "Could not display body: %s" (error-message-string err))
          (delete-region (point-min) (point-max))
          (insert raw-message-data))))))
 
@@ -1444,8 +1415,9 @@
 
 ;; These variables should already be initialized in mm-decode.el if we have a
 ;; recent enough Gnus. The defvars are here to avoid compiler warnings.
-(defvar mm-verify-function-alist nil)
-(defvar mm-decrypt-function-alist nil)
+(eval-when-compile
+  (defvar mm-verify-function-alist nil)
+  (defvar mm-decrypt-function-alist nil))
 
 (defvar pressed-details)
 
--- a/lisp/mh-e/mh-seq.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-seq.el	Mon Jan 09 06:28:49 2006 +0000
@@ -73,11 +73,9 @@
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
+
 (require 'mh-e)
 
-;; Shush the byte-compiler
-(defvar tool-bar-mode)
-
 
 
 ;;; Data structures (used in message threading)...
@@ -171,8 +169,7 @@
     (when (and (eq sequence mh-unseen-seq) (mh-speed-flists-active-p))
       (apply #'mh-speed-flists t folders-changed))))
 
-;; Avoid compiler warnings
-(defvar view-exit-action)
+(eval-when-compile (defvar view-exit-action)) ;shush compiler
 
 ;;;###mh-autoload
 (defun mh-list-sequences ()
@@ -239,8 +236,10 @@
                         (mh-list-to-string (mh-seq-containing-msg message t))
                         " "))))
 
-;; Avoid compiler warning
-(defvar tool-bar-map)
+;; Shush compiler
+(eval-when-compile
+  (defvar tool-bar-map)
+  (defvar tool-bar-mode))
 
 (make-variable-buffer-local 'mh-non-seq-mode-line-annotation)
 
--- a/lisp/mh-e/mh-utils.el	Sun Jan 08 23:48:56 2006 +0000
+++ b/lisp/mh-e/mh-utils.el	Mon Jan 09 06:28:49 2006 +0000
@@ -33,34 +33,29 @@
 
 ;;; Code:
 
-(defvar recursive-load-depth-limit)
 (eval-and-compile
+  (defvar recursive-load-depth-limit)
   (if (and (boundp 'recursive-load-depth-limit)
            (integerp recursive-load-depth-limit)
-           (> 50 recursive-load-depth-limit))
+           (< recursive-load-depth-limit 50))
       (setq recursive-load-depth-limit 50)))
 
 (eval-when-compile (require 'mh-acros))
 (mh-require-cl)
-(require 'gnus-util)
+
 (require 'font-lock)
-(require 'mouse)
-(load "tool-bar" t t)
-(require 'mh-loaddefs)
+(require 'gnus-util)
 (require 'mh-customize)
 (require 'mh-inc)
+(require 'mouse)
+(require 'sendmail)
 
-(load "mm-decode" t t)                  ; Non-fatal dependency
-(load "mm-view" t t)                    ; Non-fatal dependency
-(load "vcard" t t)                      ; Non-fatal dependency
-(load "hl-line" t t)                    ; Non-fatal dependency
-(load "executable" t t)                 ; Non-fatal dependency on
-                                        ; executable-find
-
-;; Shush the byte-compiler
-(defvar font-lock-auto-fontify)
-(defvar font-lock-defaults)
-(defvar mark-active)
+;; Non-fatal dependencies
+(load "hl-line" t t)
+(load "mm-decode" t t)
+(load "mm-view" t t)
+(load "tool-bar" t t)
+(load "vcard" t t)
 
 
 
@@ -69,7 +64,6 @@
 (autoload 'gnus-article-highlight-citation "gnus-cite")
 (autoload 'message-fetch-field "message")
 (autoload 'message-tokenize-header "message")
-(require 'sendmail)
 (unless (fboundp 'make-hash-table)
   (autoload 'make-hash-table "cl"))
 
@@ -471,11 +465,10 @@
 
 ;; Needed to help shush the byte-compiler.
 (if mh-xemacs-flag
-    (progn
-      (eval-and-compile
-        (require 'gnus)
-        (require 'gnus-art)
-        (require 'gnus-cite))))
+    (eval-and-compile
+      (require 'gnus)
+      (require 'gnus-art)
+      (require 'gnus-cite)))
 
 (defun mh-gnus-article-highlight-citation ()
   "Highlight cited text in current buffer using Gnus."
@@ -751,7 +744,6 @@
   (unlock-buffer)
   (setq buffer-file-name nil))
 
-
 (defun mh-get-msg-num (error-if-no-message)
   "Return the message number of the displayed message.
 If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if
@@ -1138,9 +1130,10 @@
 ;; Ensure new buffers won't get this mode if default-major-mode is nil.
 (put 'mh-show-mode 'mode-class 'special)
 
-;; Avoid compiler warnings in XEmacs and Emacs 20
+;; Shush compiler.
 (eval-when-compile
-  (defvar tool-bar-mode)
+  (defvar font-lock-auto-fontify)
+  (defvar font-lock-defaults)
   (defvar tool-bar-map))
 
 (define-derived-mode mh-show-mode text-mode "MH-Show"
@@ -1877,9 +1870,7 @@
   ;; XXX Note that MH-E no longer supports the `mh-visible-headers'
   ;; variable, so this function could be trimmed of this feature too."
   (let ((case-fold-search t)
-        (buffer-read-only nil)
-        (after-change-functions nil))   ;Work around emacs-20 font-lock bug
-                                        ;causing an endless loop.
+        (buffer-read-only nil))
     (save-restriction
       (goto-char start)
       (if (search-forward "\n\n" nil 'move)
@@ -2350,8 +2341,11 @@
       (remhash nil mh-sub-folders-cache))))
 
 (defvar mh-folder-hist nil)
-(defvar mh-speed-folder-map)
-(defvar mh-speed-flists-cache)
+
+;; Shush compiler.
+(eval-when-compile
+  (defvar mh-speed-folder-map)
+  (defvar mh-speed-flists-cache))
 
 (defvar mh-allow-root-folder-flag nil
   "Non-nil means \"+\" is an acceptable folder name.
@@ -2612,6 +2606,8 @@
     (mh-exec-cmd-quiet nil "mhparam" "-components" component)
     (mh-get-profile-field (concat component ":"))))
 
+(eval-when-compile (defvar mark-active)) ;shush compiler
+
 (defun mh-exchange-point-and-mark-preserving-active-mark ()
   "Put the mark where point is now, and point where the mark is now.
 This command works even when the mark is not active, and
@@ -2689,31 +2685,13 @@
     new-list))
 
 (defun mh-replace-string (old new)
-  "Replace all occurrences of OLD with NEW in the current buffer."
+  "Replace all occurrences of OLD with NEW in the current buffer.
+Ignores case when searching for OLD."
   (goto-char (point-min))
   (let ((case-fold-search t))
     (while (search-forward old nil t)
       (replace-match new t t))))
 
-(defun mh-replace-in-string (regexp newtext string)
-  "Replace REGEXP with NEWTEXT everywhere in STRING and return result.
-NEWTEXT is taken literally---no \\DIGIT escapes will be recognized.
-
-The function body was copied from `dired-replace-in-string' in
-dired.el.
-Emacs21 has `replace-regexp-in-string' while XEmacs has
-`replace-in-string'.
-Neither is present in Emacs20. The file gnus-util.el in Gnus 5.10.1
-and above has `gnus-replace-in-string'. We should use that when we
-decide to not support older versions of Gnus."
-  (let ((result "") (start 0) mb me)
-    (while (string-match regexp string start)
-      (setq mb (match-beginning 0)
-            me (match-end 0)
-            result (concat result (substring string start mb) newtext)
-            start me))
-    (concat result (substring string start))))
-
 (provide 'mh-utils)
 
 ;; Local Variables: