branch: elpa/logview
commit 30132d18f7536183525d3ae60dbb8cf6e0c1fb68
Author: Paul Pogonyshev <pogonys...@gmail.com>
Commit: Paul Pogonyshev <pogonys...@gmail.com>

    Fix byte-compilation of tests and their execution when byte-compiled; 
errors were caused by `logview--test-with-file' evaluating 
`extra-customizations' at definition time.
---
 test/logview.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/test/logview.el b/test/logview.el
index c19d5ae90d..3e2894959d 100644
--- a/test/logview.el
+++ b/test/logview.el
@@ -45,7 +45,9 @@
         (:extra-customizations (setf extra-customizations (eval (pop body) t)))
         (:buffer-mode          (setf buffer-mode          (pop body)))))
     (dolist (customizable (custom-group-members 'logview nil))
-      (when (eq (cadr customizable) 'custom-variable)
+      ;; Byte-compiled `let' with double-binding for the same variable behaves 
differently
+      ;; than non-byte-compiled...  Avoid double-bindings to dodge this.
+      (when (and (eq (cadr customizable) 'custom-variable) (not (assq (car 
customizable) extra-customizations)))
         (push (list (car customizable) (list 'quote (eval (car (get (car 
customizable) 'standard-value)) t))) erase-customizations)))
     `(let (,@erase-customizations
            ,@extra-customizations
@@ -78,10 +80,12 @@
       ,@etc)))
 
 
-(defun logview--test-view-customizations (&rest views)
-  `((logview--views             '(,@views))
-    (logview--views-initialized t)
-    (logview--views-need-saving nil)))
+;; This can get called from `logview--test-with-file' at compilation time.
+(eval-and-compile
+  (defun logview--test-view-customizations (&rest views)
+    `((logview--views             '(,@views))
+      (logview--views-initialized t)
+      (logview--views-need-saving nil))))
 
 
 (ert-deftest logview-test-log4j-standard-1 ()

Reply via email to