GNU bug report logs - #6262
Please learn the compiler that defface needs a doc string

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Mon, 24 May 2010 19:49:02 UTC

Severity: normal

Tags: fixed

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6262 in the body.
You can then email your comments to 6262 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Mon, 24 May 2010 19:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lennart Borgman <lennart.borgman <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 24 May 2010 19:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Emacs Bugs <bug-gnu-emacs <at> gnu.org>
Subject: Please learn the compiler that defface needs a doc string
Date: Mon, 24 May 2010 21:47:50 +0200
Otherwise I will have to learn myself that.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 06:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 6262 <at> debbugs.gnu.org
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc
	string
Date: Wed, 26 May 2010 02:54:19 -0400
Lennart Borgman wrote (on Mon, 24 May 2010 at 21:47 +0200):

> Otherwise I will have to learn myself that.

Please teach yourself how to make a proper bug report.

Like many of your other reports, this is lacking details.

Please explain clearly what the problem actually is.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 16:58:02 GMT) Full text and rfc822 format available.

Message #11 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 6262 <at> debbugs.gnu.org
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc 
	string
Date: Wed, 26 May 2010 18:51:09 +0200
On Wed, May 26, 2010 at 8:54 AM, Glenn Morris <rgm <at> gnu.org> wrote:
>
> Lennart Borgman wrote (on Mon, 24 May 2010 at 21:47 +0200):
>
>> Otherwise I will have to learn myself that.
>
> Please teach yourself how to make a proper bug report.
>
> Like many of your other reports, this is lacking details.

Sorry, I will try.

> Please explain clearly what the problem actually is.

If you forget to add a doc string to defface it compiles "fine", i.e.
without any warnings, but you get trouble later.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 17:55:01 GMT) Full text and rfc822 format available.

Message #14 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 6262 <at> debbugs.gnu.org
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc 
	string
Date: Wed, 26 May 2010 19:54:01 +0200
On Wed, May 26, 2010 at 18:51, Lennart Borgman
<lennart.borgman <at> gmail.com> wrote:

> If you forget to add a doc string to defface it compiles "fine", i.e.
> without any warnings, but you get trouble later.

That's still quite vague. What kind of trouble? Do you have a
step-by-step recipe?

    Juanma




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 18:11:02 GMT) Full text and rfc822 format available.

Message #17 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Juanma Barranquero <lekktu <at> gmail.com>
Cc: Glenn Morris <rgm <at> gnu.org>, 6262 <at> debbugs.gnu.org
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc 
	string
Date: Wed, 26 May 2010 20:09:48 +0200
On Wed, May 26, 2010 at 7:54 PM, Juanma Barranquero <lekktu <at> gmail.com> wrote:
> On Wed, May 26, 2010 at 18:51, Lennart Borgman
> <lennart.borgman <at> gmail.com> wrote:
>
>> If you forget to add a doc string to defface it compiles "fine", i.e.
>> without any warnings, but you get trouble later.
>
> That's still quite vague. What kind of trouble? Do you have a
> step-by-step recipe?


Try to compile this

(defface my-face
  '((t (:foreground "black" :background "OrangeRed")))
  :group 'web-vcs)

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.

It would be quite nice if you got an error in both cases - especially
since it is rather unlikely that you are very used to defining faces
and that it is a bit special (although good) that the doc string is
required.

I think there is a similar problem with define-minor-mode, but I am
not quite sure now.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 18:29:01 GMT) Full text and rfc822 format available.

Message #20 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 6262 <at> debbugs.gnu.org
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc 
	string
Date: Wed, 26 May 2010 14:27:58 -0400
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.

It is akin to asking for the compiler to warn about this:

(load 'not-a-string)

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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 26 May 2010 18:51:01 GMT) Full text and rfc822 format available.

Message #23 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Lennart Borgman <lennart.borgman <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 6262 <at> debbugs.gnu.org
Subject: Re: 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 <at> 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?




Added tag(s) fixed. Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 21 Sep 2011 20:25:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.1, send any further explanations to 6262 <at> debbugs.gnu.org and Lennart Borgman <lennart.borgman <at> gmail.com> Request was from Lars Magne Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 21 Sep 2011 20:25:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#6262; Package emacs. (Wed, 21 Sep 2011 20:37:02 GMT) Full text and rfc822 format available.

Message #30 received at 6262 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <larsi <at> gnus.org>
To: Lennart Borgman <lennart.borgman <at> gmail.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 6262 <at> debbugs.gnu.org,
	Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#6262: Please learn the compiler that defface needs a doc
	string
Date: Wed, 21 Sep 2011 22:20:55 +0200
Lennart Borgman <lennart.borgman <at> gmail.com> writes:

> Try to compile this
>
> (defface my-face
>   '((t (:foreground "black" :background "OrangeRed")))
>   :group 'web-vcs)
>
> 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.

I now get:

Debugger entered--Lisp error: (error "Keyword web-vcs is missing an argument")

So this seems to have been fixed now.

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




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 20 Oct 2011 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 13 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.