/[gentoo-x86]/eclass/elisp-common.eclass
Gentoo

Diff of /eclass/elisp-common.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.79 Revision 1.80
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.79 2012/02/11 12:20:33 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.80 2012/04/27 19:51:52 ulm Exp $
4# 4#
5# @ECLASS: elisp-common.eclass 5# @ECLASS: elisp-common.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Gentoo Emacs team <emacs@gentoo.org> 7# Gentoo Emacs team <emacs@gentoo.org>
8# @AUTHOR: 8# @AUTHOR:
157EMACS=${EPREFIX}/usr/bin/emacs 157EMACS=${EPREFIX}/usr/bin/emacs
158 158
159# @ECLASS-VARIABLE: EMACSFLAGS 159# @ECLASS-VARIABLE: EMACSFLAGS
160# @DESCRIPTION: 160# @DESCRIPTION:
161# Flags for executing Emacs in batch mode. 161# Flags for executing Emacs in batch mode.
162# These work for Emacs versions 18-23, so don't change them. 162# These work for Emacs versions 18-24, so don't change them.
163EMACSFLAGS="-batch -q --no-site-file" 163EMACSFLAGS="-batch -q --no-site-file"
164 164
165# @ECLASS-VARIABLE: BYTECOMPFLAGS 165# @ECLASS-VARIABLE: BYTECOMPFLAGS
166# @DESCRIPTION: 166# @DESCRIPTION:
167# Emacs flags used for byte-compilation in elisp-compile(). 167# Emacs flags used for byte-compilation in elisp-compile().
171# @DESCRIPTION: 171# @DESCRIPTION:
172# Output version of currently active Emacs. 172# Output version of currently active Emacs.
173 173
174elisp-emacs-version() { 174elisp-emacs-version() {
175 local ret 175 local ret
176 # The following will work for at least versions 18-23. 176 # The following will work for at least versions 18-24.
177 echo "(princ emacs-version)" >"${T}"/emacs-version.el 177 echo "(princ emacs-version)" >"${T}"/emacs-version.el
178 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el 178 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el
179 ret=$? 179 ret=$?
180 rm -f "${T}"/emacs-version.el 180 rm -f "${T}"/emacs-version.el
181 if [[ ${ret} -ne 0 ]]; then 181 if [[ ${ret} -ne 0 ]]; then
193 193
194elisp-need-emacs() { 194elisp-need-emacs() {
195 local need_emacs=$1 have_emacs 195 local need_emacs=$1 have_emacs
196 have_emacs=$(elisp-emacs-version) || return 196 have_emacs=$(elisp-emacs-version) || return
197 einfo "Emacs version: ${have_emacs}" 197 einfo "Emacs version: ${have_emacs}"
198 if [[ ${have_emacs} =~ XEmacs|Lucid ]]; then
199 eerror "This package needs GNU Emacs."
200 return 1
201 fi
198 if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then 202 if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then
199 eerror "This package needs at least Emacs ${need_emacs%%.*}." 203 eerror "This package needs at least Emacs ${need_emacs%%.*}."
200 eerror "Use \"eselect emacs\" to select the active version." 204 eerror "Use \"eselect emacs\" to select the active version."
201 return 1 205 return 1
202 fi 206 fi

Legend:
Removed from v.1.79  
changed lines
  Added in v.1.80

  ViewVC Help
Powered by ViewVC 1.1.20