/[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.69 Revision 1.70
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.69 2010/11/23 20:56:08 ulm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.70 2010/11/29 17:07:22 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 <fauli@gentoo.org> 8# Copyright 2007-2008 Christian Faulhammer <fauli@gentoo.org>
163 163
164# @ECLASS-VARIABLE: BYTECOMPFLAGS 164# @ECLASS-VARIABLE: BYTECOMPFLAGS
165# @DESCRIPTION: 165# @DESCRIPTION:
166# Emacs flags used for byte-compilation in elisp-compile(). 166# Emacs flags used for byte-compilation in elisp-compile().
167BYTECOMPFLAGS="-L ." 167BYTECOMPFLAGS="-L ."
168
169# @FUNCTION: elisp-compile
170# @USAGE: <list of elisp files>
171# @DESCRIPTION:
172# Byte-compile Emacs Lisp files.
173#
174# This function uses GNU Emacs to byte-compile all ".el" specified by
175# its arguments. The resulting byte-code (".elc") files are placed in
176# the same directory as their corresponding source file.
177#
178# The current directory is added to the load-path. This will ensure
179# that interdependent Emacs Lisp files are visible between themselves,
180# in case they require or load one another.
181
182elisp-compile() {
183 ebegin "Compiling GNU Emacs Elisp files"
184 ${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@"
185 eend $? "elisp-compile: batch-byte-compile failed"
186}
187 168
188# @FUNCTION: elisp-emacs-version 169# @FUNCTION: elisp-emacs-version
189# @DESCRIPTION: 170# @DESCRIPTION:
190# Output version of currently active Emacs. 171# Output version of currently active Emacs.
191 172
211 eerror "This package needs at least Emacs ${need_emacs%%.*}." 192 eerror "This package needs at least Emacs ${need_emacs%%.*}."
212 eerror "Use \"eselect emacs\" to select the active version." 193 eerror "Use \"eselect emacs\" to select the active version."
213 return 1 194 return 1
214 fi 195 fi
215 return 0 196 return 0
197}
198
199# @FUNCTION: elisp-compile
200# @USAGE: <list of elisp files>
201# @DESCRIPTION:
202# Byte-compile Emacs Lisp files.
203#
204# This function uses GNU Emacs to byte-compile all ".el" specified by
205# its arguments. The resulting byte-code (".elc") files are placed in
206# the same directory as their corresponding source file.
207#
208# The current directory is added to the load-path. This will ensure
209# that interdependent Emacs Lisp files are visible between themselves,
210# in case they require or load one another.
211
212elisp-compile() {
213 ebegin "Compiling GNU Emacs Elisp files"
214 ${EMACS} ${EMACSFLAGS} ${BYTECOMPFLAGS} -f batch-byte-compile "$@"
215 eend $? "elisp-compile: batch-byte-compile failed"
216} 216}
217 217
218# @FUNCTION: elisp-make-autoload-file 218# @FUNCTION: elisp-make-autoload-file
219# @USAGE: [output file] [list of directories] 219# @USAGE: [output file] [list of directories]
220# @DESCRIPTION: 220# @DESCRIPTION:
351 EOF 351 EOF
352 # Use sed instead of cat here, since files may miss a trailing newline. 352 # Use sed instead of cat here, since files may miss a trailing newline.
353 sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el 353 sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el
354 cat <<-EOF >>"${T}"/site-gentoo.el 354 cat <<-EOF >>"${T}"/site-gentoo.el
355 355
356 ${page}
356 (provide 'site-gentoo) 357 (provide 'site-gentoo)
357 358
358 ${page}
359 ;; Local ${null}Variables: 359 ;; Local ${null}Variables:
360 ;; no-byte-compile: t 360 ;; no-byte-compile: t
361 ;; buffer-read-only: t 361 ;; buffer-read-only: t
362 ;; End: 362 ;; End:
363 363

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.70

  ViewVC Help
Powered by ViewVC 1.1.20