branch: elpa/vm
commit 021071e7e463c9eb2b8bf09a115f2f3a3a22c4a7
Author: Mark Diekhans <[email protected]>
Commit: Mark Diekhans <[email protected]>

    fix error when byte-compile-current-file is not defined
---
 lisp/vm-avirtual.el | 3 +--
 lisp/vm-biff.el     | 2 +-
 lisp/vm-misc.el     | 6 ++++++
 lisp/vm-pcrisis.el  | 2 +-
 lisp/vm-pgg.el      | 7 ++-----
 lisp/vm-rfaddons.el | 2 +-
 lisp/vm-serial.el   | 2 +-
 lisp/vm-vcard.el    | 2 +-
 lisp/vm-w3.el       | 2 +-
 lisp/vm-w3m.el      | 2 +-
 10 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/lisp/vm-avirtual.el b/lisp/vm-avirtual.el
index e033c5f851b..41b097be4c9 100644
--- a/lisp/vm-avirtual.el
+++ b/lisp/vm-avirtual.el
@@ -135,8 +135,7 @@
   (require 'vm-misc)
   (require 'regexp-opt)
   (require 'time-date)
-
-  (vm-load-features '(bbdb bbdb-autoloads bbdb-com) byte-compile-current-file))
+  (vm-load-features-silent-when-compiling '(bbdb bbdb-autoloads bbdb-com)))
 
 (defvar bbdb-get-addresses-headers)    ; dummy declaration
 (defvar bbdb-user-mail-names)
diff --git a/lisp/vm-biff.el b/lisp/vm-biff.el
index 83475678766..f4398b4f588 100644
--- a/lisp/vm-biff.el
+++ b/lisp/vm-biff.el
@@ -517,7 +517,7 @@ AddToFunc SelectWindow
                               'vm-biff-timer-delete-popup wf))))))))
 
 ; add hook only when explictly requring this module
-(when (not (or byte-compile-current-file (bound-and-true-p 
comp-compile-warning-errors)))
+(when (not (or (bound-and-true-p byte-compile-current-file) (bound-and-true-p 
comp-compile-warning-errors)))
   (add-hook 'vm-arrived-messages-hook 'vm-biff-popup t))
 
 (provide 'vm-biff)
diff --git a/lisp/vm-misc.el b/lisp/vm-misc.el
index 1393d7e0766..7052c670368 100644
--- a/lisp/vm-misc.el
+++ b/lisp/vm-misc.el
@@ -1676,5 +1676,11 @@ Return the list of loaded features."
                 feature-list))
   (delete nil feature-list))
 
+
+(defun vm-load-features-silent-when-compiling (feature-list)
+  "Try to load those features listed in FEATURE_LIST and
+don't display warnings if compiling"
+  (vm-load-features feature-list (bound-and-true-p byte-compile-current-file)))
+
 (provide 'vm-misc)
 ;;; vm-misc.el ends here
diff --git a/lisp/vm-pcrisis.el b/lisp/vm-pcrisis.el
index 793c1c68d24..fe41001c055 100644
--- a/lisp/vm-pcrisis.el
+++ b/lisp/vm-pcrisis.el
@@ -42,7 +42,7 @@
 (require 'vm-summary)
 (require 'vm-motion)
 (require 'vm-reply)
-(eval-when-compile (vm-load-features '(regexp-opt bbdb bbdb-com) 
byte-compile-current-file))
+(eval-when-compile (vm-load-features-silent-when-compiling '(regexp-opt bbdb 
bbdb-com)))
 (eval-when-compile (require 'vm-macro))
 
 (declare-function set-extent-face "vm-xemacs" (extent face))
diff --git a/lisp/vm-pgg.el b/lisp/vm-pgg.el
index a3f66d7c814..d13acca29f0 100644
--- a/lisp/vm-pgg.el
+++ b/lisp/vm-pgg.el
@@ -92,11 +92,8 @@
 
 ;; handle missing pgg.el gracefully
 (eval-and-compile
-  (if (and (boundp 'byte-compile-current-file) byte-compile-current-file)
-      (condition-case nil
-          (require 'pgg)
-        (error (message "WARNING: Cannot load pgg.el, related functions may 
not work!")))
-    (require 'pgg)))
+  (require 'vm-misc)
+  (vm-load-features-silent-when-compiling '(pgg)))
 
 (require 'easymenu)
 (require 'vm-misc)
diff --git a/lisp/vm-rfaddons.el b/lisp/vm-rfaddons.el
index 71a52403059..7f9138887fd 100644
--- a/lisp/vm-rfaddons.el
+++ b/lisp/vm-rfaddons.el
@@ -96,7 +96,7 @@
 (declare-function esmtpmail-via-smtp-server "ext:esmtpmail" ())
 (declare-function vm-folder-buffers "ext:vm" (&optional non-virtual))
 
-(eval-when-compile (vm-load-features '(regexp-opt bbdb bbdb-vm) 
byte-compile-current-file))
+(eval-when-compile (vm-load-features-silent-when-compiling '(regexp-opt bbdb 
bbdb-vm)))
 
 (require 'sendmail)
 (vm-load-features '(bbdb))
diff --git a/lisp/vm-serial.el b/lisp/vm-serial.el
index 466afb1203c..d5b658385cb 100644
--- a/lisp/vm-serial.el
+++ b/lisp/vm-serial.el
@@ -99,7 +99,7 @@
 ;; The following function is erroneously called in fsfemacs too
 ;; (declare-function read-expression "vm-xemacs" 
 ;;               (prompt &optional initial-contents history default))
-(vm-load-features '(bbdb bbdb-sc) byte-compile-current-file)
+(vm-load-features-silent-when-compiling '(bbdb bbdb-sc))
 
 (defvar vm-reply-list nil)
 (defvar vm-redistribute-list nil)
diff --git a/lisp/vm-vcard.el b/lisp/vm-vcard.el
index bc6f00027db..4a917ab6b13 100644
--- a/lisp/vm-vcard.el
+++ b/lisp/vm-vcard.el
@@ -32,7 +32,7 @@
 (require 'vm-mime)
 (eval-and-compile
   (require 'vm-misc)
-  (vm-load-features '(vcard) byte-compile-current-file))
+  (vm-load-features-silent-when-compiling'(vcard)))
 
 (and (boundp 'vcard-api-version) (string-lessp vcard-api-version "2.0")
      (error "vm-vcard.el requires vcard API version 2.0 or later."))
diff --git a/lisp/vm-w3.el b/lisp/vm-w3.el
index eca7b7d6985..7436b1f0889 100644
--- a/lisp/vm-w3.el
+++ b/lisp/vm-w3.el
@@ -30,7 +30,7 @@
 
 (eval-and-compile
   (require 'vm-misc)
-  (vm-load-features '(w3) byte-compile-current-file))
+  (vm-load-features-silent-when-compiling'(w3)))
 
 (declare-function w3-region "ext:w3-display.el" (st nd))
 
diff --git a/lisp/vm-w3m.el b/lisp/vm-w3m.el
index ea53118d433..ef39d0f34d8 100644
--- a/lisp/vm-w3m.el
+++ b/lisp/vm-w3m.el
@@ -34,7 +34,7 @@
 (require 'vm-mime)
 (require 'vm-misc)
 
-(eval-and-compile (vm-load-features '(w3m) byte-compile-current-file))
+(eval-and-compile (vm-load-features-silent-when-compiling '(w3m)))
 
 (declare-function w3m-region 
                  "ext:w3m" (start end &optional url charset))

Reply via email to