* about the undocumented options -psn_*
@ 2013-10-16 11:40 Darren Hoo
2013-10-16 16:40 ` Jan Djärv
0 siblings, 1 reply; 3+ messages in thread
From: Darren Hoo @ 2013-10-16 11:40 UTC (permalink / raw)
To: emacs-devel
This is the related ChangeLog entry:
2005-11-23 YAMAMOTO Mitsuharu
* emacs.c (main) [MAC_OSX]: Change working directory to home
directory if `-psn_*' option is specified.
what's the meaning and usage of -psn_*?
I ask this because I want to figure out in which cases it is
necessary to change
working directory to home directory.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about the undocumented options -psn_*
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
0 siblings, 1 reply; 3+ messages in thread
From: Jan Djärv @ 2013-10-16 16:40 UTC (permalink / raw)
To: Darren Hoo; +Cc: emacs-devel
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.
Jan D.
16 okt 2013 kl. 13:40 skrev Darren Hoo <darren.hoo@gmail.com>:
> This is the related ChangeLog entry:
>
> 2005-11-23 YAMAMOTO Mitsuharu
>
>
> * emacs.c (main) [MAC_OSX]: Change working directory to home
>
> directory if `-psn_*' option is specified.
>
>
> what's the meaning and usage of -psn_*?
>
> I ask this because I want to figure out in which cases it is
> necessary to change
> working directory to home directory.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: about the undocumented options -psn_*
2013-10-16 16:40 ` Jan Djärv
@ 2013-10-17 2:56 ` YAMAMOTO Mitsuharu
0 siblings, 0 replies; 3+ messages in thread
From: YAMAMOTO Mitsuharu @ 2013-10-17 2:56 UTC (permalink / raw)
To: Jan Djärv; +Cc: emacs-devel, Darren Hoo
>>>>> 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 ----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-10-17 2:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).