How do you get your newly built Emacs from CVS and Debian to work well together?
- You need to make a fake package. apt-get install equivs, and then create a file named "control" containing:
Package: emacscvs Section: editors Priority: standard Architecture: any Depends: emacsen-common (>= 1.4.10) Provides: emacsen, info-browser, mail-reader, news-reader, emacs21 Priority: standard Description: Fake package of the GNU Emacs editor. GNU Emacs is the extensible self-documenting text editor. This is the equivs package for fake Emacs CVS.(I added a Provides: emacs21 for packages that explicitely check for emacs21.)
dpkg -i emacscvs*.deb
- (Optional) Edit your /usr/src/emacs/startup.el and apply this diff.
--- startup.el 5 Sep 2002 00:19:49 -0000 1.306 +++ startup.el 8 Sep 2002 08:28:57 -0000 @@ -356,6 +356,10 @@ (defvar normal-top-level-add-subdirs-inode-list nil) +(defconst debian-emacs-flavor 'emacscvs + "A symbol representing the particular debian flavor of emacs running. + Something like 'emacs20, 'xemacs20, etc.") + (defun normal-top-level-add-subdirs-to-load-path () "Add all subdirectories of current directory to `load-path'. More precisely, this uses only the subdirectories whose names @@ -872,8 +876,15 @@ ;; Run the site-start library if it exists. The point of this file is ;; that it is run before .emacs. There is no point in doing this after ;; .emacs; that is useless. - (if site-run-file - (load site-run-file t t)) + ;; Debian version of site-start. + (if site-run-file + (progn + ;; Load all the debian package snippets. + ;; It's in here because we want -q to kill it too. + (if (load "debian-startup" t t nil) + (debian-startup debian-emacs-flavor)) + ;; Now the normal site file... + (load site-run-file t t nil))) ;; Sites should not disable this. Only individuals should disable ;; the startup message.
- Rebuild and reinstall your Emacs CVS.
- Symlink /usr/bin/emacscvs to your Emacs binary (usually /usr/local/bin/emacs)
- Symlink /usr/share/emacscvs to your Emacs directory (/usr/local/share/emacs/21.3.50 or something like that)
echo emacscvs >> /var/lib/emacsen-common/installed-flavors
- mkdir -p /etc/emacscvs/site-start.d
/usr/lib/emacsen-common/emacs-install emacscvs- that byte-compiles all your installed Debian packages. You may have to edit some scripts in /usr/lib/emacsen-common/packages/install if the scripts do explicit flavor checks.
You can safely remove your old Emacs version now. Any new Debian Emacs packages you install should automatically get bytecompiled for Emacs CVS unless it makes an explicit check against emacs21. If you find this bothersome, you may want to change the flavor to emacs21 instead - just make sure you hold the package.
This is just GREATTTTTTTTTTT! I was trying to find an emacs-cvs version debianized for so long :) Now I can make my own one. -- XavierMaillard (zeDek)
Or... Use equivs to make a fake emacs21 package. Make a control file with:
Package: emacs21 Section: editors Version: 21.3 Priority: standard Architecture: any Depends: emacsen-common (>= 1.4.10) Provides: emacsen, info-browser, mail-reader, news-reader, emacs21 Priority: standard Description: Fake package of the GNU Emacs editor. GNU Emacs is the extensible self-documenting text editor. This is the equivs package for fake Emacs 21.3.Set the version number to the right one, though.
- Symlink your installed Emacs directory tree to /usr/share/emacs21. For example:
ln /usr/local/share/emacs/21.3.50 /usr/share/emacs21 -s
- Symlink your installed Emacs binary to /usr/bin/emacs21. For example:
ln /usr/local/bin/emacs /usr/sbin/emacs21 -s
equivs-build control dpkg -i emacs21_21.3_*.deb echo emacs21 >> /var/lib/emacsen-common/installed-flavors mkdir -p /etc/emacs21/site-start.d /usr/lib/emacsen-common/emacs-install emacs21Downside is that the two packages can't coexist. MarioLang says that this is a bad idea, though.
Why ? I personally want to use latest version of both Emacs and Gnus so I need to update everyday or so. AFAIK, there is no Emacs CVS package in Debian (even in Sid) and I don't want to use the one provided with Debian but still want to install 3rd party paquages in Debian. IMHO I don't have the choice. -- XavierMaillard
Another idea: just put this in your .emacs.el (it works for me):
(let ((startup-file "/usr/share/emacs21/site-lisp/debian-startup.elc")) (if (and (or (not (fboundp 'debian-startup)) (not (boundp 'debian-emacs-flavor))) (file-readable-p startup-file)) (progn (load-file startup-file) (setq debian-emacs-flavor 'emacs21) (debian-startup debian-emacs-flavor))))
- That is a possibility, but if you use this all the debian-installed packages will be loaded as source (i.e. not byte-compiled) and it's a major slowdown with huge packages such as Gnus, Calc, or BBDB.
== Emacs From Source Without Debian Stuff ==
If you don't want to depend on emacsen-common and all that, try the following:
To create the fake package, apt-get install equivs, and create a file named "control" as follows:
Package: emacs-src Section: editors Priority: standard Architecture: any Provides: emacsen, info-browser, mail-reader, news-reader, emacs21 Priority: standard Description: Fake package of the GNU Emacs editor. GNU Emacs is the extensible self-documenting text editor. This is the equivs package for a fake Emacs for those people that build Emacs from source locally.This provides emacs21 for packages that explicitely check for emacs21, and it does not provide www-browser because w3 is not part of Emacs.
dpkg -i emacs-src*.deb
Done! Now you can apt-get install emacspeak without having to install emacs20 and emacsen-common.
I'd love to hear about any questions, comments, suggestions or links that you might have. Your comments will not be posted on this website immediately, but will be e-mailed to me first. You can use this form to get in touch with me, or e-mail me at [email protected] .