| 1 | # Copyright 1999-2007 Gentoo Foundation |
1 | # Copyright 1999-2007 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.25 2007/07/25 04:46:01 ulm Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/elisp-common.eclass,v 1.26 2007/07/25 05:07:32 ulm Exp $ |
| 4 | # |
4 | # |
| 5 | # Copyright 2007 Christian Faulhammer <opfer@gentoo.org> |
5 | # Copyright 2007 Christian Faulhammer <opfer@gentoo.org> |
| 6 | # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> |
6 | # Copyright 2002-2004 Matthew Kennedy <mkennedy@gentoo.org> |
| 7 | # Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> |
7 | # Copyright 2004-2005 Mamoru Komachi <usata@gentoo.org> |
| 8 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
8 | # Copyright 2003 Jeremy Maitin-Shepard <jbms@attbi.com> |
| … | |
… | |
| 22 | # package (especially compilation), so this is mainly for standalone elisp |
22 | # package (especially compilation), so this is mainly for standalone elisp |
| 23 | # files you gathered from somewhere else. |
23 | # files you gathered from somewhere else. |
| 24 | # |
24 | # |
| 25 | # When relying on the emacs USE flag, you need to add |
25 | # When relying on the emacs USE flag, you need to add |
| 26 | # |
26 | # |
| 27 | # emacs? ( virtual/emacs ) |
27 | # emacs? ( virtual/emacs ) |
| 28 | # |
28 | # |
| 29 | # to your DEPEND/RDEPEND line and use the functions provided here to bring |
29 | # to your DEPEND/RDEPEND line and use the functions provided here to bring |
| 30 | # the files to the correct locations. |
30 | # the files to the correct locations. |
| 31 | # |
31 | # |
| 32 | # .SS |
32 | # .SS |
| 33 | # src_compile() usage: |
33 | # src_compile() usage: |
| 34 | # |
34 | # |
| 35 | # An elisp file is compiled by the elisp-compile() function defined here and |
35 | # An elisp file is compiled by the elisp-compile() function defined here and |
| 36 | # simply takes the source files as arguments. |
36 | # simply takes the source files as arguments. |
| 37 | # |
37 | # |
| 38 | # elisp-compile *.el || die "elisp-compile failed" |
38 | # elisp-compile *.el || die "elisp-compile failed" |
| 39 | # |
39 | # |
| 40 | # In the case of interdependent elisp files, you can use the elisp-comp() |
40 | # In the case of interdependent elisp files, you can use the elisp-comp() |
| 41 | # function which makes sure all files are loadable. |
41 | # function which makes sure all files are loadable. |
| 42 | # |
42 | # |
| 43 | # elisp-comp *.el || die "elisp-comp failed" |
43 | # elisp-comp *.el || die "elisp-comp failed" |
| 44 | # |
44 | # |
| 45 | # Function elisp-make-autoload-file() can be used to generate a file with |
45 | # Function elisp-make-autoload-file() can be used to generate a file with |
| 46 | # autoload definitions for the lisp functions. It takes the output file name |
46 | # autoload definitions for the lisp functions. It takes the output file name |
| 47 | # (default: "${PN}-autoloads.el") and a list of directories (default: working |
47 | # (default: "${PN}-autoloads.el") and a list of directories (default: working |
| 48 | # directory) as its arguments. Use of this function requires that the elisp |
48 | # directory) as its arguments. Use of this function requires that the elisp |
| … | |
… | |
| 57 | # of elisp-install(). The following parameters are the files to be put in |
57 | # of elisp-install(). The following parameters are the files to be put in |
| 58 | # that directory. Usually the subdirectory should be ${PN}, you can choose |
58 | # that directory. Usually the subdirectory should be ${PN}, you can choose |
| 59 | # something else, but remember to tell elisp-site-file-install() (see below) |
59 | # something else, but remember to tell elisp-site-file-install() (see below) |
| 60 | # the change, as it defaults to ${PN}. |
60 | # the change, as it defaults to ${PN}. |
| 61 | # |
61 | # |
| 62 | # elisp-install ${PN} *.el *.elc || die "elisp-install failed" |
62 | # elisp-install ${PN} *.el *.elc || die "elisp-install failed" |
| 63 | # |
63 | # |
| 64 | # To let the Emacs support be activated by Emacs on startup, you need |
64 | # To let the Emacs support be activated by Emacs on startup, you need |
| 65 | # to provide a site file (shipped in ${FILESDIR}) which contains the startup |
65 | # to provide a site file (shipped in ${FILESDIR}) which contains the startup |
| 66 | # code (have a look in the documentation of your software). Normally this |
66 | # code (have a look in the documentation of your software). Normally this |
| 67 | # would look like this: |
67 | # would look like this: |
| 68 | # |
68 | # |
| 69 | # .nf |
|
|
| 70 | # ;;; csv-mode site-lisp configuration |
69 | # ;;; csv-mode site-lisp configuration |
| 71 | # |
70 | # |
| 72 | # (add-to-list 'load-path "@SITELISP@") |
71 | # (add-to-list 'load-path "@SITELISP@") |
| 73 | # (add-to-list 'auto-mode-alist '("\\.csv\\'" . csv-mode)) |
72 | # (add-to-list 'auto-mode-alist '("\\.csv\\'" . csv-mode)) |
| 74 | # (autoload 'csv-mode "csv-mode" "Major mode for csv files." t) |
73 | # (autoload 'csv-mode "csv-mode" "Major mode for csv files." t) |
| 75 | # .fi |
|
|
| 76 | # |
74 | # |
| 77 | # If your Emacs support files are installed in a subdirectory of |
75 | # If your Emacs support files are installed in a subdirectory of |
| 78 | # /usr/share/emacs/site-lisp/ (which is recommended if more than one file is |
76 | # /usr/share/emacs/site-lisp/ (which is recommended if more than one file is |
| 79 | # installed), you need to extend Emacs' load-path as shown in the first |
77 | # installed), you need to extend Emacs' load-path as shown in the first |
| 80 | # non-comment. The elisp-site-file-install() function of this eclass will |
78 | # non-comment. The elisp-site-file-install() function of this eclass will |
| … | |
… | |
| 93 | # another Emacs package, your site file's number must be higher! |
91 | # another Emacs package, your site file's number must be higher! |
| 94 | # |
92 | # |
| 95 | # Best practice is to define a SITEFILE variable in the global scope of your |
93 | # Best practice is to define a SITEFILE variable in the global scope of your |
| 96 | # ebuild (right after DEPEND e.g.): |
94 | # ebuild (right after DEPEND e.g.): |
| 97 | # |
95 | # |
| 98 | # SITEFILE=50${PN}-gentoo.el |
96 | # SITEFILE=50${PN}-gentoo.el |
| 99 | # |
97 | # |
| 100 | # Which is then installed by |
98 | # Which is then installed by |
| 101 | # |
99 | # |
| 102 | # elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
100 | # elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
| 103 | # |
101 | # |
| 104 | # in src_install(). If your subdirectory is not named ${PN}, give the |
102 | # in src_install(). If your subdirectory is not named ${PN}, give the |
| 105 | # differing name as second argument. |
103 | # differing name as second argument. |
| 106 | # |
104 | # |
| 107 | # .SS |
105 | # .SS |
| 108 | # pkg_postinst() / pkg_postrm() usage: |
106 | # pkg_postinst() / pkg_postrm() usage: |
| 109 | # |
107 | # |
| 110 | # After that you need to recreate the start-up file of Emacs after emerging |
108 | # After that you need to recreate the start-up file of Emacs after emerging |
| 111 | # and unmerging by using |
109 | # and unmerging by using |
| 112 | # |
110 | # |
| 113 | # .nf |
|
|
| 114 | # pkg_postinst() { |
111 | # pkg_postinst() { |
| 115 | # elisp-site-regen |
112 | # elisp-site-regen |
| 116 | # } |
113 | # } |
| 117 | # |
114 | # |
| 118 | # pkg_postrm() { |
115 | # pkg_postrm() { |
| 119 | # elisp-site-regen |
116 | # elisp-site-regen |
| 120 | # } |
117 | # } |
| 121 | # .fi |
|
|
| 122 | # |
118 | # |
| 123 | # When having optional Emacs support, you should prepend "use emacs &&" to |
119 | # When having optional Emacs support, you should prepend "use emacs &&" to |
| 124 | # above calls of elisp-site-regen(). Don't use "has_version virtual/emacs"! |
120 | # above calls of elisp-site-regen(). Don't use "has_version virtual/emacs"! |
| 125 | # When unmerging the state of the emacs USE flag is taken from the package |
121 | # When unmerging the state of the emacs USE flag is taken from the package |
| 126 | # database and not from the environment, so it is no problem when you unset |
122 | # database and not from the environment, so it is no problem when you unset |