[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 5065698: Move the ‘declare’ form before the interactive spec
From: |
Stefan Monnier |
Subject: |
Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions. |
Date: |
Fri, 22 Jan 2021 09:04:44 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>>> - (t (message "Warning: Unknown defun property `%S' in %S"
>>> - (car x) name)))))
>>> + (t (message "%S:%d:Warning: Unknown defun property `%S'"
>>> + name (count-lines (point-min) (point))
>>> + (car x))))))
>> I think `count-lines` is a problem because we don't know in which buffer
>> we are when this is executed.
> The GNU Coding Standard format requires a line number between colons,
> so maybe count-lines would give some plausible number in most cases.
But 0 would work as well for that purpose.
>> Another approach could be to use something like
>> `macroexp--warn-and-return`.
> `macroexp--warn-and-return` uses `load-file-name` that is nil here.
Not necessarily, no: when compiling, it will let bytecomp.el emit the
warning which gives proper file and line numbers.
Do we care about the format used when we're not compiling?
[ This is not a rethorical question. ]
> I tried it, but it has no effect.
>
> (let ((warnfun (lambda ()
> (message "Warning: Unknown defun property `%S' in %S"
> (car x) name))))
> `(progn
> (macroexp--funcall-if-compiled ',warnfun)))
How did you try it?
Stefan
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., (continued)
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Lars Ingebrigtsen, 2021/01/20
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/20
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/20
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Dmitry Gutov, 2021/01/20
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/20
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/21
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/21
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/21
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/21
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/22
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions.,
Stefan Monnier <=
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/23
- Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Stefan Monnier, 2021/01/23
Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions., Juri Linkov, 2021/01/20