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

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

Re: eval-when-compile and require


From: Emanuel Berg
Subject: Re: eval-when-compile and require
Date: Thu, 23 Nov 2017 06:22:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Stefan Monnier wrote:

>> (eval-when-compile (require 'foo))
>> [...] (info "(elisp) Warning Tips")
>
> I suggest you M-x report-emacs-bug, since
> that doc is incorrect (you'll still get
> warnings along the lines of "those functions
> are not known to be defined at runtime").

Close!

Actually it says "might not be defined at
runtime" :)

And it only mentions `cl-find-if' - not
`cl-caddr' or `cl-case' (?). Perhaps they have
some different status or location within the
CL library?

Also, looking at the fallout below, is it
likely that `eval-and-compile' (N.B. -and-, not
-when-) is what they meant in
(info "(elisp) Warning Tips") ?

Here is the compilation function:

    #! /bin/zsh
    compile-one () {
        local file=$1
        emacs -Q -batch -f batch-byte-compile $file
    }

Using functions form `cl-lib', and not doing
anything about it:

    In end of data:
    wrap-search-cp.el:133:1:Warning: the
    following functions are not known to be
    defined: cl-find-if, cl-caddr, cl-case

using (require 'cl-lib)

    no errors or warnings

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

    In end of data:
    wrap-search-cp.el:133:1:Warning: the
    function `cl-find-if' might not be defined
    at runtime.

using (eval-and-compile (require 'cl-lib))

    no errors or warnings

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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