From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: package not needed to byte-compile Date: Mon, 23 Feb 2015 05:15:59 +0100 Message-ID: <877fv9i7pc.fsf@web.de> References: <20150222190702.4e370c26@gauss> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1424664998 23972 80.91.229.3 (23 Feb 2015 04:16:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 23 Feb 2015 04:16:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 23 05:16:29 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YPkRY-0006Sd-LY for geh-help-gnu-emacs@m.gmane.org; Mon, 23 Feb 2015 05:16:28 +0100 Original-Received: from localhost ([::1]:41982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPkRX-0006AY-Pa for geh-help-gnu-emacs@m.gmane.org; Sun, 22 Feb 2015 23:16:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41526) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPkRL-0006AE-RD for help-gnu-emacs@gnu.org; Sun, 22 Feb 2015 23:16:16 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPkRG-0006VD-SM for help-gnu-emacs@gnu.org; Sun, 22 Feb 2015 23:16:15 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:38286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPkRG-0006Ux-L0 for help-gnu-emacs@gnu.org; Sun, 22 Feb 2015 23:16:10 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1YPkRD-0006K2-MR for help-gnu-emacs@gnu.org; Mon, 23 Feb 2015 05:16:07 +0100 Original-Received: from dslb-094-218-215-078.094.218.pools.vodafone-ip.de ([94.218.215.78]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Feb 2015 05:16:07 +0100 Original-Received: from michael_heerdegen by dslb-094-218-215-078.094.218.pools.vodafone-ip.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 23 Feb 2015 05:16:07 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 27 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dslb-094-218-215-078.094.218.pools.vodafone-ip.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:9hAsrktFIAPWTjdyAGznH1JaZmc= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:102843 Archived-At: Joe Riel writes: > Is there a way to tell Emacs that package B is required to run package > A, but not to compile package A? Using (require B) causes an error > during byte-compilation because the package is not necessarily > available then. I guess something like this, for example: --8<---------------cut here---------------start------------->8--- (defun a-require-b () (require 'b)) (a-require-b) --8<---------------cut here---------------end--------------->8--- You can put a require call into any defun if you like (entry points to code that makes use of B), that is not uncommon. Of course A should not make use of any macros defined in B. If the whole B makes use of A's functions however, a toplevel require is better. If you avoid a toplevel require, you can use declare-function to get rid of the compiler warnings about undefined functions. Michael.