all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory
@ 2013-11-01  6:04 Fazal Majid
  2013-11-01  8:19 ` Jan Djärv
  0 siblings, 1 reply; 2+ messages in thread
From: Fazal Majid @ 2013-11-01  6:04 UTC (permalink / raw)
  To: 15776

I have a build of GNU Emacs for the Mac. On 10.8 Mountain Lion, launching the app works normally - the working directory is my home directory. On 10.9 Mavericks. when launched from the Dock or Finder, the default directory is the root directory instead of my home directory. If launched from the command-line, the correct behavior holds.

It looks like there is custom code in src/emacs.c #ifdef-ed for HAVE_NS and NS_IMPL_COCOA that checks to see if the first or second command-line argument starts with “-psn”, and if so, perform a chdir(getenv(“HOME”)).

It seems like the behavior changes in Mavericks, and apps no longer get the -psn command-line argument. Apps are always launched with a cwd of /, even in Mountain Lion, but now Emacs is not taking corrective action.

The solution is probably to do a version check of OS X and if 10.9 or above, do the chdir anyway.

Here is the patch I am using, which is cruder, as it does not check for OS X version:

--- emacs-24.3/src/emacs.c.dist	2013-10-31 22:36:23.000000000 -0700
+++ emacs-24.3/src/emacs.c	2013-10-31 23:00:45.000000000 -0700
@@ -1173,6 +1173,9 @@
               chdir (getenv ("HOME"));
             }
         }
+      /* On Mavericks, there is no -psn command-line argument so do this anyway,
+         otherwise the CWD would be the root directory */
+      chdir (getenv ("HOME"));
 #endif  /* COCOA */
     }
 #endif /* HAVE_NS */


— Fazal Majid

In GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
 of 2013-10-31 on undr.majid.org
Windowing system distributor `Apple', version 10.3.1265
Configured using:
 `configure '--prefix' '/usr/local' '--with-ns' '--with-gif=no'
 '--x-includes=/usr/X11R6/include' '--x-libraries=/usr/X11R6/lib'
 '--with-xpm' 'CC=clang''

Important settings:
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f C-g M-x r e p <tab> o <tab> r <tab> <retur
n>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Quit
Making completion list... [2 times]

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr warnings emacsbug message format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils help-mode server disp-table ps-print
ps-def lpr vc vc-dispatcher python rx comint ring ansi-color cc-mode
cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
cc-vars cc-defs time-date tooltip ediff-hook vc-hooks lisp-float-type
mwheel ns-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)

--
Fazal Majid
CTO, Apsalar Inc.
majid@apsalar.com
+1 415 347-1277 (347-1APP)






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

* bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory
  2013-11-01  6:04 bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory Fazal Majid
@ 2013-11-01  8:19 ` Jan Djärv
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Djärv @ 2013-11-01  8:19 UTC (permalink / raw)
  To: Fazal Majid; +Cc: 15776-done

Hello.

This is fixed in the trunk.

	Jan D.

1 nov 2013 kl. 07:04 skrev Fazal Majid <majid@apsalar.com>:

> I have a build of GNU Emacs for the Mac. On 10.8 Mountain Lion, launching the app works normally - the working directory is my home directory. On 10.9 Mavericks. when launched from the Dock or Finder, the default directory is the root directory instead of my home directory. If launched from the command-line, the correct behavior holds.
> 
> It looks like there is custom code in src/emacs.c #ifdef-ed for HAVE_NS and NS_IMPL_COCOA that checks to see if the first or second command-line argument starts with “-psn”, and if so, perform a chdir(getenv(“HOME”)).
> 
> It seems like the behavior changes in Mavericks, and apps no longer get the -psn command-line argument. Apps are always launched with a cwd of /, even in Mountain Lion, but now Emacs is not taking corrective action.
> 
> The solution is probably to do a version check of OS X and if 10.9 or above, do the chdir anyway.
> 
> Here is the patch I am using, which is cruder, as it does not check for OS X version:
> 
> --- emacs-24.3/src/emacs.c.dist	2013-10-31 22:36:23.000000000 -0700
> +++ emacs-24.3/src/emacs.c	2013-10-31 23:00:45.000000000 -0700
> @@ -1173,6 +1173,9 @@
>               chdir (getenv ("HOME"));
>             }
>         }
> +      /* On Mavericks, there is no -psn command-line argument so do this anyway,
> +         otherwise the CWD would be the root directory */
> +      chdir (getenv ("HOME"));
> #endif  /* COCOA */
>     }
> #endif /* HAVE_NS */
> 
> 
> — Fazal Majid
> 
> In GNU Emacs 24.3.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
> of 2013-10-31 on undr.majid.org
> Windowing system distributor `Apple', version 10.3.1265
> Configured using:
> `configure '--prefix' '/usr/local' '--with-ns' '--with-gif=no'
> '--x-includes=/usr/X11R6/include' '--x-libraries=/usr/X11R6/lib'
> '--with-xpm' 'CC=clang''
> 
> Important settings:
>  locale-coding-system: nil
>  default enable-multibyte-characters: t
> 
> Major mode: Fundamental
> 
> Minor modes in effect:
>  tooltip-mode: t
>  mouse-wheel-mode: t
>  menu-bar-mode: t
>  file-name-shadow-mode: t
>  global-font-lock-mode: t
>  blink-cursor-mode: t
>  auto-composition-mode: t
>  auto-encryption-mode: t
>  auto-compression-mode: t
>  buffer-read-only: t
>  line-number-mode: t
>  transient-mark-mode: t
> 
> Recent input:
> C-x C-f C-g M-x r e p <tab> o <tab> r <tab> <retur
> n>
> 
> Recent messages:
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Quit
> Making completion list... [2 times]
> 
> Load-path shadows:
> None found.
> 
> Features:
> (shadow sort gnus-util mail-extr warnings emacsbug message format-spec
> rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
> mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
> mm-util mail-prsvr mail-utils help-mode server disp-table ps-print
> ps-def lpr vc vc-dispatcher python rx comint ring ansi-color cc-mode
> cc-fonts easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine
> cc-vars cc-defs time-date tooltip ediff-hook vc-hooks lisp-float-type
> mwheel ns-win tool-bar dnd fontset image regexp-opt fringe
> tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
> timer select scroll-bar mouse jit-lock font-lock syntax facemenu
> font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan
> thai tai-viet lao korean japanese hebrew greek romanian slovak czech
> european ethiopic indian cyrillic chinese case-table epa-hook
> jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
> cus-face macroexp files text-properties overlay sha1 md5 base64 format
> env code-pages mule custom widget hashtable-print-readable backquote
> make-network-process ns multi-tty emacs)
> 
> --
> Fazal Majid
> CTO, Apsalar Inc.
> majid@apsalar.com
> +1 415 347-1277 (347-1APP)
> 
> 
> 






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

end of thread, other threads:[~2013-11-01  8:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-01  6:04 bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory Fazal Majid
2013-11-01  8:19 ` Jan Djärv

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.