emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about the undocumented options -psn_*


From: YAMAMOTO Mitsuharu
Subject: Re: about the undocumented options -psn_*
Date: Thu, 17 Oct 2013 11:56:49 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Wed, 16 Oct 2013 18:40:52 +0200, Jan Djärv <address@hidden> 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
                                address@hidden

=== 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 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]