From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: about the undocumented options -psn_* Date: Thu, 17 Oct 2013 11:56:49 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1381978623 10918 80.91.229.3 (17 Oct 2013 02:57:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Oct 2013 02:57:03 +0000 (UTC) Cc: emacs-devel , Darren Hoo To: Jan =?ISO-8859-1?Q?Dj=E4rv?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 17 04:57:07 2013 Return-path: Envelope-to: ged-emacs-devel@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 1VWdlq-0007xL-If for ged-emacs-devel@m.gmane.org; Thu, 17 Oct 2013 04:57:06 +0200 Original-Received: from localhost ([::1]:50066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdlq-000243-AJ for ged-emacs-devel@m.gmane.org; Wed, 16 Oct 2013 22:57:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdlj-00023c-Ax for emacs-devel@gnu.org; Wed, 16 Oct 2013 22:57:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWdle-0007vZ-Di for emacs-devel@gnu.org; Wed, 16 Oct 2013 22:56:59 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:62271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWdld-0007uP-Tl for emacs-devel@gnu.org; Wed, 16 Oct 2013 22:56:54 -0400 Original-Received: from fermat.math.s.chiba-u.ac.jp (fermat [133.82.132.10]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id B478FC0563; Thu, 17 Oct 2013 11:56:49 +0900 (JST) In-Reply-To: User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 133.82.132.2 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:164260 Archived-At: >>>>> On Wed, 16 Oct 2013 18:40:52 +0200, Jan Dj=E4rv = 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 pro= cess 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 =3D=3D=3D 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=3D"$(basename "$0")" set "$(dirname "$0")/${filename%.sh}" "$@" =20 + 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 +=20 case $(sw_vers -productVersion) in 10.[0-7]|10.[0-7].*) # "$HOME/.MacOSX/environment.plist" is ignored on OS X 10.8. =3D=3D=3D 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 */ =20 - #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) =3D= =3D 0) - chdir (getenv ("HOME")); - #endif /* HAVE_MACGUI */ -=20 #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 ----