diff options
| author | Jan Djärv | 2013-10-20 18:47:42 +0200 |
|---|---|---|
| committer | Jan Djärv | 2013-10-20 18:47:42 +0200 |
| commit | a9f8deecce02a4acdb5259297878799b69d56a21 (patch) | |
| tree | b82dc27c4e754a3ec330f9e790b92955af57eb65 /src/emacs.c | |
| parent | 87756ca9f45b37ad8f7fbc6f392de4200ba5940b (diff) | |
| download | emacs-a9f8deecce02a4acdb5259297878799b69d56a21.tar.gz emacs-a9f8deecce02a4acdb5259297878799b69d56a21.zip | |
* emacs.c (main): On Cocoa, if GUI session and 0 is not a tty,
chdir to HOME.
Fixes: debbugs:15607
Diffstat (limited to 'src/emacs.c')
| -rw-r--r-- | src/emacs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/emacs.c b/src/emacs.c index 06b8d290cae..540084abc44 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1187,10 +1187,13 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem | |||
| 1187 | if (!noninteractive) | 1187 | if (!noninteractive) |
| 1188 | { | 1188 | { |
| 1189 | #ifdef NS_IMPL_COCOA | 1189 | #ifdef NS_IMPL_COCOA |
| 1190 | if (skip_args < argc) | 1190 | /* Started from GUI? */ |
| 1191 | /* FIXME: Do the right thing if getenv returns NULL, or if | ||
| 1192 | chdir fails. */ | ||
| 1193 | if (! inhibit_window_system && ! isatty (0)) | ||
| 1194 | chdir (getenv ("HOME")); | ||
| 1195 | else if (skip_args < argc) | ||
| 1191 | { | 1196 | { |
| 1192 | /* FIXME: Do the right thing if getenv returns NULL, or if | ||
| 1193 | chdir fails. */ | ||
| 1194 | if (!strncmp (argv[skip_args], "-psn", 4)) | 1197 | if (!strncmp (argv[skip_args], "-psn", 4)) |
| 1195 | { | 1198 | { |
| 1196 | skip_args += 1; | 1199 | skip_args += 1; |