summaryrefslogtreecommitdiff
path: root/src/emacs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c9
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
if (!noninteractive)
{
#ifdef NS_IMPL_COCOA
- if (skip_args < argc)
+ /* Started from GUI? */
+ /* FIXME: Do the right thing if getenv returns NULL, or if
+ chdir fails. */
+ if (! inhibit_window_system && ! isatty (0))
+ chdir (getenv ("HOME"));
+ else if (skip_args < argc)
{
- /* FIXME: Do the right thing if getenv returns NULL, or if
- chdir fails. */
if (!strncmp (argv[skip_args], "-psn", 4))
{
skip_args += 1;