unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
@ 2018-03-09 12:31 Noam Postavsky
  2018-03-09 14:11 ` Robert Pluim
  2018-03-09 15:05 ` Drew Adams
  0 siblings, 2 replies; 15+ messages in thread
From: Noam Postavsky @ 2018-03-09 12:31 UTC (permalink / raw)
  To: 30757

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.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 12:31 bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer Noam Postavsky
@ 2018-03-09 14:11 ` Robert Pluim
  2018-03-09 14:24   ` Robert Pluim
  2018-03-09 15:05 ` Drew Adams
  1 sibling, 1 reply; 15+ messages in thread
From: Robert Pluim @ 2018-03-09 14:11 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 30757

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

Noam Postavsky <npostavs@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 :-)


[-- Attachment #2: Type: text/plain, Size: 1460 bytes --]

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))
 \f
+
+(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)

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 14:11 ` Robert Pluim
@ 2018-03-09 14:24   ` Robert Pluim
  2018-03-09 14:53     ` Noam Postavsky
  0 siblings, 1 reply; 15+ messages in thread
From: Robert Pluim @ 2018-03-09 14:24 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 30757

Robert Pluim <rpluim@gmail.com> writes:

> Noam Postavsky <npostavs@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.
>

Reading your message on emacs-devel, I guess you'd want this kind of
change to be made permanent? So customize-push-and-save of the
resulting values?

Robert





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 14:24   ` Robert Pluim
@ 2018-03-09 14:53     ` Noam Postavsky
  2018-03-09 15:53       ` Robert Pluim
  0 siblings, 1 reply; 15+ messages in thread
From: Noam Postavsky @ 2018-03-09 14:53 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 30757

On Fri, Mar 9, 2018 at 9:24 AM, Robert Pluim <rpluim@gmail.com> wrote:
> Robert Pluim <rpluim@gmail.com> writes:
>
>> Noam Postavsky <npostavs@gmail.com> writes:
>>
>>> 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.
>>
>
> Reading your message on emacs-devel, I guess you'd want this kind of
> change to be made permanent? So customize-push-and-save of the
> resulting values?

Ah, yes, something using customize was more what I had in mind.

Also, potentially reusing the Warning(foo) prefix for the button might
save some space, the different types of suppression could accessed by
different keybindings/mouse clicks (maybe that conflicts with the
"easy to use" goal, though, not sure).


For reference, the emacs-devel post:
https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00314.html





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 12:31 bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer Noam Postavsky
  2018-03-09 14:11 ` Robert Pluim
@ 2018-03-09 15:05 ` Drew Adams
  2018-03-09 15:49   ` Robert Pluim
  1 sibling, 1 reply; 15+ messages in thread
From: Drew Adams @ 2018-03-09 15:05 UTC (permalink / raw)
  To: Noam Postavsky, 30757

> 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.

+1

It would be good for the button/link to open *Help* with a more
complete description of the warning.  And there (in *Help*) there
could be buttons/links to suppress things.

In addition, we might have a command or commands that would
show such *Help* regardless of whether the warnings are being
shown.  In *Help*, if the warning is currently not being
shown then the button/link would enable showing it (i.e.,
the button toggles the behavior show/suppress).





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 15:05 ` Drew Adams
@ 2018-03-09 15:49   ` Robert Pluim
  0 siblings, 0 replies; 15+ messages in thread
From: Robert Pluim @ 2018-03-09 15:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: 30757, Noam Postavsky

Drew Adams <drew.adams@oracle.com> writes:

>> 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.
>
> +1
>
> It would be good for the button/link to open *Help* with a more
> complete description of the warning.  And there (in *Help*) there
> could be buttons/links to suppress things.
>
> In addition, we might have a command or commands that would
> show such *Help* regardless of whether the warnings are being
> shown.  In *Help*, if the warning is currently not being
> shown then the button/link would enable showing it (i.e.,
> the button toggles the behavior show/suppress).

That sounds like a whole new feature request :-)

I don't think there's anything preventing that from being added later.

Robert





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 14:53     ` Noam Postavsky
@ 2018-03-09 15:53       ` Robert Pluim
  2018-03-09 16:18         ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Robert Pluim @ 2018-03-09 15:53 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 30757

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

Noam Postavsky <npostavs@gmail.com> writes:

> Ah, yes, something using customize was more what I had in mind.
>
> Also, potentially reusing the Warning(foo) prefix for the button might
> save some space, the different types of suppression could accessed by
> different keybindings/mouse clicks (maybe that conflicts with the
> "easy to use" goal, though, not sure).

Here's what I've got so far. Suggestions welcome for wording, style
changes, etc.

It works fine for me, but I have warning-suppress-types and
warning-suppress-log-types set to nil, so it might well fail for
people who have already set those manually.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Show-log-suppression-buttons-in-display-warning-buff.patch --]
[-- Type: text/x-diff, Size: 3739 bytes --]

From 4db1f77e5d802531561918cd08e08d51447a84ec Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Fri, 9 Mar 2018 16:41:36 +0100
Subject: [PATCH] Show log suppression buttons in display-warning buffer

* lisp/emacs-lisp/warnings.el (warning-suppress-warning):
Define button.
(warning-suppress-action): New function.
(warning-suppress-log-warning): Define button.
(warning-suppress-log-action): New function.
(display-warning): Show buttons to allow permanent
modification of warning-suppress-types and
warning-suppress-log-types per warning.

* etc/NEWS: Describe 'display-warning' change.
---
 etc/NEWS                    |  6 ++++++
 lisp/emacs-lisp/warnings.el | 26 +++++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index 14926ba2e3..134b79e60e 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -71,6 +71,12 @@ moved to the early init file (see above).
 \f
 * Changes in Emacs 27.1
 
++++
+** Warning types can now be disabled from the warning buffer.
+For each warning 'display-warning' now adds buttons to the buffer it
+uses to allow permanent suppression of the warning popup or of the
+warning itself.
+
 ---
 ** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text
 on GUI frames when tooltips are displayed in the echo area.  Instead,
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 489611d4d1..23f7e33af8 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -197,6 +197,21 @@ warning-suppress-p
     ;; we return t.
     some-match))
 \f
+(define-button-type 'warning-suppress-warning
+  'action #'warning-suppress-action
+  'help-echo "mouse-2, RET: Permanently disable popping up this warning")
+(defun warning-suppress-action (button)
+  (customize-save-variable 'warning-suppress-types
+                           (cons (list (button-get button 'warning-type))
+                                 warning-suppress-types)))
+(define-button-type 'warning-suppress-log-warning
+  'action #'warning-suppress-log-action
+  'help-echo "mouse-2, RET: Never generate this warning")
+(defun warning-suppress-log-action (button)
+  (customize-save-variable 'warning-suppress-log-types
+                           (cons (list (button-get button 'warning-type))
+                                 warning-suppress-types)))
+
 ;;;###autoload
 (defun display-warning (type message &optional level buffer-name)
   "Display a warning message, MESSAGE.
@@ -223,7 +238,12 @@ display-warning
 See the `warnings' custom group for user customization features.
 
 See also `warning-series', `warning-prefix-function' and
-`warning-fill-prefix' for additional programming features."
+`warning-fill-prefix' for additional programming features.
+
+This will also display buttons allowing the user to permanently
+disable popup of the warning or disable the warning entirely by
+setting `warning-suppress-types' or `warning-suppress-log-types'
+on their behalf."
   (if (not (or after-init-time noninteractive (daemonp)))
       ;; Ensure warnings that happen early in the startup sequence
       ;; are visible when startup completes (bug#20792).
@@ -264,6 +284,10 @@ display-warning
 	      (insert (format (nth 1 level-info)
 			      (format warning-type-format typename))
 		      message)
+              (insert " ")
+              (insert-button "Disable popup" 'type 'warning-suppress-warning 'warning-type type)
+              (insert " ")
+              (insert-button "Never generate" '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)
-- 
2.16.1.72.g5be1f00a9


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 15:53       ` Robert Pluim
@ 2018-03-09 16:18         ` Eli Zaretskii
  2018-03-09 16:54           ` Robert Pluim
  0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2018-03-09 16:18 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 30757, npostavs

> From: Robert Pluim <rpluim@gmail.com>
> Date: Fri, 09 Mar 2018 16:53:26 +0100
> Cc: 30757@debbugs.gnu.org
> 
> Here's what I've got so far. Suggestions welcome for wording, style
> changes, etc.

Thanks.

> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -71,6 +71,12 @@ moved to the early init file (see above).
>  \f
>  * Changes in Emacs 27.1
>  
> ++++

"+++" means this change was documented in the manual(s), but this
change wasn't, AFAIU.  Shkuld this be documented in the ELisp manual?

> +** Warning types can now be disabled from the warning buffer.
> +For each warning 'display-warning' now adds buttons to the buffer it
> +uses to allow permanent suppression of the warning popup or of the
> +warning itself.

This entry should be made more clear.  "Warning types" is never
explained, the reference to 'display-warning' is confusing (this is a
user-level feature, so why mention the function which is involved?),
it is unclear what buffer is alluded to by "the buffer it uses", and
the difference between "warning popup" and "warning itself" is left
unexplained.

> +(define-button-type 'warning-suppress-warning
> +  'action #'warning-suppress-action
> +  'help-echo "mouse-2, RET: Permanently disable popping up this warning")
> +(defun warning-suppress-action (button)
> +  (customize-save-variable 'warning-suppress-types
> +                           (cons (list (button-get button 'warning-type))
> +                                 warning-suppress-types)))
> +(define-button-type 'warning-suppress-log-warning
> +  'action #'warning-suppress-log-action
> +  'help-echo "mouse-2, RET: Never generate this warning")

Likewise here: the difference between "disable popping up" and "never
generate" is unclear.  maybe a different wording will clarify that,
but I cannot suggest one because frankly I don't understand well
enough what each one does.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 16:18         ` Eli Zaretskii
@ 2018-03-09 16:54           ` Robert Pluim
  2018-03-09 18:28             ` Eli Zaretskii
                               ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Robert Pluim @ 2018-03-09 16:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 30757, npostavs

[-- Attachment #1: Type: text/plain, Size: 2661 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Robert Pluim <rpluim@gmail.com>
>> Date: Fri, 09 Mar 2018 16:53:26 +0100
>> Cc: 30757@debbugs.gnu.org
>> 
>> Here's what I've got so far. Suggestions welcome for wording, style
>> changes, etc.
>
> Thanks.
>
>> --- a/etc/NEWS
>> +++ b/etc/NEWS
>> @@ -71,6 +71,12 @@ moved to the early init file (see above).
>>  \f
>>  * Changes in Emacs 27.1
>>  
>> ++++
>
> "+++" means this change was documented in the manual(s), but this
> change wasn't, AFAIU.  Shkuld this be documented in the ELisp manual?
>

etc/NEWS says:

  +++ indicates that all necessary documentation updates are complete.
      (This means all relevant manuals in doc/ AND lisp doc-strings.)

I'd looked through the manuals and couldn't see anywhere where I
thought it should be documented, hence I only changed the
doc-string. We can go for '---' in that case.

>> +** Warning types can now be disabled from the warning buffer.
>> +For each warning 'display-warning' now adds buttons to the buffer it
>> +uses to allow permanent suppression of the warning popup or of the
>> +warning itself.
>
> This entry should be made more clear.  "Warning types" is never
> explained, the reference to 'display-warning' is confusing (this is a
> user-level feature, so why mention the function which is involved?),
> it is unclear what buffer is alluded to by "the buffer it uses", and
> the difference between "warning popup" and "warning itself" is left
> unexplained.

I've rewritten it. See attached.

>> +(define-button-type 'warning-suppress-warning
>> +  'action #'warning-suppress-action
>> +  'help-echo "mouse-2, RET: Permanently disable popping up this warning")
>> +(defun warning-suppress-action (button)
>> +  (customize-save-variable 'warning-suppress-types
>> +                           (cons (list (button-get button 'warning-type))
>> +                                 warning-suppress-types)))
>> +(define-button-type 'warning-suppress-log-warning
>> +  'action #'warning-suppress-log-action
>> +  'help-echo "mouse-2, RET: Never generate this warning")
>
> Likewise here: the difference between "disable popping up" and "never
> generate" is unclear.  maybe a different wording will clarify that,
> but I cannot suggest one because frankly I don't understand well
> enough what each one does.

Yes. I'm stuck between being precise but verbose, and more general and
succinct, and expressing the permanence of the resulting change. I've
make another attempt, although I'm still not entirely happy with it,
especially since the button texts are now quite long (I thought about
using the verb 'hide', but that's not accurate either).

Robert


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Show-log-suppression-buttons-in-display-warning-buff.patch --]
[-- Type: text/x-diff, Size: 3949 bytes --]

From ba62307cfb0633637cc1fa9351c942cf79f34b90 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Fri, 9 Mar 2018 16:41:36 +0100
Subject: [PATCH] Show log suppression buttons in display-warning buffer

* lisp/emacs-lisp/warnings.el (warning-suppress-warning):
Define button.
(warning-suppress-action): New function.
(warning-suppress-log-warning): Define button.
(warning-suppress-log-action): New function.
(display-warning): Show buttons to allow permanent
modification of warning-suppress-types and
warning-suppress-log-types per warning.

* etc/NEWS: Describe 'display-warning' button change.
---
 etc/NEWS                    | 10 +++++++++-
 lisp/emacs-lisp/warnings.el | 26 +++++++++++++++++++++++++-
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 14926ba2e3..a36967d473 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -69,7 +69,15 @@ in your init file.  However, if your init file changes the values of
 moved to the early init file (see above).
 
 \f
-* Changes in Emacs 27.1
+* Changes in Emacs 27.
+
+---
+** Specific warnings can now be disabled from the warning buffer.
+When a warning is displayed to the user, the resulting buffer now has
+buttons which allow making permanent changes to the treatment of that
+warning.  Automatic showing of the warning can be disabled (although
+it is still generated), or generation of the warning can be disabled
+entirely.
 
 ---
 ** The new option 'tooltip-resize-echo-area' avoids truncating tooltip text
diff --git a/lisp/emacs-lisp/warnings.el b/lisp/emacs-lisp/warnings.el
index 489611d4d1..245cd3f39a 100644
--- a/lisp/emacs-lisp/warnings.el
+++ b/lisp/emacs-lisp/warnings.el
@@ -197,6 +197,21 @@ warning-suppress-p
     ;; we return t.
     some-match))
 \f
+(define-button-type 'warning-suppress-warning
+  'action #'warning-suppress-action
+  'help-echo "mouse-2, RET: Don't display this warning automatically")
+(defun warning-suppress-action (button)
+  (customize-save-variable 'warning-suppress-types
+                           (cons (list (button-get button 'warning-type))
+                                 warning-suppress-types)))
+(define-button-type 'warning-suppress-log-warning
+  'action #'warning-suppress-log-action
+  'help-echo "mouse-2, RET: Never generate this warning again")
+(defun warning-suppress-log-action (button)
+  (customize-save-variable 'warning-suppress-log-types
+                           (cons (list (button-get button 'warning-type))
+                                 warning-suppress-types)))
+
 ;;;###autoload
 (defun display-warning (type message &optional level buffer-name)
   "Display a warning message, MESSAGE.
@@ -223,7 +238,12 @@ display-warning
 See the `warnings' custom group for user customization features.
 
 See also `warning-series', `warning-prefix-function' and
-`warning-fill-prefix' for additional programming features."
+`warning-fill-prefix' for additional programming features.
+
+This will also display buttons allowing the user to permanently
+disable automatic display of the warning or disable the warning
+entirely by setting `warning-suppress-types' or
+`warning-suppress-log-types' on their behalf."
   (if (not (or after-init-time noninteractive (daemonp)))
       ;; Ensure warnings that happen early in the startup sequence
       ;; are visible when startup completes (bug#20792).
@@ -264,6 +284,10 @@ display-warning
 	      (insert (format (nth 1 level-info)
 			      (format warning-type-format typename))
 		      message)
+              (insert " ")
+              (insert-button "Disable showing automatically" 'type 'warning-suppress-warning 'warning-type type)
+              (insert " ")
+              (insert-button "Never generate" '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)
-- 
2.16.1.72.g5be1f00a9


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 16:54           ` Robert Pluim
@ 2018-03-09 18:28             ` Eli Zaretskii
  2018-03-10  3:14             ` Noam Postavsky
  2020-09-04  4:30             ` Lars Ingebrigtsen
  2 siblings, 0 replies; 15+ messages in thread
From: Eli Zaretskii @ 2018-03-09 18:28 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 30757, npostavs

> From: Robert Pluim <rpluim@gmail.com>
> Cc: 30757@debbugs.gnu.org,  npostavs@gmail.com
> Date: Fri, 09 Mar 2018 17:54:23 +0100
> 
> > "+++" means this change was documented in the manual(s), but this
> > change wasn't, AFAIU.  Shkuld this be documented in the ELisp manual?
> >
> 
> etc/NEWS says:
> 
>   +++ indicates that all necessary documentation updates are complete.
>       (This means all relevant manuals in doc/ AND lisp doc-strings.)
> 
> I'd looked through the manuals and couldn't see anywhere where I
> thought it should be documented, hence I only changed the
> doc-string. We can go for '---' in that case.

"---" is correct if a change needs not be documented, yes.

In this case, I wonder whether we should document this where
warning-suppress-types etc. are documented.

> +---
> +** Specific warnings can now be disabled from the warning buffer.
> +When a warning is displayed to the user, the resulting buffer now has
> +buttons which allow making permanent changes to the treatment of that
> +warning.  Automatic showing of the warning can be disabled (although
> +it is still generated), or generation of the warning can be disabled
> +entirely.

Instead of the vague "generation" I'd suggest to say explicitly that
its logged in the *Messages* buffer.  Otherwise, this text is a
significant improvement, thanks.

> +(define-button-type 'warning-suppress-warning
> +  'action #'warning-suppress-action
> +  'help-echo "mouse-2, RET: Don't display this warning automatically")
> +(defun warning-suppress-action (button)
> +  (customize-save-variable 'warning-suppress-types
> +                           (cons (list (button-get button 'warning-type))
> +                                 warning-suppress-types)))
> +(define-button-type 'warning-suppress-log-warning
> +  'action #'warning-suppress-log-action
> +  'help-echo "mouse-2, RET: Never generate this warning again")
> +(defun warning-suppress-log-action (button)
> +  (customize-save-variable 'warning-suppress-log-types
> +                           (cons (list (button-get button 'warning-type))
> +                                 warning-suppress-types)))

I think we should make similar changes in the help-echo strings.

> +              (insert-button "Disable showing automatically" 'type 'warning-suppress-warning 'warning-type type)
> +              (insert " ")
> +              (insert-button "Never generate" 'type 'warning-suppress-log-warning 'warning-type type)

And here.





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 16:54           ` Robert Pluim
  2018-03-09 18:28             ` Eli Zaretskii
@ 2018-03-10  3:14             ` Noam Postavsky
  2018-03-12 11:04               ` Robert Pluim
  2020-09-04  4:30             ` Lars Ingebrigtsen
  2 siblings, 1 reply; 15+ messages in thread
From: Noam Postavsky @ 2018-03-10  3:14 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 30757

Robert Pluim <rpluim@gmail.com> writes:

> Yes. I'm stuck between being precise but verbose, and more general and
> succinct, and expressing the permanence of the resulting change. I've
> make another attempt, although I'm still not entirely happy with it,
> especially since the button texts are now quite long (I thought about
> using the verb 'hide', but that's not accurate either).

Perhaps taking Drew's suggestion to popup a *Help* window would give
more room to be descriptive?





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-10  3:14             ` Noam Postavsky
@ 2018-03-12 11:04               ` Robert Pluim
  0 siblings, 0 replies; 15+ messages in thread
From: Robert Pluim @ 2018-03-12 11:04 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 30757

Noam Postavsky <npostavs@gmail.com> writes:

> Robert Pluim <rpluim@gmail.com> writes:
>
>> Yes. I'm stuck between being precise but verbose, and more general and
>> succinct, and expressing the permanence of the resulting change. I've
>> make another attempt, although I'm still not entirely happy with it,
>> especially since the button texts are now quite long (I thought about
>> using the verb 'hide', but that's not accurate either).
>
> Perhaps taking Drew's suggestion to popup a *Help* window would give
> more room to be descriptive?

It would, but I thought the target user here was someone who doesn't
necessarily know much about how to configure stuff in Emacs, but just
wants to disable an annoying warning, so a long verbose detailed
*Help* window might be counter-productive.

Robert





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2018-03-09 16:54           ` Robert Pluim
  2018-03-09 18:28             ` Eli Zaretskii
  2018-03-10  3:14             ` Noam Postavsky
@ 2020-09-04  4:30             ` Lars Ingebrigtsen
  2020-09-04  8:54               ` Robert Pluim
  2 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-04  4:30 UTC (permalink / raw)
  To: Eli Zaretskii, 30757, npostavs

Robert Pluim <rpluim@gmail.com> writes:

> Yes. I'm stuck between being precise but verbose, and more general and
> succinct, and expressing the permanence of the resulting change. I've
> make another attempt, although I'm still not entirely happy with it,
> especially since the button texts are now quite long (I thought about
> using the verb 'hide', but that's not accurate either).

I think everybody agreed that the feature was good, but there was some
discussion about the wording, so the patch was never applied.  I've now
respun the patch for Emacs 28, and tweaked the wording (and made it
pretty brief).  If anybody wants to change the wording, please do so,
but I don't think we should let that stop us from adding the
functionality, so I've now pushed it.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2020-09-04  4:30             ` Lars Ingebrigtsen
@ 2020-09-04  8:54               ` Robert Pluim
  2020-09-04 11:22                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 15+ messages in thread
From: Robert Pluim @ 2020-09-04  8:54 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 30757, npostavs

>>>>> On Fri, 04 Sep 2020 06:30:31 +0200, Lars Ingebrigtsen <larsi@gnus.org> said:

    Lars> Robert Pluim <rpluim@gmail.com> writes:
    >> Yes. I'm stuck between being precise but verbose, and more general and
    >> succinct, and expressing the permanence of the resulting change. I've
    >> make another attempt, although I'm still not entirely happy with it,
    >> especially since the button texts are now quite long (I thought about
    >> using the verb 'hide', but that's not accurate either).

    Lars> I think everybody agreed that the feature was good, but there was some
    Lars> discussion about the wording, so the patch was never applied.  I've now
    Lars> respun the patch for Emacs 28, and tweaked the wording (and made it
    Lars> pretty brief).  If anybody wants to change the wording, please do so,
    Lars> but I don't think we should let that stop us from adding the
    Lars> functionality, so I've now pushed it.

I think this one was a victim of when I moved to a mac, and it got
orphaned. Thanks for this, although youʼre running the risk of me just
posting patches and waiting for you to apply them :-)

Robert





^ permalink raw reply	[flat|nested] 15+ messages in thread

* bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer
  2020-09-04  8:54               ` Robert Pluim
@ 2020-09-04 11:22                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 15+ messages in thread
From: Lars Ingebrigtsen @ 2020-09-04 11:22 UTC (permalink / raw)
  To: Robert Pluim; +Cc: 30757, npostavs

Robert Pluim <rpluim@gmail.com> writes:

> I think this one was a victim of when I moved to a mac, and it got
> orphaned. Thanks for this, although youʼre running the risk of me just
> posting patches and waiting for you to apply them :-)

Eeek!!

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-09-04 11:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-09 12:31 bug#30757: Better manipulation (suppressing, examining type) of warnings from *Warnings* buffer Noam Postavsky
2018-03-09 14:11 ` Robert Pluim
2018-03-09 14:24   ` Robert Pluim
2018-03-09 14:53     ` Noam Postavsky
2018-03-09 15:53       ` Robert Pluim
2018-03-09 16:18         ` Eli Zaretskii
2018-03-09 16:54           ` Robert Pluim
2018-03-09 18:28             ` Eli Zaretskii
2018-03-10  3:14             ` Noam Postavsky
2018-03-12 11:04               ` Robert Pluim
2020-09-04  4:30             ` Lars Ingebrigtsen
2020-09-04  8:54               ` Robert Pluim
2020-09-04 11:22                 ` Lars Ingebrigtsen
2018-03-09 15:05 ` Drew Adams
2018-03-09 15:49   ` Robert Pluim

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).