From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
To: "Jan Djärv" <jan.h.d@swipnet.se>
Cc: emacs-devel <emacs-devel@gnu.org>, Darren Hoo <darren.hoo@gmail.com>
Subject: Re: about the undocumented options -psn_*
Date: Thu, 17 Oct 2013 11:56:49 +0900 [thread overview]
Message-ID: <wlk3hcvc3y.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <E8D9E38D-3B16-4A46-A25E-8623D35524A3@swipnet.se>
>>>>> On Wed, 16 Oct 2013 18:40:52 +0200, Jan Djärv <jan.h.d@swipnet.se> said:
> Hello.
> When started from the GUI (Dock, Finder, open), the launcher adds a -psn_hi_low option where hi and low are numbers (hi usually 0) that form the process serial number. Not sure what it is used for. If however you pass any argument to the program, like:
> % open -a Emacs --args -Q
> no -psn-option is passed.
> In Emacs it acts like a "started from GUI"-detector.
I'm thinking about stopping relying on this option for changing the
default directory in the next version of the Mac port (planned shortly
after the release of OS X Mavericks.)
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
=== modified file 'mac/Emacs.app/Contents/MacOS/Emacs.sh'
*** mac/Emacs.app/Contents/MacOS/Emacs.sh 2013-09-21 09:48:19 +0000
--- mac/Emacs.app/Contents/MacOS/Emacs.sh 2013-10-17 02:45:32 +0000
***************
*** 23,28 ****
--- 23,37 ----
filename="$(basename "$0")"
set "$(dirname "$0")/${filename%.sh}" "$@"
+ case $PWD in
+ /)
+ # As of OS X 10.8, this is always the case if invoked from the
+ # launch service. Just in case this behavior is changed on
+ # future versions...
+ cd
+ ;;
+ esac
+
case $(sw_vers -productVersion) in
10.[0-7]|10.[0-7].*)
# "$HOME/.MacOSX/environment.plist" is ignored on OS X 10.8.
=== modified file 'src/emacs.c'
*** src/emacs.c 2013-02-09 07:26:28 +0000
--- src/emacs.c 2013-10-17 02:45:32 +0000
***************
*** 794,809 ****
}
#endif /* HAVE_PERSONALITY_LINUX32 */
- #ifdef HAVE_MACGUI
- /* Skip process serial number passed in the form -psn_x_y as
- command-line argument. The WindowServer adds this option when
- Emacs is invoked from the Finder or by the `open' command. In
- these cases, the working directory becomes `/', so we change it
- to the user's home directory. */
- if (argc > skip_args + 1 && strncmp (argv[skip_args+1], "-psn_", 5) == 0)
- chdir (getenv ("HOME"));
- #endif /* HAVE_MACGUI */
-
#if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK)
/* Extend the stack space available.
Don't do that if dumping, since some systems (e.g. DJGPP)
--- 794,799 ----
prev parent reply other threads:[~2013-10-17 2:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 11:40 about the undocumented options -psn_* Darren Hoo
2013-10-16 16:40 ` Jan Djärv
2013-10-17 2:56 ` YAMAMOTO Mitsuharu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlk3hcvc3y.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--cc=darren.hoo@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jan.h.d@swipnet.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.