[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to cause a compiler warning?
From: |
João Távora |
Subject: |
Re: How to cause a compiler warning? |
Date: |
Wed, 17 Jan 2024 13:40:04 +0000 |
On Wed, Jan 17, 2024 at 12:25 PM Alan Mackenzie <acm@muc.de> wrote:
> ARG can be any Lisp form at all. How would you reformulate the doc
> string to make it less vague and curious?
Call it FORM. Then add in the text you wrote to Richard, who
seem to have also been confused.
I got the idea of it pretty quickly, even with the ARG naming,
so take that as a data point.
> Really? Can you point out any such existing macro in the source files
> of the byte compiler? You must be aware that warning messages without
> source code locations are annoying in the extreme.
Not all macros process forms. Just search for a macro without arguments.
> source code locations are annoying in the extreme.
That's a bit of an extreme statement.
Macros that don't process source code and are used simply to
generate Lisp code don't have anything else to report. So using
byte-compiler-warn is fine and you'll see the macro invocation
itself highlighted.
> byte-compile-warn-x is intended for use in the byte compiler. Anybody
> doing work there should be sophisticated enough to understand what to
> do. In macros which extend the Lisp language, there is
> macroexp-warn-and-return, for anybody who can understand it. Do people
> actually write such language extensions and expect them to work on old
> Emacs versions? There may be, but I'm not aware of any.
I write macros that are supposed to work back to Emacs 26 yes. I
frequently don't bother with byte-compiler-errors as I tend to
let the other macros and special forms my macro expands to do that.
But not necessarily always.
My point is you shouldn't make this a hard rule with such dogmatism
But it was fine to suggest byte-compile-warn-x, which I didn't
know about, so thanks.
- How to cause a compiler warning?, Richard Stallman, 2024/01/13
- Re: How to cause a compiler warning?, João Távora, 2024/01/13
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/14
- Re: How to cause a compiler warning?, João Távora, 2024/01/14
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/14
- Re: How to cause a compiler warning?, João Távora, 2024/01/14
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/17
- Re: How to cause a compiler warning?,
João Távora <=
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/18
- Re: How to cause a compiler warning?, João Távora, 2024/01/18
- Re: How to cause a compiler warning?, Ihor Radchenko, 2024/01/14
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/14
- Re: How to cause a compiler warning?, Richard Stallman, 2024/01/16
- Re: How to cause a compiler warning?, Alan Mackenzie, 2024/01/17