|
| From: | Lennart Borgman (gmail) |
| Subject: | Re: Debian's idiosyncratic complexification of Emacs |
| Date: | Tue, 22 Jul 2008 16:22:41 +0200 |
| User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
Karl Fogel wrote:
Manoj Srivastava <address@hidden> writes:Or if the problem is that Debian isn't allowed to touch anything under /usr/local/, then put code in /etc/emacs/site-start.el that loads /usr/share/.../site-start.el and /usr/local/share/.../site-start.el (and same for any other potentially blocked 'site-start.el's).While Debian maintainers can not touch anything under /usr/local, Debian install emacs with the PREFIX=/usr, and /usr/share/emacs/site-lisp/site-start.el Could be made to load the file under /etc.Wouldn't that solve all the problems here?Either the symlink or the modified version put in$PREFIX/share/emacs/site-lisp/site-start.el will solve the issue, yes.I think we're almost there. The trick is not to load the one in /etc, but to have the one in /etc load whatever other ones exist -- some of which may be user-produced and shadowed by the one in /etc. The problem, IIUC, is that Emacs loads the first site-start.el it finds in load-path, and no others. Since the /etc one is Debian-maintained, it is free to find the others (in likely places) and load them. As long as it does so last, everything will work out fine: user-created code will be evaluated after Debian-created code, which is what we want.
I have attached a site-start.el that maybe can be used for the common site-start.el
;;; site-start.el --- Common site-start, will start user siste-start
;;
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Created: 2008-07-21T23:48:58+0200 Mon
;; Version: 0.5
;; Last-Updated: 2008-07-22T00:04:41+0200 Mon
;; URL:
;; Keywords:
;; Compatibility:
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; Written for the Debian packaging problem.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 2, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(message "Common site-start running ...")
;; Load the users site-start file.
(let* ((this-dir
(file-truename
(file-name-as-directory
(file-name-directory
(if load-file-name load-file-name buffer-file-name)))))
(load-path
(mapcar
(lambda (path)
(unless (string= this-dir
(file-truename
(file-name-as-directory
(expand-file-name path))))
path))
load-path)))
(setq load-path (delq nil load-path))
;;(message "this-dir=%s" this-dir)
;;(with-current-buffer "*Messages*" (insert (pp-to-string load-path)))
(let ((user-site-start (locate-library "site-start")))
(if user-site-start
(progn
(message "SITE-START: Loading user %s" user-site-start)
(load-file user-site-start))
(message "SITE-START: There was no user specific site-start.el(c)"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; site-start.el ends here
| [Prev in Thread] | Current Thread | [Next in Thread] |