From 629cee7b2847a52028850dbc5e4e497acec68833 Mon Sep 17 00:00:00 2001 From: Ulrich Müller Date: Wed, 27 Aug 2008 06:53:41 +0000 Subject: Sync eclasses from Emacs overlay (revision 1137). elisp-common.eclass: Add current directory to load-path in elisp-compile. New variable BYTECOMPFLAGS. Document EMACS and EMACSFLAGS as eclass variables. --- eclass/elisp-common.eclass | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'eclass') diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 4dc9ed3f277c..6111ab1c9cac 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.42 2008/08/10 16:54:22 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.43 2008/08/27 06:53:41 ulm Exp $ # # Copyright 2002-2004 Matthew Kennedy # Copyright 2003 Jeremy Maitin-Shepard @@ -33,20 +33,20 @@ # src_compile() usage: # # An elisp file is compiled by the elisp-compile() function defined here and -# simply takes the source files as arguments. +# simply takes the source files as arguments. The case of interdependent +# elisp files is also supported, since the current directory is added to the +# load-path which makes sure that all files are loadable. # # elisp-compile *.el || die "elisp-compile failed" # -# In the case of interdependent elisp files, you can use the elisp-comp() -# function which makes sure all files are loadable. -# -# elisp-comp *.el || die "elisp-comp failed" +# Formerly, function elisp-comp() was used for compilation of interdependent +# elisp files. This usage is considered as obsolete. # # Function elisp-make-autoload-file() can be used to generate a file with # autoload definitions for the lisp functions. It takes the output file name # (default: "${PN}-autoloads.el") and a list of directories (default: working # directory) as its arguments. Use of this function requires that the elisp -# source files contain magic ";;;###autoload" comments. See the Emacs Lisp +# source files contain magic ";;;###autoload" comments. See the Emacs Lisp # Reference Manual (node "Autoload") for a detailed explanation. # # .SS @@ -140,18 +140,38 @@ SITEETC=/usr/share/emacs/etc # Name of package's site-init file. SITEFILE=50${PN}-gentoo.el +# @ECLASS-VARIABLE: EMACS +# @DESCRIPTION: +# Path of Emacs executable. EMACS=/usr/bin/emacs -# The following works for Emacs versions 18-23, don't change it. + +# @ECLASS-VARIABLE: EMACSFLAGS +# @DESCRIPTION: +# Flags for executing Emacs in batch mode. +# These work for Emacs versions 18-23, so don't change them. EMACSFLAGS="-batch -q --no-site-file" +# @ECLASS-VARIABLE: BYTECOMPFLAGS +# @DESCRIPTION: +# Emacs flags used for byte-compilation in elisp-compile(). +BYTECOMPFLAGS="-L ." + # @FUNCTION: elisp-compile # @USAGE: # @DESCRIPTION: # Byte-compile Emacs Lisp files. +# +# This function uses GNU Emacs to byte-compile all ".el" specified by its +# arguments. The resulting byte-code (".elc") files are placed in the same +# directory as their corresponding source file. +# +# The current directory is added to the load-path. This will ensure that +# interdependent Emacs Lisp files are visible between themselves, in case +# they require or load one another. elisp-compile() { ebegin "Compiling GNU Emacs Elisp files" - ${EMACS} ${EMACSFLAGS} -f batch-byte-compile "$@" + ${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@" eend $? "batch-byte-compile failed" } -- cgit v1.2.3-65-gdbad