# HG changeset patch # User YAMAMOTO Mitsuharu # Date 1132730343 0 # Node ID 1fd0f45a7a2b8ea36ec95eea8e2778d6d616c1df # Parent 7ae3d744378eb6c434789e3dbecfedee4e05b308 (main) [MAC_OSX]: Change working directory to home directory if `-psn_*' option is specified. diff -r 7ae3d744378e -r 1fd0f45a7a2b src/emacs.c --- a/src/emacs.c Tue Nov 22 23:28:28 2005 +0000 +++ b/src/emacs.c Wed Nov 23 07:19:03 2005 +0000 @@ -962,9 +962,15 @@ #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