diff options
-rw-r--r-- | eclass/elisp-common.eclass | 54 | ||||
-rw-r--r-- | eclass/elisp.eclass | 5 |
2 files changed, 45 insertions, 14 deletions
diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 2337323758b6..6b1ac917ec56 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.28 2007/09/22 20:25:30 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.29 2007/10/14 22:12:30 ulm Exp $ # # Copyright 2007 Christian Faulhammer <opfer@gentoo.org> # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> @@ -10,7 +10,7 @@ # # @ECLASS: elisp-common.eclass # @MAINTAINER: -# Feel free to contact the Emacs team through emacs@gentoo.org if you have +# Feel free to contact the Emacs team through <emacs@gentoo.org> if you have # problems, suggestions or questions. # @BLURB: Emacs-related installation utilities # @DESCRIPTION: @@ -73,10 +73,10 @@ # (autoload 'csv-mode "csv-mode" "Major mode for csv files." t) # # If your Emacs support files are installed in a subdirectory of -# /usr/share/emacs/site-lisp/ (which is recommended if more than one file is -# installed), you need to extend Emacs' load-path as shown in the first -# non-comment. The elisp-site-file-install() function of this eclass will -# replace "@SITELISP@" by the actual path. +# /usr/share/emacs/site-lisp/ (which is recommended), you need to extend +# Emacs' load-path as shown in the first non-comment. +# The elisp-site-file-install() function of this eclass will replace +# "@SITELISP@" by the actual path. # # The next line tells Emacs to load the mode opening a file ending with # ".csv" and load functions depending on the context and needed features. @@ -97,7 +97,7 @@ # # Which is then installed by # -# elisp-site-file-install "${FILESDIR}/${SITEFILE}" +# elisp-site-file-install "${FILESDIR}/${SITEFILE}" || die # # in src_install(). If your subdirectory is not named ${PN}, give the # differing name as second argument. @@ -127,10 +127,18 @@ # # elisp-emacs-version() outputs the version of the currently active Emacs. +# @ECLASS-VARIABLE: SITELISP +# @DESCRIPTION: +# Directory where Emacs Lisp files are installed. SITELISP=/usr/share/emacs/site-lisp + +# @ECLASS-VARIABLE: SITEFILE +# @DESCRIPTION: +# Name of package's site-init file. SITEFILE=50${PN}-gentoo.el + EMACS=/usr/bin/emacs -# The following works for Emacs versions 18-23, don't change it. +# The following works for Emacs versions 18--23, don't change it. EMACS_BATCH_CLEAN="${EMACS} -batch -q --no-site-file" # @FUNCTION: elisp-compile @@ -158,7 +166,7 @@ elisp-emacs-version() { # @DESCRIPTION: # Generate a file with autoload definitions for the lisp functions. -elisp-make-autoload-file () { +elisp-make-autoload-file() { local f="${1:-${PN}-autoloads.el}" shift einfo "Generating autoload file for GNU Emacs ..." @@ -224,6 +232,25 @@ elisp-site-file-install() { elisp-site-regen() { local sflist sf line + if [ ! -e "${ROOT}${SITELISP}"/site-gentoo.el ] \ + && [ ! -e "${ROOT}${SITELISP}"/site-start.el ]; then + einfo "Creating default ${SITELISP}/site-start.el ..." + cat <<-EOF >"${T}"/site-start.el + ;;; site-start.el + + ;;; Commentary: + ;; This default site startup file is installed by elisp-common.eclass. + ;; You may replace this file by your own site initialisation, or even + ;; remove it completely; it will not be recreated. + + ;;; Code: + ;; Load site initialisation for Gentoo-installed packages. + (require 'site-gentoo) + + ;;; site-start.el ends here + EOF + fi + einfon "Regenerating ${SITELISP}/site-gentoo.el ..." cat <<-EOF >"${T}"/site-gentoo.el ;;; site-gentoo.el --- site initialisation for Gentoo-installed packages @@ -254,11 +281,14 @@ elisp-site-regen() { if cmp -s "${ROOT}${SITELISP}"/site-gentoo.el "${T}"/site-gentoo.el; then # This prevents outputting unnecessary text when there - # was actually no change - # A case is a remerge where we have doubled output + # was actually no change. + # A case is a remerge where we have doubled output. echo " no changes." else mv "${T}"/site-gentoo.el "${ROOT}${SITELISP}"/site-gentoo.el + [ -f "${T}"/site-start.el ] \ + && [ ! -e "${ROOT}${SITELISP}"/site-start.el ] \ + && mv "${T}"/site-start.el "${ROOT}${SITELISP}"/site-start.el echo; einfo for sf in ${sflist}; do einfo " Adding ${sf} ..." @@ -273,7 +303,7 @@ site-start.el if there is such a file. In order for this site initialisation to be loaded for all users automatically, you can add a line like this: - (load "/usr/share/emacs/site-lisp/site-gentoo" nil t) + (require 'site-gentoo) to /usr/share/emacs/site-lisp/site-start.el. Alternatively, that line can be added by individual users to their initialisation files, or for diff --git a/eclass/elisp.eclass b/eclass/elisp.eclass index ba9a7df6146b..ad93979775a7 100644 --- a/eclass/elisp.eclass +++ b/eclass/elisp.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.23 2007/09/22 20:25:30 ulm Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/elisp.eclass,v 1.24 2007/10/14 22:12:30 ulm Exp $ # # Copyright 2007 Christian Faulhammer <opfer@gentoo.org> # Copyright 2002-2003 Matthew Kennedy <mkennedy@gentoo.org> @@ -9,7 +9,8 @@ # # @ECLASS: elisp.eclass # @MAINTAINER: -# emacs@gentoo.org +# Feel free to contact the Emacs team through <emacs@gentoo.org> if you +# have problems, suggestions or questions. # @BLURB: Eclass for Emacs Lisp packages # @DESCRIPTION: # |