all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* OS independent way to specify location of .emacs.d directory
@ 2013-04-04  0:01 Joe Riel
  2013-04-04  0:19 ` Steven Degutis
  2013-04-04  2:48 ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Joe Riel @ 2013-04-04  0:01 UTC (permalink / raw)
  To: Help GNU Emacs

Is there way that specifies the path to the .emacs.d
directory that works on Linux, Windows, and Mac?
Currently I use

  (format "%s/.emacs.d" (getenv "HOME"))

However, I doubt that is necessarily correct on Windows.


-- 
Joe Riel




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

* Re: OS independent way to specify location of .emacs.d directory
  2013-04-04  0:01 Joe Riel
@ 2013-04-04  0:19 ` Steven Degutis
  2013-04-04  2:48 ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Steven Degutis @ 2013-04-04  0:19 UTC (permalink / raw)
  To: Joe Riel; +Cc: Help GNU Emacs

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

For unix it's `user-emacs-directory` but on Windows it's trickier:
http://emacswiki.org/emacs/DotEmacsDotD

I can't vouch that's an up-to-date article though.

-Steven


On Wed, Apr 3, 2013 at 7:01 PM, Joe Riel <joer@san.rr.com> wrote:

> Is there way that specifies the path to the .emacs.d
> directory that works on Linux, Windows, and Mac?
> Currently I use
>
>   (format "%s/.emacs.d" (getenv "HOME"))
>
> However, I doubt that is necessarily correct on Windows.
>
>
> --
> Joe Riel
>
>
>

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

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

* Re: OS independent way to specify location of .emacs.d directory
       [not found] <mailman.23457.1365033700.855.help-gnu-emacs@gnu.org>
@ 2013-04-04  0:20 ` Stefan Monnier
  2013-04-04 20:56   ` Oleksandr Gavenko
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Monnier @ 2013-04-04  0:20 UTC (permalink / raw)
  To: help-gnu-emacs

> Is there way that specifies the path to the .emacs.d
> directory that works on Linux, Windows, and Mac?

AFAIK "~/.emacs.d" should work.


        Stefan


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

* Re: OS independent way to specify location of .emacs.d directory
  2013-04-04  0:01 Joe Riel
  2013-04-04  0:19 ` Steven Degutis
@ 2013-04-04  2:48 ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2013-04-04  2:48 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 3 Apr 2013 17:01:19 -0700
> From: Joe Riel <joer@san.rr.com>
> 
> Is there way that specifies the path to the .emacs.d
> directory that works on Linux, Windows, and Mac?
> Currently I use
> 
>   (format "%s/.emacs.d" (getenv "HOME"))
> 
> However, I doubt that is necessarily correct on Windows.

Inside Emacs, it is correct on Windows as well.



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

* Re: OS independent way to specify location of .emacs.d directory
  2013-04-04  0:20 ` OS independent way to specify location of .emacs.d directory Stefan Monnier
@ 2013-04-04 20:56   ` Oleksandr Gavenko
  2013-04-04 21:04     ` Ludwig, Mark
  0 siblings, 1 reply; 8+ messages in thread
From: Oleksandr Gavenko @ 2013-04-04 20:56 UTC (permalink / raw)
  To: help-gnu-emacs

On 2013-04-04, Stefan Monnier wrote:

>> Is there way that specifies the path to the .emacs.d
>> directory that works on Linux, Windows, and Mac?
>
> AFAIK "~/.emacs.d" should work.
>
I see many times such code:

  (expand-file-name "~/.emacs.d")

-- 
Best regards!




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

* RE: OS independent way to specify location of .emacs.d directory
  2013-04-04 20:56   ` Oleksandr Gavenko
@ 2013-04-04 21:04     ` Ludwig, Mark
  2013-04-05  5:59       ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Ludwig, Mark @ 2013-04-04 21:04 UTC (permalink / raw)
  To: Oleksandr Gavenko, help-gnu-emacs@gnu.org

> From: Oleksandr Gavenko
> Sent: Thursday, April 04, 2013 3:56 PM
> 
> On 2013-04-04, Stefan Monnier wrote:
> 
> >> Is there way that specifies the path to the .emacs.d directory that
> >> works on Linux, Windows, and Mac?
> >
> > AFAIK "~/.emacs.d" should work.
> >
> I see many times such code:
> 
>   (expand-file-name "~/.emacs.d")

It is a little-known fact that the Windows kernel accepts forward slashes;
you can pass them to every API that takes a file path.  (You can pass 
path strings that mix forward and backward slashes.)

You can even use forward slashes as file path arguments to some external 
commands in command shells.  You can never use them in internal commands.

Cheers,
Mark




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

* Re: OS independent way to specify location of .emacs.d directory
  2013-04-04 21:04     ` Ludwig, Mark
@ 2013-04-05  5:59       ` Eli Zaretskii
  2013-04-05 13:33         ` Ludwig, Mark
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2013-04-05  5:59 UTC (permalink / raw)
  To: help-gnu-emacs

> From: "Ludwig, Mark" <ludwig.mark@siemens.com>
> Date: Thu, 4 Apr 2013 21:04:25 +0000
> 
> You can even use forward slashes as file path arguments to some external 
> commands in command shells.  You can never use them in internal commands.

Not entirely true, the last sentence.  Many commands internal to
cmd.exe will accept file names with forward slashes, especially if
they are quoted.  E.g., 'cd' accepts them even without quotes.



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

* RE: OS independent way to specify location of .emacs.d directory
  2013-04-05  5:59       ` Eli Zaretskii
@ 2013-04-05 13:33         ` Ludwig, Mark
  0 siblings, 0 replies; 8+ messages in thread
From: Ludwig, Mark @ 2013-04-05 13:33 UTC (permalink / raw)
  To: Eli Zaretskii, help-gnu-emacs@gnu.org

> From: Eli Zaretskii
> Sent: Friday, April 05, 2013 1:00 AM
> 
> > From: "Ludwig, Mark" <ludwig.mark@siemens.com>
> > Date: Thu, 4 Apr 2013 21:04:25 +0000
> >
> > You can even use forward slashes as file path arguments to some
> > external commands in command shells.  You can never use them in internal
> commands.
> 
> Not entirely true, the last sentence.  Many commands internal to cmd.exe will
> accept file names with forward slashes, especially if they are quoted.  E.g., 'cd'
> accepts them even without quotes.

Thanks for pointing to this.  I know I've had problems before with CD, and it's apparently improved in later releases.  For example, in Windows 7, forward slashes appear to work consistently.  
In WinXP, for another example, it has some subtlety.  (It appears that leading slashes can sometimes be forward, and quoting doesn't seem to help.)  Here's a transcript from WinXP:

=============================================================================== 
D:\>cd /scratch

D:\Scratch>cd /scratch
The system cannot find the path specified.

D:\Scratch>cd /

D:\Scratch>cd \

D:\>cd /scratch/mrl

D:\Scratch\mrl>cd /scratch/mrl
The system cannot find the path specified.

D:\Scratch\mrl>cd \scratch/mrl

D:\Scratch\mrl>cd \

D:\>cd scratch/mrl

D:\Scratch\mrl>cd ..

D:\Scratch>cd ./mrl

D:\Scratch\mrl>cd "/scratch/mrl"
The system cannot find the path specified.

D:\Scratch\mrl>
===============================================================================

Cheers,
Mark




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

end of thread, other threads:[~2013-04-05 13:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.23457.1365033700.855.help-gnu-emacs@gnu.org>
2013-04-04  0:20 ` OS independent way to specify location of .emacs.d directory Stefan Monnier
2013-04-04 20:56   ` Oleksandr Gavenko
2013-04-04 21:04     ` Ludwig, Mark
2013-04-05  5:59       ` Eli Zaretskii
2013-04-05 13:33         ` Ludwig, Mark
2013-04-04  0:01 Joe Riel
2013-04-04  0:19 ` Steven Degutis
2013-04-04  2:48 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.