/[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.84 Revision 1.85
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.84 2013/03/16 08:55:30 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.85 2013/08/02 16:48:18 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:
171# @RETURN: exit status of Emacs 171# @RETURN: exit status of Emacs
172# @DESCRIPTION: 172# @DESCRIPTION:
173# Output version of currently active Emacs. 173# Output version of currently active Emacs.
174 174
175elisp-emacs-version() { 175elisp-emacs-version() {
176 local ret 176 local version ret
177 # The following will work for at least versions 18-24. 177 # The following will work for at least versions 18-24.
178 echo "(princ emacs-version)" >"${T}"/emacs-version.el 178 echo "(princ emacs-version)" >"${T}"/emacs-version.el
179 version=$(
180 # EMACS could be a microemacs variant that ignores the -batch
181 # option and would therefore hang, waiting for user interaction.
182 # Redirecting stdin and unsetting TERM and DISPLAY will cause
183 # most of them to exit with an error.
184 unset TERM DISPLAY
179 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el 185 ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el </dev/null
186 )
180 ret=$? 187 ret=$?
181 rm -f "${T}"/emacs-version.el 188 rm -f "${T}"/emacs-version.el
182 if [[ ${ret} -ne 0 ]]; then 189 if [[ ${ret} -ne 0 ]]; then
183 eerror "elisp-emacs-version: Failed to run ${EMACS}" 190 eerror "elisp-emacs-version: Failed to run ${EMACS}"
184 fi
185 return ${ret} 191 return ${ret}
192 fi
193 if [[ -z ${version} ]]; then
194 eerror "elisp-emacs-version: Could not determine Emacs version"
195 return 1
196 fi
197 echo "${version}"
186} 198}
187 199
188# @FUNCTION: elisp-need-emacs 200# @FUNCTION: elisp-need-emacs
189# @USAGE: <version> 201# @USAGE: <version>
190# @RETURN: 0 if true, 1 if false, 2 if trouble 202# @RETURN: 0 if true, 1 if false, 2 if trouble

Legend:
Removed from v.1.84  
changed lines
  Added in v.1.85

  ViewVC Help
Powered by ViewVC 1.1.20