From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer Date: Fri, 09 Mar 2018 15:11:22 +0100 Message-ID: <871sgtnxth.fsf@gmail.com> References: <877eql1ld0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1520604651 13176 195.159.176.226 (9 Mar 2018 14:10:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Mar 2018 14:10:51 +0000 (UTC) Cc: 30757@debbugs.gnu.org To: Noam Postavsky Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 09 15:10:47 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euIjO-0003LL-Ab for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2018 15:10:46 +0100 Original-Received: from localhost ([::1]:45524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euIlR-0005BN-19 for geb-bug-gnu-emacs@m.gmane.org; Fri, 09 Mar 2018 09:12:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1euIkh-0004od-J7 for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 09:12:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1euIkc-0001X1-Kk for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 09:12:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43988) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1euIkc-0001Wv-FR for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 09:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1euIkc-0007Nn-3n for bug-gnu-emacs@gnu.org; Fri, 09 Mar 2018 09:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Mar 2018 14:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 30757-submit@debbugs.gnu.org id=B30757.152060469528342 (code B ref 30757); Fri, 09 Mar 2018 14:12:02 +0000 Original-Received: (at 30757) by debbugs.gnu.org; 9 Mar 2018 14:11:35 +0000 Original-Received: from localhost ([127.0.0.1]:51885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euIkA-0007N3-NQ for submit@debbugs.gnu.org; Fri, 09 Mar 2018 09:11:34 -0500 Original-Received: from mail-wr0-f174.google.com ([209.85.128.174]:35597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1euIk6-0007Mm-K3 for 30757@debbugs.gnu.org; Fri, 09 Mar 2018 09:11:32 -0500 Original-Received: by mail-wr0-f174.google.com with SMTP id a27so1480229wra.2 for <30757@debbugs.gnu.org>; Fri, 09 Mar 2018 06:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version; bh=MfMKwG1G7azEgWgqNs/PVDE8MFaf+F6J4HFRzHJK1gw=; b=L0UdIPTVTnVIxBRgKarC+K1DBf82eLpwUZTMj+Tp73wfp33eo/FCc8NjuJZHBvYIjY PGOJAycqBuruavzSkoljNwJthumtPSAkqd29+/45444YiH7bCpG8+GOAHN0oODsJlTPB hqkWGSHOonHSOYuMRNnCSbYfpp+g2mM81xg44IRmztljOyY8HVhccWEouf+vs/gHGI6C WdGSEp3CcbI+//B3Mmb46RocIcLIrWCMSJWOWEriUsOcLIht9UZGEaUbPqTdj0gO998i iPfx0Gmr52IKTnemIfoJS3EowPYjCQ+fu4sbumLtJmb5vqHzehh5kwMtmCs+RsLw4+2Y ZDVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version; bh=MfMKwG1G7azEgWgqNs/PVDE8MFaf+F6J4HFRzHJK1gw=; b=in/LVjYCMIO3/lq2ZCZJgm5DbLVhR21sU+i+BRzuFD0LgNFnyX2GJvNtKo0b6pwruW 4DcVCdb8GutUc404D7qCBWMYl9Yg7/SAxui0EDcl/f21E1GbqF0Ee2Z1VzwANWVqaioy ODfIZZQYz9DjA9KQMNZWtWa70vQcN3k9Vak3Qv6QO+ilrAz6HABtcVEFR8IK0Dec1FKU 3c/7r4Ipiie+OCHsbmZJSY/RwxD6JkbqXG3fUomDtXo308Kg71921uM0o2ytJ8dTs1Ap kFwHh3f59BFkR52ObVpW9UVJS48dIqFKLfaZ4z2dAaRXYh2YXZYBJH0BH0u4xlx4ceR6 kFwg== X-Gm-Message-State: APf1xPByJ/LB2+0B6S1okqcFfRHrSsyXhDQTQGck586PjNiH7Jri4aXG 7KPWh9R4KUaKsJYP5B73H9/cxT9UUrE= X-Google-Smtp-Source: AG47ELtFz9aBeu5ow1ZR6USlRkrFpJ99i5pz5usScwzqPs2ilwcB4OC7Vp1owJdWkztfks4n0WP0jw== X-Received: by 10.223.192.74 with SMTP id c10mr27738896wrf.145.1520604684472; Fri, 09 Mar 2018 06:11:24 -0800 (PST) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id z7sm1309094wrg.1.2018.03.09.06.11.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 06:11:23 -0800 (PST) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <877eql1ld0.fsf@gmail.com> (Noam Postavsky's message of "Fri, 09 Mar 2018 07:31:23 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144072 Archived-At: --=-=-= Content-Type: text/plain Noam Postavsky 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 :-) --=-=-= Content-Type: text/plain Content-Disposition: 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) --=-=-=--