From: YAMAMOTO Mitsuharu Date: Wed, 23 Nov 2005 07:19:03 +0000 (+0000) Subject: (main) [MAC_OSX]: Change working directory to home X-Git-Tag: emacs-pretest-22.0.90~5711 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a4f8f6cf42c80118b16abbe4008ccc80167437eb;p=emacs.git (main) [MAC_OSX]: Change working directory to home directory if `-psn_*' option is specified. --- diff --git a/src/emacs.c b/src/emacs.c index d3e16c046db..25d9ae45730 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -962,9 +962,15 @@ main (argc, argv #ifdef MAC_OSX /* Skip process serial number passed in the form -psn_x_y as - command-line argument. */ + command-line argument. The WindowServer adds this option when + Emacs is invoked from the Finder or by the `open' command. In + these cases, the working directory becomes `/', so we change it + to the user's home directory. */ if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0) - skip_args++; + { + chdir (getenv ("HOME")); + skip_args++; + } #endif /* MAC_OSX */ #ifdef VMS