I'm not around right now, but you might be interested in the
system-emacs package I've had in experimental/bcully for a very long
time. It's attached to this mail.
I'll try to take a closer look at the differences between the two in
the next few days.
On Monday, 15 October 2007 at 12:10, David R. Morrison wrote:
> Dear Fink developers,
>
> Following a suggestion from Rohan Lloyd, I am working on a system-
> emacs package for fink, which would allow the use of fink-installed
> emacs extensions with /usr/bin/emacs .
>
> On Oct 15, 2007, at 1:06 AM, Rohan Lloyd wrote:
>
> > how is /usr/bin/emacs going to use fink installed emacs packages?
> > The proper way of handling emacs packages is that the package
> > installed .el files into
> >
> > /sw/share/emacs/site-lisp/<package>
> >
> > This directory is NOT in the emacs library path.
> >
> > And then when an emacs flavour is installed, emacsen-common calls
> > emacs-package-install which takes care of byte compiling for the
> > specific emacs flavour installed and placing .elc files in:
> >
> > /sw/share/<flavour>/site-lisp/<package>
> >
> > Each flavour of emacs loads /sw/share/<flavour>/site-lisp/
> > subdirs.el which automatically includes all subdirs in the load
> > path, so the byte compiled files are loaded.
> >
> > If no fink emacs package is installed, then there will be no byte
> > compiled files. The user could set up their emacs library path to
> > include /sw/share/emacs/site-lisp/<package> but they will not get
> > the benefit of byte compiled files, and anything else that the
> > package install script sets up.
> >
> > Would it be possible to create an emacs-system package that did
> > something like:
> >
> > * call emacsen-common/emacs-package-install in PostInstScript
> > * call emacsen-common/emacs-package-remove in PreRmScript
> > * install a shell script in /sw/bin/emacs that calls /usr/bin/
> > emacs with -L option set to use find fink installed packages eg:
> >
> > /usr/bin/emacs -L /sw/share/emacs-system/site-lisp $*
>
> My experimental version of the package for 10.4 is at http://
> fink.cvs.sourceforge.net/fink/experimental/dmrrsn/system-
> emacs-10.4.info?view=log .
>
> The problem I am having is this: in, for example, the emacs22
> package, we patch startup.el to make sure that certain fink-specific
> things are done at startup. Can anybody think of a way to do this
> with system-emacs, *without* modifying anything in /usr/share/emacs?
> Is there another command-line switch which might be of use?
>
> Feedback on any aspect of this project would be welcome.
>
> Best regards,
> Dave
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Fink-devel mailing list
> [email protected]
> http://news.gmane.org/gmane.os.apple.fink.devel
Package: system-emacs
Version: 21.2.1
Revision: 1
Source: none
Provides: emacsen
Depends: emacsen-common
CompileScript: <<
#!/bin/sh
CANARY="%p/etc/%n/site-start.d/00fink-vars.elc"
cat > system-emacs <<EOF
#!/bin/sh
if test -f "$CANARY" -a /usr/bin/emacs -nt "$CANARY"
then
cat <<TOONEW
/usr/bin/emacs appears to be newer than your %n package.
Please run "fink reinstall %n" to recompile any installed emacs packages
for the new version.
TOONEW
exit 1
fi
# To get our load file to precede .emacs, we add -q and then load the init file
# in startup. But we need to capture whether or not the user also requested -q.
declare -a args
pos=0
export SYSTEMEMACSUSER="\$USER"
while test \$# -gt 0
do
arg="\$1"
shift
if test x"\$arg" == x-q -o x"\$arg" == x--no-init-file
then
unset SYSTEMEMACSUSER
elif test x"\$arg" == x-u
then
SYSTEMEMACSUSER="\$1"
shift
else
args[\$pos]="\$arg"
pos=\$(expr \$pos + 1)
fi
done
exec /usr/bin/emacs -l "%p/etc/%n/startup" -q "[EMAIL PROTECTED]"
EOF
cat > startup.el <<EOF
(defun system-emacs-load-dirs (dir)
(add-to-list 'load-path dir)
(let ((cwd default-directory))
(cd dir)
(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
(normal-top-level-add-subdirs-to-load-path))
(cd cwd)))
(system-emacs-load-dirs "%p/share/emacs/site-lisp")
(system-emacs-load-dirs "%p/share/system-emacs/site-lisp")
(add-to-list 'load-path "%p/etc/emacs")
(add-to-list 'load-path "%p/etc/%n")
(defun system-emacs-startup ()
(if (load "fink-startup" t t)
(fink-startup 'system-emacs)))
(system-emacs-startup)
;; I don't know why I need to do this. Probably need more before fink-startup
(system-emacs-startup)
(if (getenv "SYSTEMEMACSUSER")
(load (concat "~" (getenv "SYSTEMEMACSUSER") "/.emacs") t t))
EOF
<<
InstallScript: <<
mkdir -p %i/bin
mkdir -p %i/etc/%n/site-start.d
mkdir -p %i/share/%n/site-lisp
mkdir -p %i/share/doc/%n
chmod +x system-emacs
cp system-emacs %i/bin
cp startup.el %i/etc/%n
ln -s ../fink/COPYING %i/share/doc/%n
<<
PostInstScript: <<
update-alternatives --install %p/bin/emacs emacs %p/bin/system-emacs 10
--slave %p/share/man/man1/emacs.1 emacs.1 /usr/share/man/man1/emacs.1
update-alternatives --install %p/bin/etags etags /usr/bin/etags 10 --slave
%p/share/man/man1/etags.1 etags.1 /usr/share/man/man1/etags.1
update-alternatives --install %p/bin/emacsclient emacsclient
/usr/bin/emacsclient 10
%p/lib/emacsen-common/emacs-install %n
# ** The function `fink-startup' is not known to be defined.
# /usr/bin/emacs -batch -f batch-byte-compile "%p/etc/%n/startup.el"
<<
PreRmScript: <<
if [ "$1" != upgrade ]
then
update-alternatives --remove emacs %p/bin/system-emacs
update-alternatives --remove etags /usr/bin/etags
update-alternatives --remove emacsclient /usr/bin/emacsclient
fi
%p/lib/emacsen-common/emacs-remove %n
<<
Description: Fink support for system-installed emacs
DescDetail: <<
This package allows you to use fink emacs packages with the version
of emacs bundled with your system.
<<
License: GPL
Homepage: http://fink.sourceforge.net/
Maintainer: Brendan Cully <[EMAIL PROTECTED]>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Fink-devel mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.devel