From unknown Sun Jun 15 08:22:58 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15776 <15776@debbugs.gnu.org> To: bug#15776 <15776@debbugs.gnu.org> Subject: Status: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory Reply-To: bug#15776 <15776@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:22:58 +0000 retitle 15776 On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root di= rectory instead of the home directory reassign 15776 emacs submitter 15776 Fazal Majid severity 15776 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 02:24:23 2013 Received: (at submit) by debbugs.gnu.org; 1 Nov 2013 06:24:23 +0000 Received: from localhost ([127.0.0.1]:56270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vc89e-0001lz-Bq for submit@debbugs.gnu.org; Fri, 01 Nov 2013 02:24:23 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49873) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vc7r5-0001K6-Eo for submit@debbugs.gnu.org; Fri, 01 Nov 2013 02:05:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vc7qu-0005c0-1S for submit@debbugs.gnu.org; Fri, 01 Nov 2013 02:05:06 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc7qt-0005bU-TT for submit@debbugs.gnu.org; Fri, 01 Nov 2013 02:04:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc7qo-0004O6-85 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 02:04:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vc7qf-0005GU-Hm for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 02:04:54 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:60012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vc7qf-0005Fz-B8 for bug-gnu-emacs@gnu.org; Fri, 01 Nov 2013 02:04:45 -0400 Received: by mail-pd0-f169.google.com with SMTP id q10so3424583pdj.14 for ; Thu, 31 Oct 2013 23:04:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:content-transfer-encoding :subject:message-id:date:to:mime-version; bh=fpLf6uU4sS9WFgHyptlpGaSf4Zk1D0avgT39LZ08al8=; b=JdvxADf/LjUM1m2QZK9FwxhvDnh9wKAvAzZ5r3o2tGOmiL3lVKPMWHqQhuuEQeRAIS fZ2TO/9DAdjONud5SDMOhfq4BZE9nnEbBHSnr3Bly2RHhScchPmG2+4iJHpaJfsLYKFa 6G/30crA+NrAHNgZUT+UxKgw/T2XZeYOHp5VUlzDd1Y08lvmALbg7UMbv7Ty8pr6ZJrT RI0PNigPtHPscMoqZez4ceE0xPt68070pSARanfzf83fTHpO/ZHFwUxBvA9kjefLDNKU HCoSnUIOUnR4rWJT5UFx4yH+vqm+2vSEu0evIA12pjWLFsXVcQkKo4Jqem2JxCf9L6nT hZQQ== X-Gm-Message-State: ALoCoQnQLuwG8wYhCTLkdSJRxPD8Z60Zf5ZqUYbewJ9vPecnvNt7KarblaC88gyOzuZ4f6Hv2iRw X-Received: by 10.66.141.199 with SMTP id rq7mr1539127pab.9.1383285883588; Thu, 31 Oct 2013 23:04:43 -0700 (PDT) Received: from undr.majid.org (m208-9.dsl.rawbw.com. [198.144.208.9]) by mx.google.com with ESMTPSA id qw8sm8426720pbb.27.2013.10.31.23.04.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 31 Oct 2013 23:04:42 -0700 (PDT) From: Fazal Majid Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory Message-Id: <8836FBC9-C1AB-4B94-AC54-86FB8FDC559C@apsalar.com> Date: Thu, 31 Oct 2013 23:04:46 -0700 To: bug-gnu-emacs@gnu.org Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) X-Mailer: Apple Mail (2.1816) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 01 Nov 2013 02:24:20 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) 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 =93-psn=94, and if so, perform a = chdir(getenv(=93HOME=94)). 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 */ =97 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=3Dno' '--x-includes=3D/usr/X11R6/include' '--x-libraries=3D/usr/X11R6/lib' '--with-xpm' 'CC=3Dclang'' 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 o r 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) From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 04:19:13 2013 Received: (at 15776-done) by debbugs.gnu.org; 1 Nov 2013 08:19:13 +0000 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 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 Received: (qmail 28516 invoked by uid 89); 1 Nov 2013 08:19:07 -0000 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 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) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1816\)) Subject: Re: bug#15776: On Mac OS X 10.9 Mavericks, Cocoa Emacs starts in the root directory instead of the home directory From: =?windows-1252?Q?Jan_Dj=E4rv?= In-Reply-To: <8836FBC9-C1AB-4B94-AC54-86FB8FDC559C@apsalar.com> Date: Fri, 1 Nov 2013 09:19:04 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: <0C054F0B-78BB-4C39-89E1-BC6BB4CB0C4A@swipnet.se> References: <8836FBC9-C1AB-4B94-AC54-86FB8FDC559C@apsalar.com> To: Fazal Majid X-Mailer: Apple Mail (2.1816) X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello. This is fixed in the trunk. Jan D. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [176.10.222.34 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Debbugs-Envelope-To: 15776-done Cc: 15776-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 3.7 (+++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello. This is fixed in the trunk. Jan D. [...] Content analysis details: (3.7 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 2.7 RCVD_IN_PSBL RBL: Received via a relay in PSBL [176.10.222.34 listed in psbl.surriel.com] 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) 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 From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 01 12:07:24 2013 Received: (at control) by debbugs.gnu.org; 1 Nov 2013 16:07:24 +0000 Received: from localhost ([127.0.0.1]:57731 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcHFr-00035o-P9 for submit@debbugs.gnu.org; Fri, 01 Nov 2013 12:07:24 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:36230 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VcHFq-00035e-ES for control@debbugs.gnu.org; Fri, 01 Nov 2013 12:07:22 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1VcHFp-0003Zd-Ia for control@debbugs.gnu.org; Fri, 01 Nov 2013 12:07:21 -0400 Date: Fri, 01 Nov 2013 12:07:21 -0400 Message-Id: Subject: control message for bug 15776 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.5 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.5 (-----) merge 15607 15776 From unknown Sun Jun 15 08:22:58 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Nov 2013 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator