From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Olson Newsgroups: gmane.emacs.devel,gmane.linux.debian.devel.emacsen Subject: Re: Debian's idiosyncratic complexification of Emacs Date: Tue, 22 Jul 2008 22:13:11 -0700 Message-ID: <87wsjdw5co.fsf@grepfind.mwolson.org> References: <4eb0089f0807111345h13eccdds9b2cf43370b94074@mail.gmail.com> <4eb0089f0807121340x5e26f6dbve03ef50b238f3a3a@mail.gmail.com> <87k5fph5rh.fsf@stupidchicken.com> <20080713214648.GB1076@muc.de> <487A783B.7060603@gmail.com> <20080713232635.GD1076@muc.de> <85od51id2t.fsf@lola.goethe.zz> <20080714204242.GH6711@volo.donarmstrong.com> <20080714223059.GG3445@muc.de> <20080715013845.GX3675@rzlab.ucr.edu> <877ibl8vjs.fsf@red-bean.com> <87lk01ij7f.fsf@anzu.internal.golden-gryphon.com> <87ljzvormp.fsf@red-bean.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1216793322 21777 80.91.229.12 (23 Jul 2008 06:08:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jul 2008 06:08:42 +0000 (UTC) Cc: debian-emacsen@lists.debian.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 23 08:09:30 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KLXXU-0003s5-PY for ged-emacs-devel@m.gmane.org; Wed, 23 Jul 2008 08:09:29 +0200 Original-Received: from localhost ([127.0.0.1]:52041 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLXWb-00029j-5D for ged-emacs-devel@m.gmane.org; Wed, 23 Jul 2008 02:08:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KLXWV-00028S-P1 for emacs-devel@gnu.org; Wed, 23 Jul 2008 02:08:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KLXWT-00026p-IV for emacs-devel@gnu.org; Wed, 23 Jul 2008 02:08:26 -0400 Original-Received: from [199.232.76.173] (port=38898 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KLXWT-00026m-FR for emacs-devel@gnu.org; Wed, 23 Jul 2008 02:08:25 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:60338 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KLXWS-00022b-Qi for emacs-devel@gnu.org; Wed, 23 Jul 2008 02:08:25 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KLXWJ-0004xN-Li for emacs-devel@gnu.org; Wed, 23 Jul 2008 06:08:15 +0000 Original-Received: from cpe-75-84-159-101.socal.res.rr.com ([75.84.159.101]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Jul 2008 06:08:15 +0000 Original-Received: from mwolson by cpe-75-84-159-101.socal.res.rr.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 23 Jul 2008 06:08:15 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 207 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpe-75-84-159-101.socal.res.rr.com Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEU1QytIVTlZY0dqc1N6 hGGJl3qZpZCtuKXsjxzFAAACW0lEQVR42l2UXXrqIBCGk67Aoe29Ac4CTPDcGwZ73wLdQDOuQLP9 8wHG9hT1Mc6bb/5jp7Xed92TVrqeCYfKRVc+XdfDbqbJ8TixG1UDu2a3xkf2H+z+A6Q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3KJB0ZUXMm5FSjp+y 1TEVPtPVggQZh5JqgALXzVRmkL1bwQnKMBTbaeyKtsef9k5R/undBnEeXDENkMFRAZ3eIuLF9dMr xPmmBsuALhCY3YSvIJu184DDhEwQf60KzyCHA5mtyvLrHZBSPiWgSvUl56mbrKCZbzO4UO/twwJU kcHfVXGkoQvOXflGbwt1E8GBtgnCAnjyegGqhCqXILIqSlC/EceJuwAjTAJeAf0fVRaArRdACiF6 zvfsFNcXuD9WwNDj3J9jDb0AQb8er2PXjwPSotS3GrTPABu8jBQD8gIlK+qPnn8sgIZ+s0og4JXB GY3ZtklxUNCBDEkR0Mj9/JyAKMh4BfCI1wRossbs8dJRhDm6RuB3DJLC4ZUBbxYp5B7touCZhDf+ DMCR7i/WbNbphjaCk322wbriJYE3EN8j+AdHTQpcw5C5IgAAAABJRU5ErkJggg== User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:hiSgdj2pcKsYXESizM+xLDLeMkU= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:101282 gmane.linux.debian.devel.emacsen:2460 Archived-At: --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --==-=-= Miles Bader writes: > Incidentally, while on the issue of debian emacs startup, I have the > following snippet in my .emacs file for hooking my non-debian emacs > into the debian emacs package system: > > ;; Debian stuff > (unless (boundp 'debian-emacs-flavor) > (load "/usr/share/emacs/site-lisp/debian-startup") > (debian-startup 'emacs22) > (debian-startup 'emacs22)) > > ["emacs22" because there is no emacs23 in debian yet] Here's my setup. The first attachment is a script to run in the emacs source directory as root after doing "./configure ; make". It depends on a fake emacs-snapshot package built using equivs. The second attachment is an init file that handles all the Debian stuff, including a rewrite of `debian-run-directories' to make its modifications to load-path less intrusive. --==-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIhr3v+1Ho2POo0xkRAoUMAJ4qiqKevdnYpwpvAOuNYfqhn6vZuwCgmwLO EmB/Z+GPMhRVoQJcqn0qBZ4= =El4c -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Disposition: attachment; filename=restore-emacs #!/bin/bash # # Restore custom-compiled emacs if test ! -d ./lisp/emacs-lisp; then echo "You are not in the right directory." exit 1 fi if test "$UID" != "0"; then echo "You must be root to run this." exit 1 fi echo "Stage 1: Installing emacs ..." make install echo "Stage 2: Install fake emacs-snapshot package ..." dpkg -i ../../emacs-snapshot_1.0_i386.deb echo "Done." echo "Stage 2: Making symlinks ..." latest=$(cd /usr/local/share/emacs && echo 23.* | tr ' ' '\n' | sort \ | tail -n 1) ln -sf /usr/local/share/emacs/$latest /usr/share/emacs-snapshot ln -sf /usr/local/bin/emacs /usr/bin/emacs-snapshot mkdir -p /etc/emacs-snapshot/site-start.d echo "Done." echo "Stage 3: Installing emacs-snapshot flavor ..." echo >> /var/lib/emacsen-common/installed-flavors echo emacs-snapshot >> /var/lib/emacsen-common/installed-flavors /usr/lib/emacsen-common/emacs-install emacs-snapshot echo "Done." --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=debian-init.el Content-Transfer-Encoding: quoted-printable ;;; debian-init.el --- Debian utilities ;; This file is part of Michael Olson's Emacs settings. ;; The code in this file may be used, distributed, and modified ;; without restriction. ;;; Make sure that we have instrumented all Debian packages ;; Load the necessary functions (unless (boundp 'debian-emacs-flavor) (load "debian-startup")) ;; I dislike the way that Debian munges load-path, so don't do any of that. (defun debian-run-directories (&rest dirs) "Load each file of the form XXfilename.el or XXfilename.elc in any of the dirs, where XX must be a number. The files will be run in alphabetical order. If a file appears in more than one of the dirs, then the earlier dir takes precedence, and a .elc file always supercedes a .el file of the same name." (let* ((paths dirs) ;; Get a list of all the files in all the specified ;; directories that match the pattern. (files (apply 'append (mapcar (lambda (dir) (directory-files dir nil "^[0-9][0-9].*\\.elc?$" t)) paths))) ;; Now strip the directory portion, remove any .el or .elc ;; extension. (stripped-names (mapcar (lambda (file) (if (string-match "\\.el$" file) (substring file 0 -3) (if (string-match "\\.elc$" file) (substring file 0 -4) file))) (mapcar (lambda (file) (file-name-nondirectory file)) files))) ;; Deal with init files that use `flavor' (flavor debian-emacs-flavor) ;; Finally sort them, and delete duplicates (base-names (debian-unique-strings (sort stripped-names 'string<))= )) ;; Add the Debian site-start.d paths to load-path (setq load-path (nconc (copy-alist paths) load-path)) ;; Now load the files. "load" will make sure we get the byte ;; compiled one first, if any, and will respect load-path's ;; ordering. (mapcar (lambda (file) (condition-case () (load file nil) (error (message "Error while loading %s" file)))) base-names) ;; Remove the site-start.d paths (setq load-path (delq nil (mapcar (lambda (item) (if (member item paths) nil item)) load-path))))) ;; Now instrument all of the packages (unless (boundp 'debian-emacs-flavor) (defconst debian-emacs-flavor 'emacs-snapshot "A symbol representing the particular debian flavor of emacs that's running. Something like 'emacs20, 'xemacs20, etc.") (debian-startup debian-emacs-flavor)) ;; Deal with tree-widget.el in slime directory shadowing the built-in ;; version. (setq load-path (nconc (delete "/usr/local/share/emacs/23.0.60/site-lisp/slime" (delete "/usr/share/emacs-snapshot/site-lisp/slime" load-path= )) (list "/usr/local/share/emacs/23.0.60/site-lisp/slime"))) ;;; More Hacks (defcustom debian-changelog-distributions '("unstable" "testing" "testing-security" "stable" "stable-security" "oldstable-security" "experimental" "UNRELEASED") "List of all possible Debian distributions." :group 'debian-changelog :type '(repeat string)) (defun debian-changelog-distribution () "Delete the current distribution and prompt for a new one." (interactive) (if (eq (debian-changelog-finalised-p) t) (error (substitute-command-keys "most recent version has been finalis= ed - use \\[debian-changelog-unfinalise-last-version] or \\[debian-changelo= g-add-version]"))) (let ((str (completing-read "Select distribution: " (mapcar #'list debian-changelog-distributions) nil t nil))) (if (not (equal str "")) (debian-changelog-setdistribution str)))) ;;; Customizations (add-to-list 'debian-changelog-distributions "hardy") (add-to-list 'debian-changelog-distributions "intrepid") ;;; debian-init.el ends here --=-=-= -- | Michael Olson | FSF Associate Member #652 | | http://mwolson.org/ | Hobbies: Lisp, HCoop | | Projects: Emacs, Muse, ERC, EMMS, ErBot, DVC, Planner | `-------------------------------------------------------' --=-=-=--