]> git.eshelyaron.com Git - emacs.git/commitdiff
add verbosity parameter
authorAndrea Corallo <akrl@sdf.org>
Sun, 8 Sep 2019 19:42:37 +0000 (21:42 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:37:46 +0000 (11:37 +0100)
lisp/emacs-lisp/comp.el

index c18e3b8dc699c839761ff1442e01b8d682b207ec..0770d32f7a1ead766a93e9ca9b8929ffe3b70ab6 100644 (file)
@@ -47,6 +47,7 @@
 
 ;; FIXME these has to be removed
 (defvar comp-speed 2)
+(defvar comp-verbose nil)
 
 (defvar comp-pass nil
   "Every pass has the right to bind what it likes here.")
@@ -205,16 +206,19 @@ BODY is evaluate only if `comp-debug' is non nil."
 
 (defun comp-log (data)
   "Log DATA."
-  (if noninteractive
+  (if (and noninteractive
+           comp-verbose)
       (if (atom data)
           (message "%s" data)
        (mapc (lambda (x)
                 (message "%s"(prin1-to-string x)))
               data))
     (comp-within-log-buff
-      (mapc (lambda (x)
-              (insert (prin1-to-string x) "\n"))
-            data))))
+      (if (and data (atom data))
+          (insert data)
+        (mapc (lambda (x)
+                (insert (prin1-to-string x) "\n"))
+              data)))))
 
 (defun comp-log-func (func)
   "Log function FUNC."