From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Newsgroups: gmane.emacs.bugs Subject: bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory Date: Fri, 1 Nov 2013 09:19:04 +0100 Message-ID: <0C054F0B-78BB-4C39-89E1-BC6BB4CB0C4A@swipnet.se> References: <8836FBC9-C1AB-4B94-AC54-86FB8FDC559C@apsalar.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1383294019 32340 80.91.229.3 (1 Nov 2013 08:20:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Nov 2013 08:20:19 +0000 (UTC) Cc: 15776-done@debbugs.gnu.org To: Fazal Majid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 01 09:20:23 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vc9xu-0007Ap-06 for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2013 09:20:22 +0100 Original-Received: from localhost ([::1]:60767 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc9xt-0006iL-9W for geb-bug-gnu-emacs@m.gmane.org; Fri, 01 Nov 2013 04:20:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc9xj-0006hx-J3 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 04:20:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vc9xb-0007KD-54 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 04:20:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc9xb-0007J4-1u for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 04:20:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vc9xa-0005i4-Gw for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 04:20:02 -0400 Resent-From: Jan =?UTF-8?Q?Dj=C3=A4rv?= Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Fri, 01 Nov 2013 08:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 15776 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 15776@debbugs.gnu.org, jan.h.d@swipnet.se, majid@apsalar.com Original-Received: via spool by 15776-done@debbugs.gnu.org id=D15776.138329395321882 (code D ref 15776); Fri, 01 Nov 2013 08:20:01 +0000 Original-Received: (at 15776-done) by debbugs.gnu.org; 1 Nov 2013 08:19:13 +0000 Original-Received: from localhost ([127.0.0.1]:56407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vc9wm-0005gr-UQ for submit@debbugs.gnu.org; Fri, 01 Nov 2013 04:19:13 -0400 Original-Received: from mail01.bdtv.se ([176.10.222.34]:44767) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1Vc9wj-0005gh-Me for 15776-done@debbugs.gnu.org; Fri, 01 Nov 2013 04:19:11 -0400 Original-Received: (qmail 28516 invoked by uid 89); 1 Nov 2013 08:19:07 -0000 Original-Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.bdtv.se with ESMTPA; 1 Nov 2013 08:19:07 -0000 Original-Received: from anon-63-161.vpn.ipredator.se (unknown [46.246.63.161]) by coolsville.localdomain (Postfix) with ESMTPSA id E07961A01A3; Fri, 1 Nov 2013 08:19:06 +0000 (UTC) In-Reply-To: <8836FBC9-C1AB-4B94-AC54-86FB8FDC559C@apsalar.com> X-Mailer: Apple Mail (2.1816) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79847 Archived-At: Hello. This is fixed in the trunk. Jan D. 1 nov 2013 kl. 07:04 skrev Fazal Majid : > 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. >=20 > 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 =93-psn=94, and if so, perform a = chdir(getenv(=93HOME=94)). >=20 > 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. >=20 > The solution is probably to do a version check of OS X and if 10.9 or = above, do the chdir anyway. >=20 > Here is the patch I am using, which is cruder, as it does not check = for OS X version: >=20 > --- 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 */ >=20 >=20 > =97 Fazal Majid >=20 > 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=3Dno' > '--x-includes=3D/usr/X11R6/include' '--x-libraries=3D/usr/X11R6/lib' > '--with-xpm' 'CC=3Dclang'' >=20 > Important settings: > locale-coding-system: nil > default enable-multibyte-characters: t >=20 > Major mode: Fundamental >=20 > 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 >=20 > Recent input: > C-x C-f C-g M-x r e p o r n> >=20 > Recent messages: > For information about GNU Emacs and the GNU system, type C-h C-a. > Quit > Making completion list... [2 times] >=20 > Load-path shadows: > None found. >=20 > 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) >=20 > -- > Fazal Majid > CTO, Apsalar Inc. > majid@apsalar.com > +1 415 347-1277 (347-1APP) >=20 >=20 >=20