Specifying where to find the installation files at runtime.

Specifying where to find the installation files at runtime.

Post by Daniel Nilss » Wed, 09 Jul 2003 00:29:24



All,

We are looking into distributing emacs with a commercial piece of
software. I'm fine on the license side of things, my question is how
to make emacs run without knowing where it will be installed in the
directory tree (the end user of our tool is free to install it
anywhere on their disk, and emacs will live as a subdirectory of the
main install point).

For example, if I compile emacs with --prefix set to /local/temp and
then move emacs somewhere else emacs will no longer run (as expected):

Warning: arch-dependent data dir
(/local/temp/libexec/emacs/21.3/sparc-sun-solaris2.8/) does not exist.
Warning: Lisp directory `/local/temp/share/emacs/21.3/site-lisp' does
not exist.
Warning: Lisp directory `/local/temp/share/emacs/site-lisp' does not
exist.
Warning: Lisp directory `/local/temp/share/emacs/21.3/leim' does not
exist.
Warning: Lisp directory `/local/temp/share/emacs/21.3/lisp' does not
exist.
Cannot open load file: term/x-win

So what I'm looking for is a way to specify to emacs at runtime where
to find the arch-dependent files etc. Is this possible ?

Thanks
Daniel Nilsson

 
 
 

Specifying where to find the installation files at runtime.

Post by Brian Masinic » Wed, 09 Jul 2003 02:37:34



> All,

> We are looking into distributing emacs with a commercial piece of
> software. I'm fine on the license side of things, my question is how
> to make emacs run without knowing where it will be installed in the
> directory tree (the end user of our tool is free to install it
> anywhere on their disk, and emacs will live as a subdirectory of the
> main install point).

> For example, if I compile emacs with --prefix set to /local/temp and
> then move emacs somewhere else emacs will no longer run (as expected):

> Warning: arch-dependent data dir
> (/local/temp/libexec/emacs/21.3/sparc-sun-solaris2.8/) does not exist.
> Warning: Lisp directory `/local/temp/share/emacs/21.3/site-lisp' does
> not exist.
> Warning: Lisp directory `/local/temp/share/emacs/site-lisp' does not
> exist.
> Warning: Lisp directory `/local/temp/share/emacs/21.3/leim' does not
> exist.
> Warning: Lisp directory `/local/temp/share/emacs/21.3/lisp' does not
> exist.
> Cannot open load file: term/x-win

> So what I'm looking for is a way to specify to emacs at runtime where
> to find the arch-dependent files etc. Is this possible ?

> Thanks
> Daniel Nilsson

If I correctly understand what you're trying to do and if I'm current
in my understanding of the way things work, it would not be easy to do
what you're proposing.  I believe, unless I'm mistaken, that you'd
have to have a version of Emacs compiled that corresponds to the
location of the distribution, or where you'd keep the shared
directories.

I'm wondering if you could come up with an approach where you could
create many soft links to the same physical location, thereby meeting
the naming requirement.  That's the only viable option that comes to
mind.  Perhaps someone else will understand the workings better and
come up with a superior alternative.

What would happen if you install Emacs in the usual place but have
your commercial software have a link to the Emacs locations?  Would
that be a possible option?

--
Brian Masinick


 
 
 

Specifying where to find the installation files at runtime.

Post by Bj?rn Lindstr » Wed, 09 Jul 2003 03:15:04



> I'm wondering if you could come up with an approach where you could
> create many soft links to the same physical location, thereby meeting
> the naming requirement.  That's the only viable option that comes to
> mind.  Perhaps someone else will understand the workings better and
> come up with a superior alternative.

It wouldn't be that many links. These are the directories which keep
most of a typical Emacs installation:

/usr/libexec/emacs
/usr/share/emacs
/var/games/emacs

add to that a bunch of files in /usr/bin, /usr/share/info and
/usr/share/man/man1.

That shouldn't be that hard to manage.

 
 
 

Specifying where to find the installation files at runtime.

Post by Kai Gro?joha » Wed, 09 Jul 2003 15:54:12



> We are looking into distributing emacs with a commercial piece of
> software. I'm fine on the license side of things, my question is how
> to make emacs run without knowing where it will be installed in the
> directory tree (the end user of our tool is free to install it
> anywhere on their disk, and emacs will live as a subdirectory of the
> main install point).

Emacs uses a number of environment variables; you could write a
wrapper script that sets them appropriately.

(emacs)Environment is the right node in info.
--
~/.signature

 
 
 

Specifying where to find the installation files at runtime.

Post by Daniel Nilss » Thu, 10 Jul 2003 00:22:56




> > I'm wondering if you could come up with an approach where you could
> > create many soft links to the same physical location, thereby meeting
> > the naming requirement.  That's the only viable option that comes to
> > mind.  Perhaps someone else will understand the workings better and
> > come up with a superior alternative.

> It wouldn't be that many links. These are the directories which keep
> most of a typical Emacs installation:

> /usr/libexec/emacs
> /usr/share/emacs
> /var/games/emacs

Thanks for the information. The problem though is that our tool is
typically installed on a shared network path and nothing is installed
on the machine that will actually run the tool. Some vendors might
install it in /tools/vendor/sisoft and some others in /cad for
example. Since I don't even know what the toplevel might be I don't
think the link approach will work. Emacs might be located in
/tools/sisoft/sia/4.5/libexec/emacs-21.3 after install for example. If
I compiled emacs with prefix set to /opt/emacs-21.3 I would have to
create links in /opt in every machine pointing to /tools/.../.
Unfortunalty that's not an option for the type of customers we sell
to.

Sounds like I need a different way to do this. perl has a similar
problem but there I was able to just specify a flag (-I ...) at
runtime and perl could then find the installation files OK. I wonder
how hard it would be to add this to emacs ?

Thanks
Daniel

 
 
 

Specifying where to find the installation files at runtime.

Post by Daniel Nilss » Thu, 10 Jul 2003 04:05:55



> Emacs uses a number of environment variables; you could write a
> wrapper script that sets them appropriately.

> (emacs)Environment is the right node in info.

Kai,

Yes, I found that using the environment variables EMACSDATA, EMACSDOC,
EMACSLOADPATH and EMACSPATH I can get emacs to work in any location.
Though it is neccesary to edit the file epaths.h and zero out the
PATH_LOADSEARCH definition to be "" if you don't want warning at
startup. So I have a solution, thanks everyone for your help

Daniel Nilsson

 
 
 

1. find-file and write-file with specified path?

Hello,

I can't figure out how to make the functions "find-file" or "write-file"

to start in another path than the default one.

I want to make a function "driveD-find-file" which starts in the
mini-buffer as
usual, but it should start with "d:" instead of the default-directory.

*minibubber*
------------------
Find-file: d:/_
------------------

Thanks
John

2. file in GAC not usable in projects

3. key binding to falways find a file in a specified directory

4. alt-tab on IRIX?

5. how to specify default directory for "find file"

6. WTS Cisco Systems GBICs

7. find-function and download/installation directories

8. needforspeed kernel32.dll problems

9. finding and opening files containing found text with dired

10. find-file.el and find-dired.el from emacs

11. `find-dired' function question (find file of type x?)

12. Can I specify a font for one file?

13. Disabling Backup files on specified directories?