bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#6262: Please learn the compiler that defface needs a doc string


From: Lennart Borgman
Subject: bug#6262: Please learn the compiler that defface needs a doc string
Date: Wed, 26 May 2010 20:49:40 +0200

On Wed, May 26, 2010 at 8:27 PM, Glenn Morris <rgm@gnu.org> wrote:
>
> Lennart Borgman wrote (on Wed, 26 May 2010 at 20:09 +0200):
>
>> Try to compile this
>>
>> (defface my-face
>>   '((t (:foreground "black" :background "OrangeRed")))
>>   :group 'web-vcs)
>
> Please, try to start at this point next time.
>
>> You get a warning (I misremembered), but no error. However you get an
>> error when you try to load it.
>>
>> If you just eval the definition you get no warning.
>
> You are asking for argument type checking.


If you do eval-buffer with the above declaration in the buffer you get
a call to custom-declare-face. A check there would be good.

defcustom has such a check. define-minor-mode lacks it just as defface.


> It is akin to asking for the compiler to warn about this:
>
> (load 'not-a-string)


I guess you mean that the macros are just expanded during compilation
and no call to the result is done until loading of the file.

If that is what you mean then my suggestion above should work fine.
Otherwise could you please explain what you mean?


> Pay attention to the compilation warning you do get, which indicates
> there is a problem.


There is an error. Is there any reason the compile can't say that in this case?





reply via email to

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