summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/ChangeLog10
-rw-r--r--eclass/elisp-common.eclass16
-rw-r--r--eclass/elisp.eclass16
3 files changed, 32 insertions, 10 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 41632b2..73cf477 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,3 +1,13 @@
+2008-08-23 Ulrich Mueller <ulm@gentoo.org>
+
+ * elisp.eclass (VERSION): Remove unnecessary global variable to
+ reduce namespace pollution.
+ (elisp_pkg_setup): Use NEED_EMACS, clarify local variable names.
+
+ * elisp-common.eclass (BYTECOMPFLAGS): New variable.
+ (elisp-compile): Use it, instead of hardcoding the load-path.
+ (EMACS, EMACSFLAGS): Document as eclass variables.
+
2008-08-20 Ulrich Mueller <ulm@gentoo.org>
* elisp-common.eclass (elisp-compile): Add current directory to
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 47067ab..a2068fd 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -140,10 +140,22 @@ 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: <list of elisp files>
# @DESCRIPTION:
@@ -159,7 +171,7 @@ EMACSFLAGS="-batch -q --no-site-file"
elisp-compile() {
ebegin "Compiling GNU Emacs Elisp files"
- ${EMACS} ${EMACSFLAGS} -L . -f batch-byte-compile "$@"
+ ${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@"
eend $? "batch-byte-compile failed"
}
diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass
index 859be40..2eeadf4 100644
--- a/eclass/elisp.eclass
+++ b/eclass/elisp.eclass
@@ -37,19 +37,19 @@
inherit elisp-common versionator
-VERSION=${NEED_EMACS:-21}
-DEPEND=">=virtual/emacs-${VERSION}"
-RDEPEND=">=virtual/emacs-${VERSION}"
+DEPEND=">=virtual/emacs-${NEED_EMACS:-21}"
+RDEPEND=">=virtual/emacs-${NEED_EMACS:-21}"
IUSE=""
elisp_pkg_setup() {
- local emacs_version="$(elisp-emacs-version)"
- if ! version_is_at_least "${VERSION}" "${emacs_version}"; then
- eerror "This package needs at least Emacs ${VERSION}."
+ local need_emacs=${NEED_EMACS:-21}
+ local have_emacs=$(elisp-emacs-version)
+ if ! version_is_at_least "${need_emacs}" "${have_emacs}"; then
+ eerror "This package needs at least Emacs ${need_emacs}."
eerror "Use \"eselect emacs\" to select the active version."
- die "Emacs version ${emacs_version} is too low."
+ die "Emacs version ${have_emacs} is too low."
fi
- einfo "Currently selected GNU Emacs version: ${emacs_version}"
+ einfo "Currently selected GNU Emacs version: ${have_emacs}"
}
elisp_src_unpack() {