🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98337

Idea: make it easy to install local additions in emacs

#98337
From: Dan_Jacobson
Date: Sat, 17 Aug 1991 15:50
154 lines
6027 bytes
>>>>> On Wed, 14 Aug 91 22:05:35 -0400, jimb@gnu.ai.mit.edu (Jim Blandy) said:

Jim> We also use a lot of non-standard elisp packages.  In Emacs 18.57, the
Jim> makefiles and initialization code conspire to make things pretty
Jim> impossible to add other directories to your dumped emacs.  You can set
Jim> your EMACSLOADPATH environment variable to a colon-separated list of
Jim> directories, or you can put something like this in default.el, which
Jim> gets loaded after the user's .emacs file:

Jim>     (setq load-path (append load-path '("/usr/local/lib/elisp")))

Jim> This adds new entries to the end so that the user's additions to the
Jim> load-path come first.

Jim> However, this won't help users who want to load things in their .emacs
Jim> files, because load-path won't get extended until after .emacs is loaded.

Jim> This is so much more annoying than it should be it just isn't funny.
Jim> I haven't thought carefully about it yet, but I promise that in Emacs
Jim> 19, all will be sweetness and light.  :-)

Well, here we tell folks not to mess with with $EMACSLOADPATH and have
a sugar coated shell script "gnuemacs" that calls the real GNU emacs
binary which we don't know can be placed where at compile time, etc.
(I'm not the principal mastermind of this.  Probably the only kludgy
part is the ispell bit.)

default.el:

;;;
;;; Initialization for GNU emacs to allow machine independence
;;;

;;; Verify that appropriate environment variable exist
;;;
(if
 (null (getenv "GNUEMACS_LIB"))
  (error
   "Environment variable 'GNUEMACS_LIB' has not been set!"))

;;; If exec-directory hasn't been changed by user's .emacs
;;;  file set it up to defaults.
;;;
(if (equal exec-directory "/tmp/../")
    (setq exec-directory
	  (concat (getenv "GNUEMACS_LIB") "/dist/etc/")))

;;; Replace "PATH_EXEC" in exec-path with $GNUEMACS_LIB/dist/etc
;;;
(setq exec-path
      (mapcar '(lambda (e)
		 (cond ((equal e "/tmp/../")
			(concat (getenv "GNUEMACS_LIB") "/dist/etc"))
		       (t e)))
	      exec-path))

(setq Info-directory
      (concat (getenv "GNUEMACS_LIB") "/dist/info"))

; for security reasons, let folks know about possible subterfuge
(setq inhibit-local-variables t)

; set up LISP code directory
(autoload 'lisp-dir-apropos "lispdir" "Public-Domain Lisp Code Apropos" t)
(setq lisp-code-directory 
  (concat (getenv "GNUEMACS_LIB") "/local/etc/LCD-datafile"))

---------------------------------------------
shell script "gnuemacs":

: use /bin/sh

#	gnuemacs shell source 10:41PM Tue Jul 16, 1991
#
#	gnuemacs - startup script for GNU emacs to provide several
#	           needed environment variables.
#
#
#	Scott Thompson, Scott_F_Thompson@att.com, 1-(708)-979-2237
#	Chip Webb, cwebb@allegra.att.com, 	  1-(908)-582-2882
#	Dan Jacobson, Dan_Jacobson@ATT.COM 	  1-(708)-979-6364
#

# If your machine is not an exptools machine, or the gnuemacs tree
# is not in the same place as exptools, then set and export the
# environment variable $GNUEMACS_TREE, which will override
# the setting of $TOOLS. You can do this here in this
# file or in your .profile.
#
# Example
#
# GNUEMACS_TREE=$HOME/private/gnuemacs; export GNUEMACS_TREE

# Verify that TOOLS variable is set.
#
TMP_TOOLS_VAR=${GNUEMACS_TREE:=${TOOLS:?"$0: Either \$TOOLS or \$GNUEMACS_TREE must be set and exported!"}}

# Make sure HOME is set as it will be used later
#
if	test -z "$HOME"
then
	HOME=`logdir`
fi

: ${GNUEMACS_LIB:="$TMP_TOOLS_VAR/lib/gnuemacs"}
: ${NEWSBOX:="${HOME}/News"}			# A somewhat standard loc.
: ${DOMAINNAME:="ATT.COM"}			# We are all ATT?
: ${ORGANIZATION:="AT&T Bell Laboratories"}	# Ditto

if	test "x$NOISPELL" = x
then
	: ${ISPELL_LIB:="${GNUEMACS_LIB}/local/etc"}
fi

# Official distributed lisp directories.
#
TOOLSLOADPATH="$GNUEMACS_LIB/local/lisp:$GNUEMACS_LIB/dist/lisp"

# Used by gnuemacs to find lisp directories.  Allows user to specifiy
# private lisp directories first!
#
# NOTE: Using EMACSLOADPATH to change directory ordering is DANGEROUS!
#
EMACSLOADPATH="${EMACSLOADPATH:+$EMACSLOADPATH:}$TOOLSLOADPATH"

# If user wants to use ispell and WORDLIST file does not exist create
# it, ispell fails if this file does not exist.
#
: ${WORDLIST:="$HOME/lib/wwb/spelldict"}	
if	test  "x$NOISPELL" = x -a ! -f "$WORDLIST"
then
	# Since $WORDLIST cannot be found or is not set, use a default
	# derived from WrittersWorkBench.  Then for fun put 'gnuemacs'
	# in the new personal spelling dictionary.  If this all fails
	# there is not much that can be done, so just continue on.
	#
	WORDLIST="${HOME}/lib/wwb/spelldict"
	( mkdir $HOME/lib $HOME/lib/wwb >/dev/null 2>&1 && 
	echo gnuemacs >$WORDLIST 2>/dev/null ) || :
fi

# If GNUPATH is set it will be placed before the default emacs directories.
# This change was made to avoid name conflicts unless the user explicitly
# wishes to override a particular tool or set of emacs tools.
#
TOOLSEXECPATH="$GNUEMACS_LIB/bin:$GNUEMACS_LIB/local/etc:$GNUEMACS_LIB/dist/etc"
PATH="${GNUPATH:+$GNUPATH:}$TOOLSEXECPATH:$PATH"

# Export variables used by GNU emacs and several of it's packages.
#
export	DOMAINNAME EMACSLOADPATH GNUEMACS_LIB HOME ISPELL_LIB \
	NEWSBOX ORGANIZATION PATH WORDLIST

exec ${GNUEMACS_LIB}/bin/gnuemacs ${1+"$@"}
Technical Details
Message-ID: <1991Aug17Sa114954.Dan_Jacobson@ATT.COM>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!att.com!Dan_Jacobson
References: <1991Aug10Sa033216.Dan_Jacobson@ATT.COM>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,1961cbd878482cfe
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-08-17 08:50:00 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!att.com!Dan_Jacobson
From: Dan_Jacobson@att.com
Newsgroups: gnu.emacs.bug
Subject: Idea: make it easy to install local additions in emacs
Message-ID: <1991Aug17Sa114954.Dan_Jacobson@ATT.COM>
Date: 17 Aug 91 15:50:00 GMT
References: <1991Aug10Sa033216.Dan_Jacobson@ATT.COM>
Sender: gnulists@ai.mit.edu
Reply-To: Dan_Jacobson@ihlpz.att.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 154
Approved: bug-gnu-emacs@prep.ai.mit.edu