From: Bill Wohler Date: Mon, 9 Jan 2006 06:28:49 +0000 (+0000) Subject: * mh-alias.el (mh-alias-gecos-name): Use replace-regexp-in-string X-Git-Tag: emacs-pretest-22.0.90~4833 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7094eefe8034342f492f538676220e84fb8706e6;p=emacs.git * 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. --- 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 @@ +2006-01-08 Bill Wohler + + 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 * 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." (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)) 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 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) -(require 'mh-e) -(require 'gnus-util) + (require 'easymenu) +(require 'gnus-util) +(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 @@ Prefix ARG means justify as well. This function enables (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 @@ a copy of the draft." (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 @@ doesn't exist there." 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. 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 @@ (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.")) + "Non-nil means the current Emacs is XEmacs.") + (when mh-xemacs-flag + (require 'mh-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 +(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 @@ message 200, then use the range \"200:200\"." ;;; 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 @@ Otherwise, set SYMBOL to VALUE." "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 @@ Do not alter this variable directly. Instead, customize 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 @@ removed and entries from `mh-invisible-header-fields' are added." (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 @@ See also `mh-clean-message-header-flag'." (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\\. 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 @@ ;; 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 'easymenu) +(require 'gnus-util) +(require 'mh-seq) +(require 'mh-utils) (defconst mh-version "7.85+cvs" "Version number of MH-E.") @@ -1184,8 +1180,6 @@ if it is available." (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 @@ onward while the latter is used in previous versions and XEmacs." ''write-file-functions ;Emacs 21.4 ''local-write-file-hooks)) ;= color-cells 8))))) (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." (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 () 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 @@ ;;; Code: (eval-when-compile (require 'mh-acros)) -(mh-require-cl) + (require 'mh-comp) (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 @@ ;;; 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 ;; Maintainer: Bill Wohler @@ -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'." 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 @@ (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 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 @@ (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 @@ This assumes that a temporary buffer is setup." +(eval-when-compile (defvar image-load-path)) ;shush compiler + (defvar mh-image-load-path-called-flag nil) ;;;###mh-autoload @@ -328,6 +327,8 @@ there. Otherwise, the images directory is added to the +;;; 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.") 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 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) -(require 'mh-comp) + (require 'gnus-util) +(require 'mh-comp) (require 'mh-gnus) (autoload 'article-emphasize "gnus-art") @@ -132,16 +133,16 @@ given a prefix argument. Normally default arguments to "/[-.+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 @@ variable." 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 @@ Returns nil if file command not on system." (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 @@ Optional argument DEFAULT is returned if a type isn't entered." (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 @@ automatically." (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 @@ parsed and then displayed." (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 @@ Parameter EL is unused." ;; 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) 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 @@ (eval-when-compile (require 'mh-acros)) (mh-require-cl) -(require 'mh-e) -;; Shush the byte-compiler -(defvar tool-bar-mode) +(require 'mh-e) @@ -171,8 +169,7 @@ you want to delete the messages, use \"\\[universal-argument] (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 @@ MESSAGE appears." (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) 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 @@ ;;; 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 @@ operation." ;; 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 @@ preserved." (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 @@ still visible.\n") ;; 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 @@ ignored if VISIBLE-HEADERS is non-nil." ;; 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 @@ otherwise completion on +foo won't tell us about the option (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 @@ RAISE-ERROR is non-nil, in which case an error is signaled if (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 @@ Set mark after inserted text." 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: