]> git.eshelyaron.com Git - emacs.git/commitdiff
Disable display-warning buttons when doing batch compiles
authorLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Sep 2020 16:34:18 +0000 (18:34 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 6 Sep 2020 16:34:18 +0000 (18:34 +0200)
* lisp/emacs-lisp/warnings.el (display-warning): Don't output the
buttons when we're not interactive (bug#43244).

lisp/emacs-lisp/warnings.el

index 3a568cb834ce85ff5fe7a990f4c3e4cc2b7af6c3..e10c149d89cc26db250df657073b8bee30d36503 100644 (file)
@@ -292,14 +292,17 @@ entirely by setting `warning-suppress-types' or
              (insert (format (nth 1 level-info)
                              (format warning-type-format typename))
                      message)
-              (insert " ")
-              (insert-button "Disable showing"
-                             'type 'warning-suppress-warning
-                             'warning-type type)
-              (insert " ")
-              (insert-button "Disable logging"
-                             'type 'warning-suppress-log-warning
-                             'warning-type type)
+              ;; Don't output the buttons when doing batch compilation
+              ;; and similar.
+              (unless noninteractive
+                (insert " ")
+                (insert-button "Disable showing"
+                               'type 'warning-suppress-warning
+                               'warning-type type)
+                (insert " ")
+                (insert-button "Disable logging"
+                               'type 'warning-suppress-log-warning
+                               'warning-type type))
               (funcall newline)
              (when (and warning-fill-prefix (not (string-match "\n" message)))
                (let ((fill-prefix warning-fill-prefix)