emacs-devel
[Top][All Lists]
Advanced

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

declare-function from included file


From: Ralf Angeli
Subject: declare-function from included file
Date: Sun, 16 Mar 2008 19:23:57 +0100

Hi,

is it possible to put calls to `declare-function' in a file to be
included during byte compilation?  The following does not seem not work:

Create the following three files ...

file.el:

(eval-when-compile
  (require 'include))
(defun foo ()
  (bar))

include.el:

(declare-function bar "ext:baz")
(provide 'include)

lpath.el:

(setq load-path (cons "." load-path))

... and compile file.el with
emacs -batch -q -l lpath.el -f batch-byte-compile file.el

With this recipe there is still a warning from the byte compiler about
`bar' being undefined.

I can silence the byte compiler by using
(fset 'bar (lambda (&rest args) nil))
in include.el instead of the `declare-function' call.  Would this be a
better alternative?

-- 
Ralf





reply via email to

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