unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* How to specify path to .emacs.d
@ 2012-10-29 20:37 Barry OReilly
  2012-10-29 22:27 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Barry OReilly @ 2012-10-29 20:37 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1065 bytes --]

Hi,
I'd like to know how to specify at the command line which directory Emacs
should use as the .emacs.d directory.  I see the --user flag, but it seems
unnecessarily inflexible.

One use case I would like this for is so as I can run Emacs unintrusively
on a colleague's computer.  --user flag doesn't serve the purpose for
technical reasons and I currently symlink their ~/.emacs.d to my .emacs.d
on a network share.  For my colleagues who also use Emacs, this creates an
awkwardness whereby I backup their .emacs.d before creating my symlink, and
then remember to restore it later when finished.

Another use case is that I'm getting my Emacs configuration to work on
Windows, and I discovered that Windows shortcuts are apparently .lnk files
and don't function like a symlink.  I'm unsure how to use a .emacs.d at an
arbitrary location, and only know to copy it to home instead.  This is
inconvenient because I want to use a .emacs.d straight out of a Mercurial
repo located elsewhere.

Specifying a .emacs.d location as a command line flag would be a big help.

[-- Attachment #2: Type: text/html, Size: 1123 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-29 20:37 Barry OReilly
@ 2012-10-29 22:27 ` Peter Dyballa
  2012-10-30  9:46 ` Nicolas Richard
  2012-10-30 16:09 ` Evan Driscoll
  2 siblings, 0 replies; 9+ messages in thread
From: Peter Dyballa @ 2012-10-29 22:27 UTC (permalink / raw)
  To: Barry OReilly; +Cc: help-gnu-emacs


Am 29.10.2012 um 21:37 schrieb Barry OReilly:

> Specifying a .emacs.d location as a command line flag would be a big help.

Do you need that path for GNU Emacs that it finds some Elisp files? The environment variable EMACSLOADPATH can point to additional directories. This variable matches the use of the GNU Emacs variable load-path. This one can be changed in some init file, for example when the user is someone particular…

--
Greetings

  Pete

Think of XML as Lisp for COBOL programmers.
				- Tony-A (some guy on /.)




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-29 20:37 Barry OReilly
  2012-10-29 22:27 ` Peter Dyballa
@ 2012-10-30  9:46 ` Nicolas Richard
  2012-10-30 13:30   ` Peter Münster
  2012-10-30 14:44   ` Jambunathan K
  2012-10-30 16:09 ` Evan Driscoll
  2 siblings, 2 replies; 9+ messages in thread
From: Nicolas Richard @ 2012-10-30  9:46 UTC (permalink / raw)
  To: help-gnu-emacs

Barry OReilly <gundaetiapo@gmail.com> writes:
> Specifying a .emacs.d location as a command line flag would be a big
> help.

You could use apropos-value to list all variables which refer to
.emacs.d and then modify those from command line using --eval (although
sometimes that directory is hardcoded, e.g. in startup.el as a fallback
value). In particular, user-emacs-directory is of interest, and I'd
trying changing it, then run apropos-value to see what remains.

-- 
Nico.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-30  9:46 ` Nicolas Richard
@ 2012-10-30 13:30   ` Peter Münster
  2012-10-30 14:44   ` Jambunathan K
  1 sibling, 0 replies; 9+ messages in thread
From: Peter Münster @ 2012-10-30 13:30 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, Oct 30 2012, Nicolas Richard wrote:

> modify those from command line using --eval

That's too late...

-- 
           Peter




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-30  9:46 ` Nicolas Richard
  2012-10-30 13:30   ` Peter Münster
@ 2012-10-30 14:44   ` Jambunathan K
  1 sibling, 0 replies; 9+ messages in thread
From: Jambunathan K @ 2012-10-30 14:44 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: help-gnu-emacs

"Nicolas Richard" <theonewiththeevillook@yahoo.fr> writes:

> Barry OReilly <gundaetiapo@gmail.com> writes:
>> Specifying a .emacs.d location as a command line flag would be a big
>> help.
>
> You could use apropos-value to list all variables which refer to
> .emacs.d and then modify those from command line using --eval (although
> sometimes that directory is hardcoded, e.g. in startup.el as a fallback
> value). In particular, user-emacs-directory is of interest, and I'd
> trying changing it, then run apropos-value to see what remains.

`user-emacs-directory' is a defconst.
-- 



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-29 20:37 Barry OReilly
  2012-10-29 22:27 ` Peter Dyballa
  2012-10-30  9:46 ` Nicolas Richard
@ 2012-10-30 16:09 ` Evan Driscoll
  2 siblings, 0 replies; 9+ messages in thread
From: Evan Driscoll @ 2012-10-30 16:09 UTC (permalink / raw)
  To: Barry OReilly; +Cc: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1540 bytes --]

On 10/29/2012 03:37 PM, Barry OReilly wrote:
> Another use case is that I'm getting my Emacs configuration to work on
> Windows, and I discovered that Windows shortcuts are apparently .lnk
> files and don't function like a symlink.  I'm unsure how to use a
> .emacs.d at an arbitrary location, and only know to copy it to home
> instead.  This is inconvenient because I want to use a .emacs.d straight
> out of a Mercurial repo located elsewhere.

I can't help with the Emacs part of your question, but Vista and higher
have true (though still a bit brain dead in some respects) symlinks.
Look at the 'mklink' command.

You'll need a privilege that isn't granted to users by default (silly
decision #1), and while you can change that, for a one-off thing it's
easier to just elevate yourself when opening the command prompt. Also
note that Windows symlinks are specific to either pointing to a file or
a directory, so you'll have to explicitly tell 'mklink' that you want a
directory symlink.


On XP and 2000 (and also Vista and higher) you also have both hard links
and something called "directory junctions" available. (Windows is
capable of creating hard links to directories. Presumably you have to be
careful not to shoot yourself in the foot by creating a cycle.) I think
'mklink' may create hard links too though I'm not sure; for directory
junctions, there are a couple third-party utilities, e.g. Mark
Russinovich's 'junction':
http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

Evan



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 554 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
@ 2012-10-30 22:53 Barry OReilly
  2012-10-31 10:26 ` Nicolas Richard
  0 siblings, 1 reply; 9+ messages in thread
From: Barry OReilly @ 2012-10-30 22:53 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

>"Nicolas Richard" <address@hidden> writes:
>
>> Barry OReilly <address@hidden> writes:
>>> Specifying a .emacs.d location as a command line flag would be a big
>>> help.
>>
>> You could use apropos-value to list all variables which refer to
>> .emacs.d and then modify those from command line using --eval (although
>> sometimes that directory is hardcoded, e.g. in startup.el as a fallback
>> value). In particular, user-emacs-directory is of interest, and I'd
>> trying changing it, then run apropos-value to see what remains.
>
>`user-emacs-directory' is a defconst.

I removed ~/.emacs.d, verified no ~/.emacs, executed:
   emacs --eval '(setq user-emacs-directory "my/path/.emacs.d/")'

It did not work.  More precisely, Emacs did not load
my/path/.emacs.d/init.el .  C-h v does show that user-emacs-directory has
the /my/path/.emacs.d value, however.

[-- Attachment #2: Type: text/html, Size: 1050 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
       [not found] <mailman.12027.1351637586.855.help-gnu-emacs@gnu.org>
@ 2012-10-31  0:51 ` Stefan Monnier
  0 siblings, 0 replies; 9+ messages in thread
From: Stefan Monnier @ 2012-10-31  0:51 UTC (permalink / raw)
  To: help-gnu-emacs

>    emacs --eval '(setq user-emacs-directory "my/path/.emacs.d/")'

The --eval argument is executed after reading your .emacs (or
.emacs.d/init.el) file, so clearly that won't work.

> C-h v does show that user-emacs-directory has the /my/path/.emacs.d
> value, however.

Yes, but only later when you do C-h v, not while trying to load the
.emacs file.


        Stefan


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: How to specify path to .emacs.d
  2012-10-30 22:53 How to specify path to .emacs.d Barry OReilly
@ 2012-10-31 10:26 ` Nicolas Richard
  0 siblings, 0 replies; 9+ messages in thread
From: Nicolas Richard @ 2012-10-31 10:26 UTC (permalink / raw)
  To: help-gnu-emacs


Barry OReilly <gundaetiapo@gmail.com> writes:
> It did not work.  More precisely, Emacs did not load my/path/.emacs.d
> /init.el .  C-h v does show that user-emacs-directory has the /my/
> path/.emacs.d value, however.

Ok, I had not quite understood what you wanted to do. My suggestion
would then be to run emacs as:
emacs -q --eval '(setq user-emacs-directory "~/.my.other.emacs.d")' --eval '(load (concat user-emacs-directory "/init.el"))'

It is far from optimal but maybe it can work for you.

-- 
Nicolas.




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-31 10:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-30 22:53 How to specify path to .emacs.d Barry OReilly
2012-10-31 10:26 ` Nicolas Richard
     [not found] <mailman.12027.1351637586.855.help-gnu-emacs@gnu.org>
2012-10-31  0:51 ` Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2012-10-29 20:37 Barry OReilly
2012-10-29 22:27 ` Peter Dyballa
2012-10-30  9:46 ` Nicolas Richard
2012-10-30 13:30   ` Peter Münster
2012-10-30 14:44   ` Jambunathan K
2012-10-30 16:09 ` Evan Driscoll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).