| 1 | # Copyright 1999-2008 Gentoo Foundation |
1 | # Copyright 1999-2008 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.37 2008/03/07 08:19:19 ulm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.38 2008/04/04 18:11:28 ulm Exp $ |
| 4 | # |
4 | # |
| 5 | # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> |
5 | # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> |
| 6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
6 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
| 7 | # Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> |
7 | # Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> |
| 8 | # Copyright 2007-2008 Christian Faulhammer <opfer@gentoo.org> |
8 | # Copyright 2007-2008 Christian Faulhammer <opfer@gentoo.org> |
| … | |
… | |
| 139 | # @DESCRIPTION: |
139 | # @DESCRIPTION: |
| 140 | # Name of package's site-init file. |
140 | # Name of package's site-init file. |
| 141 | SITEFILE=50${PN}-gentoo.el |
141 | SITEFILE=50${PN}-gentoo.el |
| 142 | |
142 | |
| 143 | EMACS=/usr/bin/emacs |
143 | EMACS=/usr/bin/emacs |
| 144 | # The following works for Emacs versions 18--23, don't change it. |
144 | # The following works for Emacs versions 18-23, don't change it. |
| 145 | EMACSFLAGS="-batch -q --no-site-file" |
145 | EMACSFLAGS="-batch -q --no-site-file" |
| 146 | |
146 | |
| 147 | # @FUNCTION: elisp-compile |
147 | # @FUNCTION: elisp-compile |
| 148 | # @USAGE: <list of elisp files> |
148 | # @USAGE: <list of elisp files> |
| 149 | # @DESCRIPTION: |
149 | # @DESCRIPTION: |
| … | |
… | |
| 198 | # @FUNCTION: elisp-emacs-version |
198 | # @FUNCTION: elisp-emacs-version |
| 199 | # @DESCRIPTION: |
199 | # @DESCRIPTION: |
| 200 | # Output version of currently active Emacs. |
200 | # Output version of currently active Emacs. |
| 201 | |
201 | |
| 202 | elisp-emacs-version() { |
202 | elisp-emacs-version() { |
| 203 | # The following will work for at least versions 18--23. |
203 | # The following will work for at least versions 18-23. |
| 204 | echo "(princ emacs-version)" >"${T}"/emacs-version.el |
204 | echo "(princ emacs-version)" >"${T}"/emacs-version.el |
| 205 | ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el |
205 | ${EMACS} ${EMACSFLAGS} -l "${T}"/emacs-version.el |
| 206 | rm -f "${T}"/emacs-version.el |
206 | rm -f "${T}"/emacs-version.el |
| 207 | } |
207 | } |
| 208 | |
208 | |
| … | |
… | |
| 286 | # when generating the start-up file. |
286 | # when generating the start-up file. |
| 287 | |
287 | |
| 288 | elisp-site-regen() { |
288 | elisp-site-regen() { |
| 289 | local i sf line obsolete |
289 | local i sf line obsolete |
| 290 | local -a sflist |
290 | local -a sflist |
|
|
291 | # Work around Paludis borkage: variable T is empty in pkg_postrm |
| 291 | local tmpdir=${T:-/tmp} |
292 | local tmpdir=${T:-/tmp} |
|
|
293 | |
|
|
294 | if [ ! -d "${ROOT}${SITELISP}" ]; then |
|
|
295 | eerror "Directory ${SITELISP} does not exist" |
|
|
296 | return 1 |
|
|
297 | fi |
| 292 | |
298 | |
| 293 | if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ |
299 | if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ |
| 294 | && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then |
300 | && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then |
| 295 | einfo "Creating default ${SITELISP}/site-start.el ..." |
301 | einfo "Creating default ${SITELISP}/site-start.el ..." |
| 296 | cat <<-EOF >"${tmpdir}"/site-start.el |
302 | cat <<-EOF >"${tmpdir}"/site-start.el |