GNU bug report logs - #30757
Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer

Previous Next

Package: emacs;

Reported by: Noam Postavsky <npostavs <at> gmail.com>

Date: Fri, 9 Mar 2018 12:32:01 UTC

Severity: wishlist

Tags: fixed

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 30757 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 30757 <at> debbugs.gnu.org
Subject: Re: bug#30757: Better manipulation (suppressing,
 examining type) of warnings from *Warnings* buffer
Date: Fri, 09 Mar 2018 15:11:22 +0100
[Message part 1 (text/plain, inline)]
Noam Postavsky <npostavs <at> gmail.com> writes:

> Severity: wishlist
>
> It would be nice if warnings in the *Warnings* buffer came with some
> kind of button to let the user add the relevant value to
> warning-suppress-types or warning-suppress-log-types.

Adjust strings according to your personal preference. The button names
are a tad verbose as well :-)

[Message part 2 (text/plain, inline)]
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 489611d4d1..0e31511287 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -197,6 +197,18 @@ warning-suppress-p
     ;; we return t.
     some-match))
 
+
+(define-button-type 'warning-suppress-warning
+  'action #'warning-suppress-action
+  'help-echo "mouse-2, RET: Suppress showing this warning")
+(defun warning-suppress-action (button)
+  (add-to-list 'warning-suppress-types (list (button-get button 'warning-type))))
+(define-button-type 'warning-suppress-log-warning
+  'action #'warning-suppress-log-action
+  'help-echo "mouse-2, RET: Never log this warning")
+(defun warning-suppress-log-action (button)
+  (add-to-list 'warning-suppress-log-types (list (button-get button 'warning-type))))
+
 ;;;###autoload
 (defun display-warning (type message &optional level buffer-name)
   "Display a warning message, MESSAGE.
@@ -264,6 +276,10 @@ display-warning
 	      (insert (format (nth 1 level-info)
 			      (format warning-type-format typename))
 		      message)
+              (insert " ")
+              (insert-button "Suppress" 'type 'warning-suppress-warning 'warning-type type)
+              (insert " ")
+              (insert-button "Never Log" 'type 'warning-suppress-log-warning 'warning-type type)
 	      (newline)
 	      (when (and warning-fill-prefix (not (string-match "\n" message)))
 		(let ((fill-prefix warning-fill-prefix)

This bug report was last modified 4 years and 263 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.