emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 5065698: Move the ‘declare’ form before the interactive spec


From: Juri Linkov
Subject: Re: master 5065698: Move the ‘declare’ form before the interactive spec in 10 functions.
Date: Fri, 22 Jan 2021 10:50:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

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

> Another approach could be to use something like
> `macroexp--warn-and-return`.

`macroexp--warn-and-return` uses `load-file-name` that is nil here.
Or do you mean the docstring of `macroexp--funcall-if-compiled`:

  The purpose is to delay warnings to bytecomp.el, so they can use things
  like `byte-compile-warn' to get better file-and-line-number data
  and also to avoid outputting the warning during normal execution.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]