unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ralf Angeli <angeli@caeruleus.net>
To: emacs-devel@gnu.org
Subject: declare-function from included file
Date: Sun, 16 Mar 2008 19:23:57 +0100	[thread overview]
Message-ID: <frjojr$18e$1@ger.gmane.org> (raw)

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	other threads:[~2008-03-16 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-16 18:23 Ralf Angeli [this message]
2008-03-19  0:47 ` declare-function from included file Glenn Morris
2008-03-19 18:57   ` Ralf Angeli
2008-03-19 19:30     ` Stefan Monnier
2008-03-19 20:32       ` Ralf Angeli
2008-03-19 20:42         ` Dan Nicolaescu
2008-03-19 21:00           ` Ralf Angeli
2008-03-19 21:19             ` Dan Nicolaescu
2008-03-19 21:45               ` Ralf Angeli
2008-03-19 22:18                 ` Dan Nicolaescu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='frjojr$18e$1@ger.gmane.org' \
    --to=angeli@caeruleus.net \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).