all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Byte-compilation warnings
@ 2008-06-10 18:18 Florian Beck
  2008-06-10 19:21 ` Drew Adams
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Florian Beck @ 2008-06-10 18:18 UTC (permalink / raw)
  To: help-gnu-emacs

Hi!

When I byte-compile my elisp files I get lots of warnings concerning cl:

Warning: Function `evenp' from cl package called at runtime

I find that annoying because (a) it drowns important warnings and (b) it
is about a coding convention for packages distributed with Emacs that
does not concern me at the moment. Surely, Emacs maintainers are able to
determine if something from cl is called at run time without spamming the
compile log for every user.

How can I get rid of it?
-- 
Florian Beck


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

* RE: Byte-compilation warnings
  2008-06-10 18:18 Byte-compilation warnings Florian Beck
@ 2008-06-10 19:21 ` Drew Adams
  2008-06-10 20:01   ` Florian Beck
  2008-06-11  6:52   ` Thien-Thi Nguyen
  2008-06-10 21:24 ` Nikolaj Schumacher
       [not found] ` <mailman.13000.1213125756.18990.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 10+ messages in thread
From: Drew Adams @ 2008-06-10 19:21 UTC (permalink / raw)
  To: 'Florian Beck', help-gnu-emacs

> When I byte-compile my elisp files I get lots of warnings 
> concerning cl:
> 
> Warning: Function `evenp' from cl package called at runtime
> 
> I find that annoying because (a) it drowns important warnings 
> and (b) it is about a coding convention for packages
> distributed with Emacs that does not concern me at the moment.
> Surely, Emacs maintainers are able to
> determine if something from cl is called at run time without 
> spamming the compile log for every user.

I sympathize with you.

FWIW, however, I appreciate this warning (information, really) as a user. I want
to recognize when I might want to either code something differently or use
(eval-when-compile (require 'cl)).
 
> How can I get rid of it?

Dunno. It would be nice if compiler messages could be silenced in classes (e.g.
info, warnings). Maybe they can.





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

* Re: Byte-compilation warnings
  2008-06-10 19:21 ` Drew Adams
@ 2008-06-10 20:01   ` Florian Beck
  2008-06-10 20:34     ` Eli Zaretskii
                       ` (2 more replies)
  2008-06-11  6:52   ` Thien-Thi Nguyen
  1 sibling, 3 replies; 10+ messages in thread
From: Florian Beck @ 2008-06-10 20:01 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, 'Florian Beck'

"Drew Adams" <drew.adams@oracle.com> writes:

>> When I byte-compile my elisp files I get lots of warnings 
>> concerning cl:
>> 
>> Warning: Function `evenp' from cl package called at runtime
>> 
>> I find that annoying because (a) it drowns important warnings 
>> and (b) it is about a coding convention for packages
>> distributed with Emacs that does not concern me at the moment.
>> Surely, Emacs maintainers are able to
>> determine if something from cl is called at run time without 
>> spamming the compile log for every user.
>
> I sympathize with you.
>
> FWIW, however, I appreciate this warning (information, really) as a user. I want
> to recognize when I might want to either code something differently or use
> (eval-when-compile (require 'cl)).

Alas, this only works for cl *macros*. If I could repress the faux
warnings by some code – that would be fine. Seems like I cannot.

This is really annoying, because it can easily result in *pages* of
spurious warnings I *know* to be unwarranted.

For me, byte compiler warnings would be a great way to avoid error,
would I not tend to ignore them because of the above problems. I can
work around `reference to free variable' warnings, but not the cl
warnings. 

The result is not me seriously considering the cl warnings but pretty
much disregarding all of them. Not very useful.

My point is, I might apprecciate the information *once*, but after that I
have made my deciscion. Further warnings only distract me.

-- 
Florian Beck, looking for (I-really-want-to-use-cl-even-at-eval)




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

* Re: Byte-compilation warnings
  2008-06-10 20:01   ` Florian Beck
@ 2008-06-10 20:34     ` Eli Zaretskii
  2008-06-10 20:45     ` Lennart Borgman (gmail)
       [not found]     ` <mailman.13011.1213130153.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2008-06-10 20:34 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Florian Beck <abstraktion@t-online.de>
> Date: Tue, 10 Jun 2008 22:01:54 +0200
> Cc: help-gnu-emacs@gnu.org, 'Florian Beck' <abstraktion@t-online.de>
> 
> For me, byte compiler warnings would be a great way to avoid error,
> would I not tend to ignore them because of the above problems. I can
> work around `reference to free variable' warnings, but not the cl
> warnings. 
> 
> The result is not me seriously considering the cl warnings but pretty
> much disregarding all of them. Not very useful.
> 
> My point is, I might apprecciate the information *once*, but after that I
> have made my deciscion. Further warnings only distract me.

You can always fset byte-compile-cl-warn to something like `ignore',
right?  Doesn't this work for some reason?




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

* Re: Byte-compilation warnings
  2008-06-10 20:01   ` Florian Beck
  2008-06-10 20:34     ` Eli Zaretskii
@ 2008-06-10 20:45     ` Lennart Borgman (gmail)
       [not found]     ` <mailman.13011.1213130153.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Lennart Borgman (gmail) @ 2008-06-10 20:45 UTC (permalink / raw)
  To: Florian Beck; +Cc: help-gnu-emacs

Florian Beck wrote:
> "Drew Adams" <drew.adams@oracle.com> writes:
> 
>>> When I byte-compile my elisp files I get lots of warnings 
>>> concerning cl:
>>>
>>> Warning: Function `evenp' from cl package called at runtime

I did not follow this thread, but I wonder if the warning disappears if 
you require cl the right way:

   (eval-when-compile (require 'cl))





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

* Re: Byte-compilation warnings
       [not found]     ` <mailman.13011.1213130153.18990.help-gnu-emacs@gnu.org>
@ 2008-06-10 21:05       ` Florian Beck
  2008-06-10 21:09         ` Florian Beck
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Beck @ 2008-06-10 21:05 UTC (permalink / raw)
  To: help-gnu-emacs

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Florian Beck <abstraktion@t-online.de>
>> Date: Tue, 10 Jun 2008 22:01:54 +0200
>> Cc: help-gnu-emacs@gnu.org, 'Florian Beck' <abstraktion@t-online.de>
>> 
>> For me, byte compiler warnings would be a great way to avoid error,
>> would I not tend to ignore them because of the above problems. I can
>> work around `reference to free variable' warnings, but not the cl
>> warnings. 
>> 
>> The result is not me seriously considering the cl warnings but pretty
>> much disregarding all of them. Not very useful.
>> 
>> My point is, I might apprecciate the information *once*, but after that I
>> have made my deciscion. Further warnings only distract me.
>
> You can always fset byte-compile-cl-warn to something like `ignore',
> right?  Doesn't this work for some reason?

It doesn't. I guess you mean `byte-compiler-warnings'; that results in

Debugger entered--Lisp error: (setting-constant t)
  fset(t ignore)
  eval((fset byte-compile-warnings (quote ignore)))
  eval-last-sexp-1(nil)
  eval-last-sexp(nil)
  call-interactively(eval-last-sexp nil nil)

Anyway, you gave me a lead and:

(setq-default byte-compile-warnings '(not cl-functions)) 

does seem to do the trick.

Thanks!

BTW, I coudn't find anyting in info »byte compiler warnings, how to
avoid«. You might want to consider it there.

I'm using current CVS, if that matters.
-- 
Florian Beck


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

* Re: Byte-compilation warnings
  2008-06-10 21:05       ` Florian Beck
@ 2008-06-10 21:09         ` Florian Beck
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Beck @ 2008-06-10 21:09 UTC (permalink / raw)
  To: help-gnu-emacs

Florian Beck <abstraktion@t-online.de> writes:

> It doesn't. I guess you mean `byte-compiler-warnings'; that results in
>
> Debugger entered--Lisp error: (setting-constant t)
>   fset(t ignore)
>   eval((fset byte-compile-warnings (quote ignore)))
>   eval-last-sexp-1(nil)
>   eval-last-sexp(nil)
>   call-interactively(eval-last-sexp nil nil)

I'm sorry. I forgot to quote that:

(fset 'byte-compile-cl-warn 'ignore)

seems to work as well.

-- 
Florian Beck


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

* Re: Byte-compilation warnings
  2008-06-10 18:18 Byte-compilation warnings Florian Beck
  2008-06-10 19:21 ` Drew Adams
@ 2008-06-10 21:24 ` Nikolaj Schumacher
       [not found] ` <mailman.13000.1213125756.18990.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Nikolaj Schumacher @ 2008-06-10 21:24 UTC (permalink / raw)
  To: Florian Beck; +Cc: help-gnu-emacs

Florian Beck <abstraktion@t-online.de> wrote:

> Warning: Function `evenp' from cl package called at runtime
>
> [SNIP]
>
> How can I get rid of it?

Customize `byte-compile-warnings'.

Regards,
Nikolaj Schumacher




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

* Re: Byte-compilation warnings
  2008-06-10 19:21 ` Drew Adams
  2008-06-10 20:01   ` Florian Beck
@ 2008-06-11  6:52   ` Thien-Thi Nguyen
  1 sibling, 0 replies; 10+ messages in thread
From: Thien-Thi Nguyen @ 2008-06-11  6:52 UTC (permalink / raw)
  To: help-gnu-emacs

() "Drew Adams" <drew.adams@oracle.com>
() Tue, 10 Jun 2008 12:21:04 -0700

   compiler messages
   silenced in classes (e.g.
   info, warnings). Maybe they can.

See `byte-compile-warning-types'
and `byte-compile-warnings'.

This short list was made by:
(require 'bytecomp)
M-x apropos byte.*warn RET

and looking for entries that are marked "Variable:".

thi




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

* Re: Byte-compilation warnings
       [not found] ` <mailman.13000.1213125756.18990.help-gnu-emacs@gnu.org>
@ 2008-06-11  8:07   ` Tim X
  0 siblings, 0 replies; 10+ messages in thread
From: Tim X @ 2008-06-11  8:07 UTC (permalink / raw)
  To: help-gnu-emacs

"Drew Adams" <drew.adams@oracle.com> writes:

>> When I byte-compile my elisp files I get lots of warnings 
>> concerning cl:
>> 
>> Warning: Function `evenp' from cl package called at runtime
>> 
>> I find that annoying because (a) it drowns important warnings 
>> and (b) it is about a coding convention for packages
>> distributed with Emacs that does not concern me at the moment.
>> Surely, Emacs maintainers are able to
>> determine if something from cl is called at run time without 
>> spamming the compile log for every user.
>
> I sympathize with you.
>
> FWIW, however, I appreciate this warning (information, really) as a user. I want
> to recognize when I might want to either code something differently or use
> (eval-when-compile (require 'cl)).
>  
>> How can I get rid of it?
>
> Dunno. It would be nice if compiler messages could be silenced in classes (e.g.
> info, warnings). Maybe they can.
>

In Emacs CVS you have byte-compile-warnings 

,----[ C-h v byte-compile-warnings RET ]
| byte-compile-warnings is a variable defined in `bytecomp.el'.
| Its value is 
| (redefine callargs free-vars unresolved obsolete)
| 
| 
|   This variable is safe as a file local variable if its value
|   satisfies the predicate `byte-compile-warnings-safe-p'.
| 
| Documentation:
| *List of warnings that the byte-compiler should issue (t for all).
| 
| Elements of the list may be:
| 
|   free-vars   references to variables not in the current lexical scope.
|   unresolved  calls to unknown functions.
|   callargs    function calls with args that don't match the definition.
|   redefine    function name redefined from a macro to ordinary function or vice
|               versa, or redefined to take a different number of arguments.
|   obsolete    obsolete variables and functions.
|   noruntime   functions that may not be defined at runtime (typically
|               defined only under `eval-when-compile').
|   cl-functions    calls to runtime functions from the CL package (as
| 		  distinguished from macros and aliases).
|   interactive-only
| 	      commands that normally shouldn't be called from Lisp code.
|   make-local  calls to make-variable-buffer-local that may be incorrect.
|   mapcar      mapcar called for effect.
| 
| If the list begins with `not', then the remaining elements specify warnings to
| suppress.  For example, (not mapcar) will suppress warnings about mapcar.
| 
| You can customize this variable.
`----

However, I strongly suggest peole try to understand why they are getting
the warning and where possible, get rid of it by getting rid of the
cause rather than just hiding it. 

regards,

Tim


-- 
tcross (at) rapttech dot com dot au


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

end of thread, other threads:[~2008-06-11  8:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 18:18 Byte-compilation warnings Florian Beck
2008-06-10 19:21 ` Drew Adams
2008-06-10 20:01   ` Florian Beck
2008-06-10 20:34     ` Eli Zaretskii
2008-06-10 20:45     ` Lennart Borgman (gmail)
     [not found]     ` <mailman.13011.1213130153.18990.help-gnu-emacs@gnu.org>
2008-06-10 21:05       ` Florian Beck
2008-06-10 21:09         ` Florian Beck
2008-06-11  6:52   ` Thien-Thi Nguyen
2008-06-10 21:24 ` Nikolaj Schumacher
     [not found] ` <mailman.13000.1213125756.18990.help-gnu-emacs@gnu.org>
2008-06-11  8:07   ` Tim X

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.