Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site godot.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!mhuxn!houxm!ihnp4!godot!massar
From: massar@godot.UUCP (J.P. Massar)
Newsgroups: net.emacs
Subject: Re: Loading CCAEmacs .elisp_init
Message-ID: <584@godot.UUCP>
Date: Fri, 7-Dec-84 12:24:52 EST
Article-I.D.: godot.584
Posted: Fri Dec  7 12:24:52 1984
Date-Received: Sat, 8-Dec-84 05:30:52 EST
References: <59@mit-athena.ARPA>
Reply-To: massar@godot.UUCP (J.P. Massar)
Organization: Thinking Machines, Cambridge, MA
Lines: 79
Summary: 

In article <59@mit-athena.ARPA> version B 2.10.2 9/17/84; site godot.UUCP version B 2.10.1 6/24/83; site mit-athena.ARPA godot!mit-eddie!genrad!decvax!mit-athena!martillo martillo@mit-athena.ARPA (Joaquim Martillo) writes:
>A few weeks ago, a fix to get CCAEmacs to load in the  .elisp_init  file
>was  posted  to  net.emacs.  The fix only worked if the .elisp_init file
>was linked to .elisp_init.l.  If the function stream_given_loadstring is
>altered  so  that the code looks something like this, emacs will load in
>the .elisp_init file without a link to .elisp_init.l.  In fact,  if  the
>full  path  name to a file is fiven, any elisp file could be loaded even
>if its name does not terminate in .l.
>
>
>	if (is_full_pathname(name))
>	{ 
>		searchlist = ads_cons_protect(Null_String,Nil_Symbol);
>		Pop_Elisp_Val;
>		goto no_extension;
>	} 
>	else { 
>		searchlist = ads_cons_protect(Null_String,searchlist);  
>		Pop_Elisp_Val;
>	}  
>	
>
>	/* find out whether the filename already has the proper extension */
>	/* attached.  If so we set extension to "" */
>
>	acq_sinfo(name,&schars,&slen);
>	acq_sinfo(extension,&echars,&elen);
>
>	if (elen >= slen) {
>		goto ok_extension;
>	}   
>	while (elen > 0) {
>		if (echars[--elen] != schars[--slen]) { 
>			goto ok_extension;
>		}   
>	}
>#if DEBUG    
>	fprintf(dbgfp,"Setting extension to blank\n");    
>#endif DEBUG    
>no_extension:
>	extension = Null_String;
>
>ok_extension :


I am the author of Elisp.

This fix renders invalid the documentation in the Elisp manual, page 1-25.
(Section 1.23.4 Loading Files)

As I see it, the problem is not that one wants to be able to load
.elisp_init, it is that the Emacs documentation is wrong in that the
file should be called .elisp_init.l .

By causing different behavior when a full pathname is given versus when
a filename is given (where Elisp assumes the current working directory)
leads to confusion in my mind.

The current way to load an arbitrary file (which you generally don't want
to do a lot anyway) is:

(let ((temp *lisp-extension*))
     (unwind-protect 
             (progn (setq *lisp-extension* "")
                    (load ))
             (setq *lisp-extension* temp)))

which could easily be subroutine-ized.

Another algorithm might be to have Elisp look for  if 
does not exist.  But should it first scan all the directories in
*LOAD-PATHNAMES* for ?

Caveat emptor:  There is no guarentee that this or any other bug fix /
documentation fix will be incorporated into the next CCA Emacs release.

JP Massar
ihnp4!godot!massar
massar@cca-unix