unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4837: with-fewer-warnings ?
@ 2009-10-31  2:25 Glenn Morris
  2009-10-31  8:49 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Glenn Morris @ 2009-10-31  2:25 UTC (permalink / raw)
  To: bug-gnu-emacs

Severity: wishlist

`with-no-warnings' suppresses all compilation warnings.

I would like to add `with-fewer-warnings' (or some similar name) that
suppresses only some warnings.

Eg (with-fewer-warnings '(obsolete cl-functions) ...)

would not warn about obsolete things or cl-functions in the body. The
possible arguments are the members of byte-compile-warnings.

I can implement this if it is considered worth it (it's very similar
to with-no-warnings).






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

* bug#4837: with-fewer-warnings ?
  2009-10-31  2:25 bug#4837: with-fewer-warnings ? Glenn Morris
@ 2009-10-31  8:49 ` Eli Zaretskii
  2009-11-01  2:31 ` Richard Stallman
  2019-06-12 14:55 ` Lars Ingebrigtsen
  2 siblings, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2009-10-31  8:49 UTC (permalink / raw)
  To: Glenn Morris, 4837

> From: Glenn Morris <rgm@gnu.org>
> Date: Fri, 30 Oct 2009 22:25:36 -0400
> Cc: 
> 
> Eg (with-fewer-warnings '(obsolete cl-functions) ...)
> 
> would not warn about obsolete things or cl-functions in the body. The
> possible arguments are the members of byte-compile-warnings.

with-suppressed-warnings sounds like a better name to me.





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

* bug#4837: with-fewer-warnings ?
  2009-10-31  2:25 bug#4837: with-fewer-warnings ? Glenn Morris
  2009-10-31  8:49 ` Eli Zaretskii
@ 2009-11-01  2:31 ` Richard Stallman
  2009-11-09  8:45   ` Glenn Morris
  2019-06-12 14:55 ` Lars Ingebrigtsen
  2 siblings, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2009-11-01  2:31 UTC (permalink / raw)
  To: Glenn Morris, 4837; +Cc: bug-gnu-emacs

    Eg (with-fewer-warnings '(obsolete cl-functions) ...)

    would not warn about obsolete things or cl-functions in the body. The
    possible arguments are the members of byte-compile-warnings.

    I can implement this if it is considered worth it (it's very similar
    to with-no-warnings).

I think it isn't worth doing, because it would only gain you very much
if you put a lot of code inside with-no-warnings; we avoid doing that.







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

* bug#4837: with-fewer-warnings ?
  2009-11-01  2:31 ` Richard Stallman
@ 2009-11-09  8:45   ` Glenn Morris
  2009-11-09 14:38     ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2009-11-09  8:45 UTC (permalink / raw)
  To: rms; +Cc: 4837

Richard Stallman wrote:

> I think it isn't worth doing,

(I'd already done it, locally, before posting.)

> because it would only gain you very much if you put a lot of code
> inside with-no-warnings; we avoid doing that.

Perhaps because it is such a blunt instrument. This would make it a
bit less blunt. I don't claim this is important, but it is easy to
implement.

Example usage:

In the _implementation_ of an obsolete feature, it's ok to use an
obsolete variable and there is no need to be warned about it being
obsolete. However, you should still be warned about the variable not
being defined, in case you remove it altogether but forget to update
the code that uses it.






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

* bug#4837: with-fewer-warnings ?
  2009-11-09  8:45   ` Glenn Morris
@ 2009-11-09 14:38     ` Stefan Monnier
  2009-11-10  2:09       ` Glenn Morris
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Monnier @ 2009-11-09 14:38 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4837, rms

>> I think it isn't worth doing,
> (I'd already done it, locally, before posting.)
>> because it would only gain you very much if you put a lot of code
>> inside with-no-warnings; we avoid doing that.

> Perhaps because it is such a blunt instrument. This would make it a
> bit less blunt. I don't claim this is important, but it is easy to
> implement.

> In the _implementation_ of an obsolete feature, it's ok to use an
> obsolete variable and there is no need to be warned about it being
> obsolete. However, you should still be warned about the variable not
> being defined, in case you remove it altogether but forget to update
> the code that uses it.

Actually, I think I agree (I hate with-no-warnings), but it should be
even more precise, and specify which obsolete warning to silence.


        Stefan





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

* bug#4837: with-fewer-warnings ?
  2009-11-09 14:38     ` Stefan Monnier
@ 2009-11-10  2:09       ` Glenn Morris
  2009-11-10 17:58         ` Stefan Monnier
  0 siblings, 1 reply; 9+ messages in thread
From: Glenn Morris @ 2009-11-10  2:09 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 4837, rms

Stefan Monnier wrote:

> Actually, I think I agree (I hate with-no-warnings), but it should be
> even more precise, and specify which obsolete warning to silence.

Do you mean, specify precisely which obsolete variable/function(s) not
to warn about? That's probably doable via
byte-compile-not-obsolete-vars/funcs, I'll have a look.

A syntax like this?

(with-suppressed-warnings
    '((obsolete read-file-name-predicate ...) cl-functions ...)
  body)

Although the motivation for this was not _just_ obsolete warnings, and
it might not be so simple to extend your request to eg specific free
variables.





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

* bug#4837: with-fewer-warnings ?
  2009-11-10  2:09       ` Glenn Morris
@ 2009-11-10 17:58         ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2009-11-10 17:58 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4837, rms

>> Actually, I think I agree (I hate with-no-warnings), but it should be
>> even more precise, and specify which obsolete warning to silence.

> Do you mean, specify precisely which obsolete variable/function(s) not
> to warn about? That's probably doable via
> byte-compile-not-obsolete-vars/funcs, I'll have a look.

> A syntax like this?

> (with-suppressed-warnings
>     '((obsolete read-file-name-predicate ...) cl-functions ...)
>   body)

Yes, something like that.  Also the `cl-functions' is too broad and
should not be allowed.

> Although the motivation for this was not _just_ obsolete warnings, and
> it might not be so simple to extend your request to eg specific free
> variables.

I didn't say it was easy.

BTW, maybe a good way to do it is to implement this in the function
that outputs the warnings: currently it just received some kind of
string, which is not very amenable to what we want, but if you change it
to take a more structured description of the warning, then it might be
doable (tho maybe it won't happen at the right place, I don't know).


        Stefan





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

* bug#4837: with-fewer-warnings ?
  2009-10-31  2:25 bug#4837: with-fewer-warnings ? Glenn Morris
  2009-10-31  8:49 ` Eli Zaretskii
  2009-11-01  2:31 ` Richard Stallman
@ 2019-06-12 14:55 ` Lars Ingebrigtsen
  2019-06-12 16:13   ` Glenn Morris
  2 siblings, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-12 14:55 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 4837

Glenn Morris <rgm@gnu.org> writes:

> `with-no-warnings' suppresses all compilation warnings.
>
> I would like to add `with-fewer-warnings' (or some similar name) that
> suppresses only some warnings.
>
> Eg (with-fewer-warnings '(obsolete cl-functions) ...)

This is now implemented on master as `with-suppressed-warnings'.

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





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

* bug#4837: with-fewer-warnings ?
  2019-06-12 14:55 ` Lars Ingebrigtsen
@ 2019-06-12 16:13   ` Glenn Morris
  0 siblings, 0 replies; 9+ messages in thread
From: Glenn Morris @ 2019-06-12 16:13 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 4837

Lars Ingebrigtsen wrote:

> This is now implemented on master as `with-suppressed-warnings'.

Thanks a lot! :)





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

end of thread, other threads:[~2019-06-12 16:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-31  2:25 bug#4837: with-fewer-warnings ? Glenn Morris
2009-10-31  8:49 ` Eli Zaretskii
2009-11-01  2:31 ` Richard Stallman
2009-11-09  8:45   ` Glenn Morris
2009-11-09 14:38     ` Stefan Monnier
2009-11-10  2:09       ` Glenn Morris
2009-11-10 17:58         ` Stefan Monnier
2019-06-12 14:55 ` Lars Ingebrigtsen
2019-06-12 16:13   ` Glenn Morris

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