unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#6262: Please learn the compiler that defface needs a doc string
@ 2010-05-24 19:47 Lennart Borgman
  2010-05-26  6:54 ` Glenn Morris
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2010-05-24 19:47 UTC (permalink / raw)
  To: 6262

Otherwise I will have to learn myself that.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-24 19:47 bug#6262: Please learn the compiler that defface needs a doc string Lennart Borgman
@ 2010-05-26  6:54 ` Glenn Morris
  2010-05-26 16:51   ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2010-05-26  6:54 UTC (permalink / raw)
  To: 6262


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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26  6:54 ` Glenn Morris
@ 2010-05-26 16:51   ` Lennart Borgman
  2010-05-26 17:54     ` Juanma Barranquero
  0 siblings, 1 reply; 8+ messages in thread
From: Lennart Borgman @ 2010-05-26 16:51 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 6262

On Wed, May 26, 2010 at 8:54 AM, Glenn Morris <rgm@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26 16:51   ` Lennart Borgman
@ 2010-05-26 17:54     ` Juanma Barranquero
  2010-05-26 18:09       ` Lennart Borgman
  0 siblings, 1 reply; 8+ messages in thread
From: Juanma Barranquero @ 2010-05-26 17:54 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 6262

On Wed, May 26, 2010 at 18:51, Lennart Borgman
<lennart.borgman@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26 17:54     ` Juanma Barranquero
@ 2010-05-26 18:09       ` Lennart Borgman
  2010-05-26 18:27         ` Glenn Morris
  2011-09-21 20:20         ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-05-26 18:09 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: 6262

On Wed, May 26, 2010 at 7:54 PM, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Wed, May 26, 2010 at 18:51, Lennart Borgman
> <lennart.borgman@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26 18:09       ` Lennart Borgman
@ 2010-05-26 18:27         ` Glenn Morris
  2010-05-26 18:49           ` Lennart Borgman
  2011-09-21 20:20         ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 8+ messages in thread
From: Glenn Morris @ 2010-05-26 18:27 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Juanma Barranquero, 6262


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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26 18:27         ` Glenn Morris
@ 2010-05-26 18:49           ` Lennart Borgman
  0 siblings, 0 replies; 8+ messages in thread
From: Lennart Borgman @ 2010-05-26 18:49 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Juanma Barranquero, 6262

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?





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#6262: Please learn the compiler that defface needs a doc string
  2010-05-26 18:09       ` Lennart Borgman
  2010-05-26 18:27         ` Glenn Morris
@ 2011-09-21 20:20         ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-09-21 20:20 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Juanma Barranquero, 6262

Lennart Borgman <lennart.borgman@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/





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-09-21 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-24 19:47 bug#6262: Please learn the compiler that defface needs a doc string Lennart Borgman
2010-05-26  6:54 ` Glenn Morris
2010-05-26 16:51   ` Lennart Borgman
2010-05-26 17:54     ` Juanma Barranquero
2010-05-26 18:09       ` Lennart Borgman
2010-05-26 18:27         ` Glenn Morris
2010-05-26 18:49           ` Lennart Borgman
2011-09-21 20:20         ` Lars Magne Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).