Subject: Re: bug#43467: [PATCH] defcustom warning-show-suppression-buttons correction

From: No Wayman <[email-masked]>
Date: Thu, 17 Sep 2020 13:09:13 -0400

Lars Ingebrigtsen <[email-masked]> writes:

Thanks for the feedback, Lars.

> Warnings are something you should rarely get, so I'm not quite 
> sure I
> see the use case for this?  In any case, some minor comments...

The same argument could be made against the buttons/suppression 
themselves:

"Warnings are something you should rarely get, so I'm not quite 
sure I see the use case for suppressing them."

I don't see either as a particularly strong argument.
For me, the buttons are useless because I have `custom-file` set 
to `null-device'.
They just add visual clutter to the buffer in that case.
The customization seems pretty low-cost in terms of 
complexity/maintenance IMO and provides the flexibility
to accommodate my (and possibly other we haven't thought of) use 
cases.

> And perhaps this would be clearer as a (when (and .. instead.

Addressed by changing the customization to 
`warning-hide-suppression-buttons' and inverting the semantics in 
the attached patch.

>From 03035944c1f19bbb628c798ce1f6feeceedbc7b3 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <[email-masked]>
Date: Thu, 17 Sep 2020 11:40:41 -0400
Subject: [PATCH] Allow customization of warning suppression button display

* lisp/emacs-lisp/warnings.el (warning-hide-suppression-buttons):
new defcustom to disable/enable display of warning suppression buttons
in *Warnings* buffer.
---
 lisp/emacs-lisp/warnings.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index e10c149d89..d7345b2536 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -116,6 +116,12 @@ warning-suppress-types
 See also `warning-suppress-log-types'."
   :type '(repeat (repeat symbol))
   :version "22.1")
+
+(defcustom warning-hide-suppression-buttons nil
+  "Whether or not to hide suppression buttons in the *Warnings* buffer.
+If non-nil, buttons are hidden, else they shown."
+  :type 'boolean
+  :version "28.1")
 
 ;; The autoload cookie is so that programs can bind this variable
 ;; safely, testing the existing value, before they call one of the
@@ -294,7 +300,7 @@ display-warning
 		      message)
               ;; Don't output the buttons when doing batch compilation
               ;; and similar.
-              (unless noninteractive
+              (unless (or noninteractive warning-hide-suppression-buttons)
                 (insert " ")
                 (insert-button "Disable showing"
                                'type 'warning-suppress-warning
-- 
2.28.0