aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wohler2006-01-09 06:28:49 +0000
committerBill Wohler2006-01-09 06:28:49 +0000
commit7094eefe8034342f492f538676220e84fb8706e6 (patch)
tree5fe6d3752c4d755bc20868a8138b7ef118b548ab
parente1b3b7a2d93d2883817969f17d3764f2a15f69bc (diff)
downloademacs-7094eefe8034342f492f538676220e84fb8706e6.tar.gz
emacs-7094eefe8034342f492f538676220e84fb8706e6.zip
* 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.
-rw-r--r--lisp/mh-e/ChangeLog59
-rw-r--r--lisp/mh-e/mh-alias.el4
-rw-r--r--lisp/mh-e/mh-comp.el30
-rw-r--r--lisp/mh-e/mh-customize.el59
-rw-r--r--lisp/mh-e/mh-e.el38
-rw-r--r--lisp/mh-e/mh-funcs.el3
-rw-r--r--lisp/mh-e/mh-identity.el2
-rw-r--r--lisp/mh-e/mh-inc.el5
-rw-r--r--lisp/mh-e/mh-index.el2
-rw-r--r--lisp/mh-e/mh-init.el7
-rw-r--r--lisp/mh-e/mh-mime.el68
-rw-r--r--lisp/mh-e/mh-seq.el13
-rw-r--r--lisp/mh-e/mh-utils.el80
13 files changed, 183 insertions, 187 deletions
diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog
index f4cbbcea5d7..5702145e866 100644
--- a/lisp/mh-e/ChangeLog
+++ b/lisp/mh-e/ChangeLog
@@ -1,3 +1,62 @@
12006-01-08 Bill Wohler <wohler@newt.com>
2
3 Removed code that was marked as Emacs 20 compatible that was
4 easily found showing how important it is to document such
5 things (closes SF #1359240). Feel free to nuke any other Emacs 20
6 peculiarities that you find. Wrapped code for shushing compiler
7 with (eval-when-compile), sometimes moving the defvars closer to
8 where they were used.
9
10 * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string
11 instead of mh-replace-in-string as mh-replace-in-string was
12 replaced by a more appropriate defsubst in mh-xemacs.el.
13
14 * mh-comp.el: Require cleanup, wrap compiler-shushing defvars with
15 eval-when-compile.
16 (mh-file-is-vcard-p): Removed redundant test.
17
18 * mh-customize.el: Require cleanup, wrap compiler-shushing defvars
19 with eval-when-compile.
20 (mh-adaptive-cmd-note-flag, mh-invisible-header-fields)
21 (mh-invisible-header-fields-default): Add forward definitions.
22 (mh-invisible-header-fields-default): Alphabetize.
23
24 * mh-e.el: Require cleanup, wrap compiler-shushing defvars with
25 eval-when-compile.
26 (mh-thread-scan-line-map-stack, tool-bar-mode): Delete unused
27 variables.
28 (mh-colors-available-p): Just call display-color-cells. It's on
29 all supported Emacsen (and defaliased on XEmacs).
30
31 * mh-funcs.el:
32 * mh-inc.el:
33 * mh-init.el: Wrap compiler-shushing defvars with
34 eval-when-compile.
35
36 * mh-identity.el: Don't need (mh-require-cl).
37
38 * mh-index.el: Don't need to load executable any more.
39
40 * mh-mime.el: Wrap compiler-shushing defvars with
41 eval-when-compile.
42 (mh-have-file-command): Initialize variable to 'undefined. Add
43 docstring. Update function of same name accordingly. Also don't
44 need to load executable any more.
45 (mh-mime-content-types): Delete.
46 (mh-minibuffer-read-type): Prompt user for type if
47 mh-file-mime-type returns application/octet-stream. Assume we have
48 mailcap-mime-types.
49 (mh-mime-display): Update error message.
50
51 * mh-seq.el: Require cleanup, and wrap compiler-shushing defvars
52 with eval-when-compile.
53
54 * mh-utils.el: Require cleanup, and wrap compiler-shushing defvars
55 with eval-when-compile.
56 (mh-clean-msg-header): Don't set after-change-functions to nil.
57 (mh-replace-in-string): Remove. Create defsubst in mh-xemacs.el
58 instead.
59
12006-01-07 Bill Wohler <wohler@newt.com> 602006-01-07 Bill Wohler <wohler@newt.com>
2 61
3 * mh-customize.el: Updated Faces documentation in header. 62 * mh-customize.el: Updated Faces documentation in header.
diff --git a/lisp/mh-e/mh-alias.el b/lisp/mh-e/mh-alias.el
index a1bafb3ec51..c1476a26535 100644
--- a/lisp/mh-e/mh-alias.el
+++ b/lisp/mh-e/mh-alias.el
@@ -132,10 +132,10 @@ COMMA-SEPARATOR is non-nil."
132 (setq res (match-string 1 res))) 132 (setq res (match-string 1 res)))
133 ;; Replace "&" with capitalized username 133 ;; Replace "&" with capitalized username
134 (if (string-match "&" res) 134 (if (string-match "&" res)
135 (setq res (mh-replace-in-string "&" (capitalize username) res))) 135 (setq res (replace-regexp-in-string "&" (capitalize username) res)))
136 ;; Remove " character 136 ;; Remove " character
137 (if (string-match "\"" res) 137 (if (string-match "\"" res)
138 (setq res (mh-replace-in-string "\"" "" res))) 138 (setq res (replace-regexp-in-string "\"" "" res)))
139 ;; If empty string, use username instead 139 ;; If empty string, use username instead
140 (if (string-equal "" res) 140 (if (string-equal "" res)
141 (setq res username)) 141 (setq res username))
diff --git a/lisp/mh-e/mh-comp.el b/lisp/mh-e/mh-comp.el
index 9a4c8733959..fc212640110 100644
--- a/lisp/mh-e/mh-comp.el
+++ b/lisp/mh-e/mh-comp.el
@@ -35,24 +35,17 @@
35 35
36(eval-when-compile (require 'mh-acros)) 36(eval-when-compile (require 'mh-acros))
37(mh-require-cl) 37(mh-require-cl)
38(require 'mh-e) 38
39(require 'gnus-util)
40(require 'easymenu) 39(require 'easymenu)
40(require 'gnus-util)
41(require 'mh-e)
41(require 'mh-gnus) 42(require 'mh-gnus)
43
42(eval-when (compile load eval) 44(eval-when (compile load eval)
43 (ignore-errors (require 'mailabbrev))) 45 (ignore-errors (require 'mailabbrev)))
44 46
45;; Shush the byte-compiler
46(defvar adaptive-fill-first-line-regexp)
47(defvar font-lock-defaults)
48(defvar mark-active)
49(defvar sendmail-coding-system)
50(defvar mh-identity-list)
51(defvar mh-identity-default)
52(defvar mh-mml-mode-default)
53(defvar mh-identity-menu)
54
55 47
48
56;;; Autoloads 49;;; Autoloads
57 50
58(autoload 'mail-mode-fill-paragraph "sendmail") 51(autoload 'mail-mode-fill-paragraph "sendmail")
@@ -958,10 +951,12 @@ Prefix ARG means justify as well. This function enables
958 (mail-mode-fill-paragraph arg) 951 (mail-mode-fill-paragraph arg)
959 (fill-paragraph arg)))) 952 (fill-paragraph arg))))
960 953
961;; Avoid compiler warnings in XEmacs and Emacs 20 954;; Shush compiler.
962(eval-when-compile 955(eval-when-compile
963 (defvar tool-bar-mode) 956 (defvar adaptive-fill-first-line-regexp)
964 (defvar tool-bar-map)) 957 (defvar tool-bar-map)
958 (defvar font-lock-defaults)
959)
965 960
966(defvar mh-letter-buttons-init-flag nil) 961(defvar mh-letter-buttons-init-flag nil)
967 962
@@ -1177,8 +1172,7 @@ a copy of the draft."
1177 (file-exists-p file) 1172 (file-exists-p file)
1178 (or (and (not (mh-have-file-command)) 1173 (or (and (not (mh-have-file-command))
1179 (not (null (string-match "\.vcf$" file)))) 1174 (not (null (string-match "\.vcf$" file))))
1180 (and (mh-have-file-command) 1175 (string-equal "text/x-vcard" (mh-file-mime-type file))))))
1181 (string-equal "text/x-vcard" (mh-file-mime-type file)))))))
1182 1176
1183;;;###mh-autoload 1177;;;###mh-autoload
1184(defun mh-insert-signature (&optional file) 1178(defun mh-insert-signature (&optional file)
@@ -1469,6 +1463,8 @@ doesn't exist there."
1469 unless (eq charset 'ascii) return nil 1463 unless (eq charset 'ascii) return nil
1470 finally return t)) 1464 finally return t))
1471 1465
1466(eval-when-compile (defvar sendmail-coding-system)) ;shush compiler
1467
1472;;;###mh-autoload 1468;;;###mh-autoload
1473(defun mh-send-letter (&optional arg) 1469(defun mh-send-letter (&optional arg)
1474 "Save draft and send message. 1470 "Save draft and send message.
diff --git a/lisp/mh-e/mh-customize.el b/lisp/mh-e/mh-customize.el
index 34593429e5a..fc39089b43c 100644
--- a/lisp/mh-e/mh-customize.el
+++ b/lisp/mh-e/mh-customize.el
@@ -67,21 +67,17 @@
67 67
68(eval-when-compile (require 'mh-acros)) 68(eval-when-compile (require 'mh-acros))
69(mh-require-cl) 69(mh-require-cl)
70(require 'mh-loaddefs)
71 70
72(eval-and-compile 71(eval-and-compile
73 (defvar mh-xemacs-flag (featurep 'xemacs) 72 (defvar mh-xemacs-flag (featurep 'xemacs)
74 "Non-nil means the current Emacs is XEmacs.")) 73 "Non-nil means the current Emacs is XEmacs.")
74 (when mh-xemacs-flag
75 (require 'mh-xemacs)))
75 76
76(when mh-xemacs-flag 77(eval-and-compile
77 (require 'mh-xemacs)) 78 (require 'mh-identity)
78
79;; XXX: Functions autoloaded from the following files are used to initialize
80;; customizable variables. They are require'd here, since otherwise the
81;; corresponding .elc would be loaded at compile time.
82(eval-when-compile
83 (require 'mh-init) 79 (require 'mh-init)
84 (require 'mh-identity)) 80 (require 'mh-loaddefs))
85 81
86;; For compiler warnings... 82;; For compiler warnings...
87(eval-when-compile 83(eval-when-compile
@@ -1031,8 +1027,7 @@ message 200, then use the range \"200:200\"."
1031 1027
1032;;; Scan Line Formats (:group 'mh-scan-line-formats) 1028;;; Scan Line Formats (:group 'mh-scan-line-formats)
1033 1029
1034;; Forward definition to avoid compiler and runtime error. 1030(defvar mh-scan-format-file t) ;forward definition
1035(defvar mh-scan-format-file t)
1036 1031
1037(defun mh-adaptive-cmd-note-flag-check (symbol value) 1032(defun mh-adaptive-cmd-note-flag-check (symbol value)
1038 "Check if desired setting is legal. 1033 "Check if desired setting is legal.
@@ -1045,6 +1040,8 @@ Otherwise, set SYMBOL to VALUE."
1045 "is set to \"Use MH-E scan Format\"") 1040 "is set to \"Use MH-E scan Format\"")
1046 (set-default symbol value))) 1041 (set-default symbol value)))
1047 1042
1043(defvar mh-adaptive-cmd-note-flag) ;forward definition
1044
1048(defun mh-scan-format-file-check (symbol value) 1045(defun mh-scan-format-file-check (symbol value)
1049 "Check if desired setting is legal. 1046 "Check if desired setting is legal.
1050Throw an error if user tries to set `mh-scan-format-file' to 1047Throw an error if user tries to set `mh-scan-format-file' to
@@ -1598,6 +1595,10 @@ Do not alter this variable directly. Instead, customize
1598hidden that you wish to display, and add extra entries to hide in 1595hidden that you wish to display, and add extra entries to hide in
1599`mh-invisible-header-fields'.") 1596`mh-invisible-header-fields'.")
1600 1597
1598;; Forward definition.
1599(defvar mh-invisible-header-fields)
1600(defvar mh-invisible-header-fields-default nil)
1601
1601(defun mh-invisible-headers () 1602(defun mh-invisible-headers ()
1602 "Make or remake the variable `mh-invisible-header-fields-compiled'. 1603 "Make or remake the variable `mh-invisible-header-fields-compiled'.
1603Done using `mh-invisible-header-fields-internal' as input, from 1604Done using `mh-invisible-header-fields-internal' as input, from
@@ -1623,23 +1624,6 @@ removed and entries from `mh-invisible-header-fields' are added."
1623 (regexp-opt fields t)))) 1624 (regexp-opt fields t))))
1624 (setq mh-invisible-header-fields-compiled nil)))) 1625 (setq mh-invisible-header-fields-compiled nil))))
1625 1626
1626(defcustom mh-invisible-header-fields-default nil
1627 "*List of hidden header fields.
1628
1629The header fields listed in this option are hidden, although you
1630can check off any field that you would like to see.
1631
1632Header fields that you would like to hide that aren't listed can
1633be added to the option `mh-invisible-header-fields'.
1634
1635See also `mh-clean-message-header-flag'."
1636 :type `(set ,@(mapcar (lambda (x) `(const ,x))
1637 mh-invisible-header-fields-internal))
1638 :set (lambda (symbol value)
1639 (set-default symbol value)
1640 (mh-invisible-headers))
1641 :group 'mh-show)
1642
1643(defcustom mh-invisible-header-fields nil 1627(defcustom mh-invisible-header-fields nil
1644 "*Additional header fields to hide. 1628 "*Additional header fields to hide.
1645 1629
@@ -1660,6 +1644,23 @@ See also `mh-clean-message-header-flag'."
1660 (mh-invisible-headers)) 1644 (mh-invisible-headers))
1661 :group 'mh-show) 1645 :group 'mh-show)
1662 1646
1647(defcustom mh-invisible-header-fields-default nil
1648 "*List of hidden header fields.
1649
1650The header fields listed in this option are hidden, although you
1651can check off any field that you would like to see.
1652
1653Header fields that you would like to hide that aren't listed can
1654be added to the option `mh-invisible-header-fields'.
1655
1656See also `mh-clean-message-header-flag'."
1657 :type `(set ,@(mapcar (lambda (x) `(const ,x))
1658 mh-invisible-header-fields-internal))
1659 :set (lambda (symbol value)
1660 (set-default symbol value)
1661 (mh-invisible-headers))
1662 :group 'mh-show)
1663
1663(defcustom mh-lpr-command-format "lpr -J '%s'" 1664(defcustom mh-lpr-command-format "lpr -J '%s'"
1664 "*Command used to print\\<mh-folder-mode-map>. 1665 "*Command used to print\\<mh-folder-mode-map>.
1665 1666
diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el
index 8d0760f331f..b5c8d7107a6 100644
--- a/lisp/mh-e/mh-e.el
+++ b/lisp/mh-e/mh-e.el
@@ -51,7 +51,9 @@
51 51
52;; MH-E is an Emacs interface to the MH mail system. 52;; MH-E is an Emacs interface to the MH mail system.
53 53
54;; MH-E is supported in GNU Emacs 20 and 21, with MH 6.8.4 and nmh 1.0.4. 54;; MH-E is supported in GNU Emacs 21 and 22 as well as XEmacs 21
55;; (except for versions 21.5.9-21.5.16), with MH 6.8.4 on, nmh 1.0.4
56;; on, and GNU mailutils 0.4 on.
55 57
56;; Mailing Lists: 58;; Mailing Lists:
57;; mh-e-users@lists.sourceforge.net 59;; mh-e-users@lists.sourceforge.net
@@ -87,17 +89,11 @@
87 89
88(eval-when-compile (require 'mh-acros)) 90(eval-when-compile (require 'mh-acros))
89(mh-require-cl) 91(mh-require-cl)
90(require 'mh-utils)
91(require 'mh-init)
92(require 'mh-inc)
93(require 'mh-seq)
94(require 'gnus-util)
95(require 'easymenu)
96 92
97;; Shush the byte-compiler 93(require 'easymenu)
98(eval-when-compile 94(require 'gnus-util)
99 (defvar font-lock-auto-fontify) 95(require 'mh-seq)
100 (defvar font-lock-defaults)) 96(require 'mh-utils)
101 97
102(defconst mh-version "7.85+cvs" "Version number of MH-E.") 98(defconst mh-version "7.85+cvs" "Version number of MH-E.")
103 99
@@ -1184,8 +1180,6 @@ if it is available."
1184 (when (consp part-index) (setq part-index (car part-index))) 1180 (when (consp part-index) (setq part-index (car part-index)))
1185 (mh-folder-mime-action part-index #'mh-mime-save-part nil)) 1181 (mh-folder-mime-action part-index #'mh-mime-save-part nil))
1186 1182
1187(defvar mh-thread-scan-line-map-stack)
1188
1189(defun mh-reset-threads-and-narrowing () 1183(defun mh-reset-threads-and-narrowing ()
1190 "Reset all variables pertaining to threads and narrowing. 1184 "Reset all variables pertaining to threads and narrowing.
1191Also removes all content from the folder buffer." 1185Also removes all content from the folder buffer."
@@ -1761,18 +1755,19 @@ onward while the latter is used in previous versions and XEmacs."
1761 ''write-file-functions ;Emacs 21.4 1755 ''write-file-functions ;Emacs 21.4
1762 ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs 1756 ''local-write-file-hooks)) ;<Emacs 21.4, XEmacs
1763 1757
1764;; Avoid compiler warnings in non-bleeding edge versions of Emacs.
1765(eval-when-compile
1766 (defvar tool-bar-mode)
1767 (defvar tool-bar-map)
1768 (defvar desktop-save-buffer)) ;Emacs 21.4
1769
1770;; Register mh-folder-mode as supporting which-function-mode... 1758;; Register mh-folder-mode as supporting which-function-mode...
1771(load "which-func" t t) 1759(load "which-func" t t)
1772(when (and (boundp 'which-func-modes) 1760(when (and (boundp 'which-func-modes)
1773 (not (member 'mh-folder-mode which-func-modes))) 1761 (not (member 'mh-folder-mode which-func-modes)))
1774 (push 'mh-folder-mode which-func-modes)) 1762 (push 'mh-folder-mode which-func-modes))
1775 1763
1764;; Shush compiler in non-bleeding edge versions of Emacs.
1765(eval-when-compile
1766 (defvar desktop-save-buffer) ;Emacs 21.4
1767 (defvar font-lock-auto-fontify)
1768 (defvar font-lock-defaults)
1769 (defvar tool-bar-map))
1770
1776(defvar mh-folder-buttons-init-flag nil) 1771(defvar mh-folder-buttons-init-flag nil)
1777 1772
1778;; Autoload cookie needed by desktop.el 1773;; Autoload cookie needed by desktop.el
@@ -1913,10 +1908,7 @@ perform the operation on all messages in that region.
1913(defun mh-colors-available-p () 1908(defun mh-colors-available-p ()
1914 "Check if colors are available in the Emacs being used." 1909 "Check if colors are available in the Emacs being used."
1915 (or mh-xemacs-flag 1910 (or mh-xemacs-flag
1916 (let ((color-cells 1911 (let ((color-cells (display-color-cells)))
1917 (or (ignore-errors (mh-funcall-if-exists display-color-cells))
1918 (ignore-errors (mh-funcall-if-exists
1919 x-display-color-cells)))))
1920 (and (numberp color-cells) (>= color-cells 8))))) 1912 (and (numberp color-cells) (>= color-cells 8)))))
1921 1913
1922(defun mh-colors-in-use-p () 1914(defun mh-colors-in-use-p ()
diff --git a/lisp/mh-e/mh-funcs.el b/lisp/mh-e/mh-funcs.el
index 4fb64b4cd17..f7a51e83902 100644
--- a/lisp/mh-e/mh-funcs.el
+++ b/lisp/mh-e/mh-funcs.el
@@ -149,8 +149,7 @@ Display the results only if something went wrong."
149 (re-search-forward "^rmf: " (point-max) t)) 149 (re-search-forward "^rmf: " (point-max) t))
150 (display-buffer mh-temp-buffer))) 150 (display-buffer mh-temp-buffer)))
151 151
152;; Avoid compiler warning... 152(eval-when-compile (defvar view-exit-action)) ;shush compile
153(defvar view-exit-action)
154 153
155;;;###mh-autoload 154;;;###mh-autoload
156(defun mh-list-folders () 155(defun mh-list-folders ()
diff --git a/lisp/mh-e/mh-identity.el b/lisp/mh-e/mh-identity.el
index 1af2563eeda..5f17d0be4ef 100644
--- a/lisp/mh-e/mh-identity.el
+++ b/lisp/mh-e/mh-identity.el
@@ -40,7 +40,7 @@
40;;; Code: 40;;; Code:
41 41
42(eval-when-compile (require 'mh-acros)) 42(eval-when-compile (require 'mh-acros))
43(mh-require-cl) 43
44(require 'mh-comp) 44(require 'mh-comp)
45 45
46(autoload 'mml-insert-tag "mml") 46(autoload 'mml-insert-tag "mml")
diff --git a/lisp/mh-e/mh-inc.el b/lisp/mh-e/mh-inc.el
index 51f84f7fb38..29a9d1531a2 100644
--- a/lisp/mh-e/mh-inc.el
+++ b/lisp/mh-e/mh-inc.el
@@ -1,6 +1,6 @@
1;;; mh-inc.el --- MH-E "inc" and separate mail spool handling 1;;; mh-inc.el --- MH-E "inc" and separate mail spool handling
2;; 2;;
3;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
4 4
5;; Author: Peter S. Galbraith <psg@debian.org> 5;; Author: Peter S. Galbraith <psg@debian.org>
6;; Maintainer: Bill Wohler <wohler@newt.com> 6;; Maintainer: Bill Wohler <wohler@newt.com>
@@ -73,8 +73,7 @@
73 (char-to-string key) 73 (char-to-string key)
74 "] inc " folder " folder\n")))) 74 "] inc " folder " folder\n"))))
75 75
76;; Avoid compiler warning 76(eval-when-compile (defvar mh-inc-spool-list)) ;shush compiler
77(defvar mh-inc-spool-list)
78 77
79(defun mh-inc-spool-make () 78(defun mh-inc-spool-make ()
80 "Make all commands and defines keys for contents of `mh-inc-spool-list'." 79 "Make all commands and defines keys for contents of `mh-inc-spool-list'."
diff --git a/lisp/mh-e/mh-index.el b/lisp/mh-e/mh-index.el
index c1a30ac68b2..73b30e54726 100644
--- a/lisp/mh-e/mh-index.el
+++ b/lisp/mh-e/mh-index.el
@@ -45,6 +45,7 @@
45 45
46(eval-when-compile (require 'mh-acros)) 46(eval-when-compile (require 'mh-acros))
47(mh-require-cl) 47(mh-require-cl)
48
48(require 'mh-e) 49(require 'mh-e)
49(require 'mh-mime) 50(require 'mh-mime)
50(require 'mh-pick) 51(require 'mh-pick)
@@ -52,7 +53,6 @@
52(autoload 'gnus-local-map-property "gnus-util") 53(autoload 'gnus-local-map-property "gnus-util")
53(autoload 'gnus-eval-format "gnus-spec") 54(autoload 'gnus-eval-format "gnus-spec")
54(autoload 'widget-convert-button "wid-edit") 55(autoload 'widget-convert-button "wid-edit")
55(autoload 'executable-find "executable")
56 56
57;; Support different indexing programs 57;; Support different indexing programs
58(defvar mh-indexer-choices 58(defvar mh-indexer-choices
diff --git a/lisp/mh-e/mh-init.el b/lisp/mh-e/mh-init.el
index 2297fef6a80..dec107a8030 100644
--- a/lisp/mh-e/mh-init.el
+++ b/lisp/mh-e/mh-init.el
@@ -43,9 +43,6 @@
43(mh-require-cl) 43(mh-require-cl)
44(require 'mh-utils) 44(require 'mh-utils)
45 45
46;; Avoid compiler warnings.
47(eval-when-compile (defvar image-load-path))
48
49;; Set for local environment: 46;; Set for local environment:
50;; mh-progs and mh-lib used to be set in paths.el, which tried to 47;; mh-progs and mh-lib used to be set in paths.el, which tried to
51;; figure out at build time which of several possible directories MH 48;; figure out at build time which of several possible directories MH
@@ -300,6 +297,8 @@ This assumes that a temporary buffer is setup."
300 297
301 298
302 299
300(eval-when-compile (defvar image-load-path)) ;shush compiler
301
303(defvar mh-image-load-path-called-flag nil) 302(defvar mh-image-load-path-called-flag nil)
304 303
305;;;###mh-autoload 304;;;###mh-autoload
@@ -328,6 +327,8 @@ there. Otherwise, the images directory is added to the
328 327
329 328
330 329
330;;; Support routines for mh-customize.el
331
331(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag) 332(defvar mh-min-colors-defined-flag (and (not mh-xemacs-flag)
332 (>= emacs-major-version 22)) 333 (>= emacs-major-version 22))
333 "Non-nil means defface supports min-colors display requirement.") 334 "Non-nil means defface supports min-colors display requirement.")
diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el
index 7336d7034ee..ad7a3bc5ce5 100644
--- a/lisp/mh-e/mh-mime.el
+++ b/lisp/mh-e/mh-mime.el
@@ -38,8 +38,9 @@
38 38
39(eval-when-compile (require 'mh-acros)) 39(eval-when-compile (require 'mh-acros))
40(mh-require-cl) 40(mh-require-cl)
41(require 'mh-comp) 41
42(require 'gnus-util) 42(require 'gnus-util)
43(require 'mh-comp)
43(require 'mh-gnus) 44(require 'mh-gnus)
44 45
45(autoload 'article-emphasize "gnus-art") 46(autoload 'article-emphasize "gnus-art")
@@ -132,16 +133,16 @@ given a prefix argument. Normally default arguments to
132 "/[-.+a-zA-Z0-9]+") 133 "/[-.+a-zA-Z0-9]+")
133 "Regexp matching valid media types used in MIME attachment compositions.") 134 "Regexp matching valid media types used in MIME attachment compositions.")
134 135
135;; Just defvar the variable to avoid compiler warning... This doesn't bind 136(defvar mh-have-file-command 'undefined
136;; the variable, so things should work exactly as before. 137 "Cached value of `mh-have-file-command'.
137(defvar mh-have-file-command) 138Do not reference this variable directly as it might not have been
139initialized. Always use the command `mh-have-file-command'.")
138 140
139;;;###mh-autoload 141;;;###mh-autoload
140(defun mh-have-file-command () 142(defun mh-have-file-command ()
141 "Return t if 'file' command is on the system. 143 "Return t if 'file' command is on the system.
142'file -i' is used to get MIME type of composition insertion." 144'file -i' is used to get MIME type of composition insertion."
143 (when (not (boundp 'mh-have-file-command)) 145 (when (eq mh-have-file-command 'undefined)
144 (load "executable" t t) ; executable-find not autoloaded in emacs20
145 (setq mh-have-file-command 146 (setq mh-have-file-command
146 (and (fboundp 'executable-find) 147 (and (fboundp 'executable-find)
147 (executable-find "file") ; file command exists 148 (executable-find "file") ; file command exists
@@ -183,9 +184,10 @@ variable."
183Returns nil if file command not on system." 184Returns nil if file command not on system."
184 (cond 185 (cond
185 ((not (mh-have-file-command)) 186 ((not (mh-have-file-command))
186 nil) ;No file command, exit now. 187 nil) ;no file command, exit now
187 ((not (and (file-exists-p filename)(file-readable-p filename))) 188 ((not (and (file-exists-p filename)
188 nil) 189 (file-readable-p filename)))
190 nil) ;no file or not readable, ditto
189 (t 191 (t
190 (save-excursion 192 (save-excursion
191 (let ((tmp-buffer (get-buffer-create mh-temp-buffer))) 193 (let ((tmp-buffer (get-buffer-create mh-temp-buffer)))
@@ -200,36 +202,6 @@ Returns nil if file command not on system."
200 (mh-file-mime-type-substitute (match-string 0) filename))) 202 (mh-file-mime-type-substitute (match-string 0) filename)))
201 (kill-buffer tmp-buffer))))))) 203 (kill-buffer tmp-buffer)))))))
202 204
203(defvar mh-mime-content-types
204 '(("application/mac-binhex40") ("application/msword")
205 ("application/octet-stream") ("application/pdf") ("application/pgp-keys")
206 ("application/pgp-signature") ("application/pkcs7-signature")
207 ("application/postscript") ("application/rtf")
208 ("application/vnd.ms-excel") ("application/vnd.ms-powerpoint")
209 ("application/vnd.ms-project") ("application/vnd.ms-tnef")
210 ("application/wordperfect5.1") ("application/wordperfect6.0")
211 ("application/zip")
212
213 ("audio/basic") ("audio/mpeg")
214
215 ("image/gif") ("image/jpeg") ("image/png")
216
217 ("message/delivery-status")
218 ("message/external-body") ("message/partial") ("message/rfc822")
219
220 ("text/enriched") ("text/html") ("text/plain") ("text/rfc822-headers")
221 ("text/richtext") ("text/x-vcard") ("text/xml")
222
223 ("video/mpeg") ("video/quicktime"))
224 "Valid MIME content types for Emacs 20.
225Obsolete; use `mailcap-mime-types'.
226
227See also \\[mh-mh-to-mime].")
228
229;; Delete mh-minibuffer-read-type and mh-mime-content-types and use
230;; mml-minibuffer-read-type when Emacs20 is no longer supported unless we
231;; think (mh-file-mime-type) is better than (mm-default-file-encoding).
232
233(defun mh-minibuffer-read-type (filename &optional default) 205(defun mh-minibuffer-read-type (filename &optional default)
234 "Return the content type associated with the given FILENAME. 206 "Return the content type associated with the given FILENAME.
235If the \"file\" command exists and recognizes the given file, 207If the \"file\" command exists and recognizes the given file,
@@ -241,12 +213,12 @@ Optional argument DEFAULT is returned if a type isn't entered."
241 (let* ((default (or default 213 (let* ((default (or default
242 (mm-default-file-encoding filename) 214 (mm-default-file-encoding filename)
243 "application/octet-stream")) 215 "application/octet-stream"))
244 (type (or (mh-file-mime-type filename) 216 (probed-type (mh-file-mime-type filename))
217 (type (or (and (not (equal probed-type "application/octet-stream"))
218 probed-type)
245 (completing-read 219 (completing-read
246 (format "Content type (default %s): " default) 220 (format "Content type (default %s): " default)
247 (if (fboundp 'mailcap-mime-types) 221 (mapcar 'list (mailcap-mime-types))))))
248 (mapcar 'list (mailcap-mime-types))
249 mh-mime-content-types)))))
250 (if (not (equal type "")) 222 (if (not (equal type ""))
251 type 223 type
252 default))) 224 default)))
@@ -619,7 +591,7 @@ automatically."
619 (mml-insert-empty-tag 'part 'type type 'filename file 591 (mml-insert-empty-tag 'part 'type type 'filename file
620 'disposition dispos 'description description))) 592 'disposition dispos 'description description)))
621 593
622(defvar mh-identity-pgg-default-user-id) 594(eval-when-compile (defvar mh-identity-pgg-default-user-id)) ;shush compiler
623 595
624(defun mh-secure-message (method mode &optional identity) 596(defun mh-secure-message (method mode &optional identity)
625 "Add tag to encrypt or sign message. 597 "Add tag to encrypt or sign message.
@@ -969,8 +941,7 @@ parsed and then displayed."
969 (mh-mime-display-part handles)) 941 (mh-mime-display-part handles))
970 (t (mh-signature-highlight)))) 942 (t (mh-signature-highlight))))
971 (error 943 (error
972 (message "Please report this error:\n %s" 944 (message "Could not display body: %s" (error-message-string err))
973 (error-message-string err))
974 (delete-region (point-min) (point-max)) 945 (delete-region (point-min) (point-max))
975 (insert raw-message-data)))))) 946 (insert raw-message-data))))))
976 947
@@ -1444,8 +1415,9 @@ Parameter EL is unused."
1444 1415
1445;; These variables should already be initialized in mm-decode.el if we have a 1416;; These variables should already be initialized in mm-decode.el if we have a
1446;; recent enough Gnus. The defvars are here to avoid compiler warnings. 1417;; recent enough Gnus. The defvars are here to avoid compiler warnings.
1447(defvar mm-verify-function-alist nil) 1418(eval-when-compile
1448(defvar mm-decrypt-function-alist nil) 1419 (defvar mm-verify-function-alist nil)
1420 (defvar mm-decrypt-function-alist nil))
1449 1421
1450(defvar pressed-details) 1422(defvar pressed-details)
1451 1423
diff --git a/lisp/mh-e/mh-seq.el b/lisp/mh-e/mh-seq.el
index 53bae76cc07..40eaaff37cd 100644
--- a/lisp/mh-e/mh-seq.el
+++ b/lisp/mh-e/mh-seq.el
@@ -73,10 +73,8 @@
73 73
74(eval-when-compile (require 'mh-acros)) 74(eval-when-compile (require 'mh-acros))
75(mh-require-cl) 75(mh-require-cl)
76(require 'mh-e)
77 76
78;; Shush the byte-compiler 77(require 'mh-e)
79(defvar tool-bar-mode)
80 78
81 79
82 80
@@ -171,8 +169,7 @@ you want to delete the messages, use \"\\[universal-argument]
171 (when (and (eq sequence mh-unseen-seq) (mh-speed-flists-active-p)) 169 (when (and (eq sequence mh-unseen-seq) (mh-speed-flists-active-p))
172 (apply #'mh-speed-flists t folders-changed)))) 170 (apply #'mh-speed-flists t folders-changed))))
173 171
174;; Avoid compiler warnings 172(eval-when-compile (defvar view-exit-action)) ;shush compiler
175(defvar view-exit-action)
176 173
177;;;###mh-autoload 174;;;###mh-autoload
178(defun mh-list-sequences () 175(defun mh-list-sequences ()
@@ -239,8 +236,10 @@ MESSAGE appears."
239 (mh-list-to-string (mh-seq-containing-msg message t)) 236 (mh-list-to-string (mh-seq-containing-msg message t))
240 " ")))) 237 " "))))
241 238
242;; Avoid compiler warning 239;; Shush compiler
243(defvar tool-bar-map) 240(eval-when-compile
241 (defvar tool-bar-map)
242 (defvar tool-bar-mode))
244 243
245(make-variable-buffer-local 'mh-non-seq-mode-line-annotation) 244(make-variable-buffer-local 'mh-non-seq-mode-line-annotation)
246 245
diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el
index f3205a932a2..fbb3b5aa260 100644
--- a/lisp/mh-e/mh-utils.el
+++ b/lisp/mh-e/mh-utils.el
@@ -33,34 +33,29 @@
33 33
34;;; Code: 34;;; Code:
35 35
36(defvar recursive-load-depth-limit)
37(eval-and-compile 36(eval-and-compile
37 (defvar recursive-load-depth-limit)
38 (if (and (boundp 'recursive-load-depth-limit) 38 (if (and (boundp 'recursive-load-depth-limit)
39 (integerp recursive-load-depth-limit) 39 (integerp recursive-load-depth-limit)
40 (> 50 recursive-load-depth-limit)) 40 (< recursive-load-depth-limit 50))
41 (setq recursive-load-depth-limit 50))) 41 (setq recursive-load-depth-limit 50)))
42 42
43(eval-when-compile (require 'mh-acros)) 43(eval-when-compile (require 'mh-acros))
44(mh-require-cl) 44(mh-require-cl)
45(require 'gnus-util) 45
46(require 'font-lock) 46(require 'font-lock)
47(require 'mouse) 47(require 'gnus-util)
48(load "tool-bar" t t)
49(require 'mh-loaddefs)
50(require 'mh-customize) 48(require 'mh-customize)
51(require 'mh-inc) 49(require 'mh-inc)
50(require 'mouse)
51(require 'sendmail)
52 52
53(load "mm-decode" t t) ; Non-fatal dependency 53;; Non-fatal dependencies
54(load "mm-view" t t) ; Non-fatal dependency 54(load "hl-line" t t)
55(load "vcard" t t) ; Non-fatal dependency 55(load "mm-decode" t t)
56(load "hl-line" t t) ; Non-fatal dependency 56(load "mm-view" t t)
57(load "executable" t t) ; Non-fatal dependency on 57(load "tool-bar" t t)
58 ; executable-find 58(load "vcard" t t)
59
60;; Shush the byte-compiler
61(defvar font-lock-auto-fontify)
62(defvar font-lock-defaults)
63(defvar mark-active)
64 59
65 60
66 61
@@ -69,7 +64,6 @@
69(autoload 'gnus-article-highlight-citation "gnus-cite") 64(autoload 'gnus-article-highlight-citation "gnus-cite")
70(autoload 'message-fetch-field "message") 65(autoload 'message-fetch-field "message")
71(autoload 'message-tokenize-header "message") 66(autoload 'message-tokenize-header "message")
72(require 'sendmail)
73(unless (fboundp 'make-hash-table) 67(unless (fboundp 'make-hash-table)
74 (autoload 'make-hash-table "cl")) 68 (autoload 'make-hash-table "cl"))
75 69
@@ -471,11 +465,10 @@ operation."
471 465
472;; Needed to help shush the byte-compiler. 466;; Needed to help shush the byte-compiler.
473(if mh-xemacs-flag 467(if mh-xemacs-flag
474 (progn 468 (eval-and-compile
475 (eval-and-compile 469 (require 'gnus)
476 (require 'gnus) 470 (require 'gnus-art)
477 (require 'gnus-art) 471 (require 'gnus-cite)))
478 (require 'gnus-cite))))
479 472
480(defun mh-gnus-article-highlight-citation () 473(defun mh-gnus-article-highlight-citation ()
481 "Highlight cited text in current buffer using Gnus." 474 "Highlight cited text in current buffer using Gnus."
@@ -751,7 +744,6 @@ preserved."
751 (unlock-buffer) 744 (unlock-buffer)
752 (setq buffer-file-name nil)) 745 (setq buffer-file-name nil))
753 746
754
755(defun mh-get-msg-num (error-if-no-message) 747(defun mh-get-msg-num (error-if-no-message)
756 "Return the message number of the displayed message. 748 "Return the message number of the displayed message.
757If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if 749If the argument ERROR-IF-NO-MESSAGE is non-nil, then complain if
@@ -1138,9 +1130,10 @@ still visible.\n")
1138;; Ensure new buffers won't get this mode if default-major-mode is nil. 1130;; Ensure new buffers won't get this mode if default-major-mode is nil.
1139(put 'mh-show-mode 'mode-class 'special) 1131(put 'mh-show-mode 'mode-class 'special)
1140 1132
1141;; Avoid compiler warnings in XEmacs and Emacs 20 1133;; Shush compiler.
1142(eval-when-compile 1134(eval-when-compile
1143 (defvar tool-bar-mode) 1135 (defvar font-lock-auto-fontify)
1136 (defvar font-lock-defaults)
1144 (defvar tool-bar-map)) 1137 (defvar tool-bar-map))
1145 1138
1146(define-derived-mode mh-show-mode text-mode "MH-Show" 1139(define-derived-mode mh-show-mode text-mode "MH-Show"
@@ -1877,9 +1870,7 @@ ignored if VISIBLE-HEADERS is non-nil."
1877 ;; XXX Note that MH-E no longer supports the `mh-visible-headers' 1870 ;; XXX Note that MH-E no longer supports the `mh-visible-headers'
1878 ;; variable, so this function could be trimmed of this feature too." 1871 ;; variable, so this function could be trimmed of this feature too."
1879 (let ((case-fold-search t) 1872 (let ((case-fold-search t)
1880 (buffer-read-only nil) 1873 (buffer-read-only nil))
1881 (after-change-functions nil)) ;Work around emacs-20 font-lock bug
1882 ;causing an endless loop.
1883 (save-restriction 1874 (save-restriction
1884 (goto-char start) 1875 (goto-char start)
1885 (if (search-forward "\n\n" nil 'move) 1876 (if (search-forward "\n\n" nil 'move)
@@ -2350,8 +2341,11 @@ otherwise completion on +foo won't tell us about the option
2350 (remhash nil mh-sub-folders-cache)))) 2341 (remhash nil mh-sub-folders-cache))))
2351 2342
2352(defvar mh-folder-hist nil) 2343(defvar mh-folder-hist nil)
2353(defvar mh-speed-folder-map) 2344
2354(defvar mh-speed-flists-cache) 2345;; Shush compiler.
2346(eval-when-compile
2347 (defvar mh-speed-folder-map)
2348 (defvar mh-speed-flists-cache))
2355 2349
2356(defvar mh-allow-root-folder-flag nil 2350(defvar mh-allow-root-folder-flag nil
2357 "Non-nil means \"+\" is an acceptable folder name. 2351 "Non-nil means \"+\" is an acceptable folder name.
@@ -2612,6 +2606,8 @@ RAISE-ERROR is non-nil, in which case an error is signaled if
2612 (mh-exec-cmd-quiet nil "mhparam" "-components" component) 2606 (mh-exec-cmd-quiet nil "mhparam" "-components" component)
2613 (mh-get-profile-field (concat component ":")))) 2607 (mh-get-profile-field (concat component ":"))))
2614 2608
2609(eval-when-compile (defvar mark-active)) ;shush compiler
2610
2615(defun mh-exchange-point-and-mark-preserving-active-mark () 2611(defun mh-exchange-point-and-mark-preserving-active-mark ()
2616 "Put the mark where point is now, and point where the mark is now. 2612 "Put the mark where point is now, and point where the mark is now.
2617This command works even when the mark is not active, and 2613This command works even when the mark is not active, and
@@ -2689,31 +2685,13 @@ Set mark after inserted text."
2689 new-list)) 2685 new-list))
2690 2686
2691(defun mh-replace-string (old new) 2687(defun mh-replace-string (old new)
2692 "Replace all occurrences of OLD with NEW in the current buffer." 2688 "Replace all occurrences of OLD with NEW in the current buffer.
2689Ignores case when searching for OLD."
2693 (goto-char (point-min)) 2690 (goto-char (point-min))
2694 (let ((case-fold-search t)) 2691 (let ((case-fold-search t))
2695 (while (search-forward old nil t) 2692 (while (search-forward old nil t)
2696 (replace-match new t t)))) 2693 (replace-match new t t))))
2697 2694
2698(defun mh-replace-in-string (regexp newtext string)
2699 "Replace REGEXP with NEWTEXT everywhere in STRING and return result.
2700NEWTEXT is taken literally---no \\DIGIT escapes will be recognized.
2701
2702The function body was copied from `dired-replace-in-string' in
2703dired.el.
2704Emacs21 has `replace-regexp-in-string' while XEmacs has
2705`replace-in-string'.
2706Neither is present in Emacs20. The file gnus-util.el in Gnus 5.10.1
2707and above has `gnus-replace-in-string'. We should use that when we
2708decide to not support older versions of Gnus."
2709 (let ((result "") (start 0) mb me)
2710 (while (string-match regexp string start)
2711 (setq mb (match-beginning 0)
2712 me (match-end 0)
2713 result (concat result (substring string start mb) newtext)
2714 start me))
2715 (concat result (substring string start))))
2716
2717(provide 'mh-utils) 2695(provide 'mh-utils)
2718 2696
2719;; Local Variables: 2697;; Local Variables: