diff options
author | Ulrich Müller <ulm@gentoo.org> | 2009-03-26 10:46:14 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2009-03-26 10:46:14 +0000 |
commit | 094606f75af5c3bd8edea3a82850094faeffcd35 (patch) | |
tree | 7c426d4c93faa03e427ea4d06ed0d3cc98a52991 /eclass | |
parent | Don't hardcode path of jars. (diff) | |
download | emacs-094606f75af5c3bd8edea3a82850094faeffcd35.tar.gz emacs-094606f75af5c3bd8edea3a82850094faeffcd35.tar.bz2 emacs-094606f75af5c3bd8edea3a82850094faeffcd35.zip |
Automagically insert header comment in elisp-site-file-install.
svn path=/emacs-overlay/; revision=1351
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 6 | ||||
-rw-r--r-- | eclass/elisp-common.eclass | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 9b3a9ff..4d5d6af 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,3 +1,9 @@ +2009-03-26 Ulrich Mueller <ulm@gentoo.org> + + * elisp-common.eclass (elisp-site-file-install): Automagically + insert an empty first line and a header comment if they are + missing from the file. + 2009-03-22 Ulrich Mueller <ulm@gentoo.org> * elisp-common.eclass (elisp-comp): Die. diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 86a0a2d..3925672 100644 --- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -72,8 +72,8 @@ # (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), you need to extend -# Emacs' load-path as shown in the first non-comment. +# /usr/share/emacs/site-lisp/ (which is strongly recommended), you need +# to extend Emacs' load-path as shown in the first non-comment line. # The elisp-site-file-install() function of this eclass will replace # "@SITELISP@" and "@SITEETC@" by the actual paths. # @@ -250,12 +250,15 @@ elisp-install() { elisp-site-file-install() { local sf="${1##*/}" my_pn="${2:-${PN}}" ret + local header=";;; ${PN} site-lisp configuration" + [[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \ || ewarn "elisp-site-file-install: bad name of site-init file" sf="${T}/${sf/%-gentoo*.el/-gentoo.el}" ebegin "Installing site initialisation file for GNU Emacs" cp "$1" "${sf}" - sed -i -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \ + sed -i -e "1{:x;/^\$/{n;bx;};/^;.*${PN}/!s:^:${header}\n\n:;1s:^:\n:;}" \ + -e "s:@SITELISP@:${SITELISP}/${my_pn}:g" \ -e "s:@SITEETC@:${SITEETC}/${my_pn}:g;\$q" "${sf}" ( # subshell to avoid pollution of calling environment insinto "${SITELISP}/site-gentoo.d" |