[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[OS X] new variable for app bundle path
From: |
Seiji Zenitani |
Subject: |
[OS X] new variable for app bundle path |
Date: |
Sat, 1 Sep 2007 21:37:35 -0400 |
Hi,
Is it possible to provide a new variable for Carbon port, which
stands for the application bundle path? The application bundle path
is a path for the double-clickable application icon (e.g. /
Applications/Emacs.app), while the other emacs directories such as
data-dir depend on the configuration option: /usr/local/share/share/
emacs/22.1/etc/ (default) or ${app_path}/Contents/Resources/etc/ (--
self-contained). Usually a platform-only variable may not be
favorable, but I believe the application bundle path is fundamental
enough. A patch to the EMACS_22_BASE branch is attached. It works
fine for me since June. Similar variable will be easily introduced
to the future Cocoa port, too.
Seiji Zenitani
address@hidden
--- src/mac.c.orig 2007-04-20 09:26:45.000000000 -0400
+++ src/mac.c 2007-06-09 18:54:42.000000000 -0400
@@ -93,6 +93,8 @@
static OSErr fsspec_to_posix_pathname P_ ((const FSSpec *, char *,
int));
#endif
+Lisp_Object Vmac_app_path;
+
/* When converting from Mac to Unix pathnames, /'s in folder names are
converted to :'s. This function, used in copying folder names,
performs a strncat and converts all character a to b in the copy of
@@ -5402,6 +5406,10 @@
if (stat (p, &st) == 0 && (st.st_mode & S_IFMT) == S_IFDIR)
setenv ("INFOPATH", p, 1);
}
+
+ strcpy (p, app_bundle_pathname);
+ Vmac_app_path = build_string(p);
+
}
#endif /* MAC_OSX */
@@ -5479,6 +5495,10 @@
This is not a POSIX locale ID, but an ICU locale ID. So encoding
information is not included. */);
Vmac_system_locale = mac_get_system_locale ();
+
+ DEFVAR_LISP ("mac-app-path", &Vmac_app_path,
+ doc: /* Path to the Emacs application bundle. */);
+
}
/* arch-tag: 29d30c1f-0c6b-4f88-8a6d-0558d7f9dbff
- [OS X] new variable for app bundle path,
Seiji Zenitani <=
- Re: [OS X] new variable for app bundle path, YAMAMOTO Mitsuharu, 2007/09/01
- Re: [OS X] new variable for app bundle path, Seiji Zenitani, 2007/09/02
- Re: [OS X] new variable for app bundle path, YAMAMOTO Mitsuharu, 2007/09/02
- Re: [OS X] new variable for app bundle path, Seiji Zenitani, 2007/09/02
- Re: [OS X] new variable for app bundle path, YAMAMOTO Mitsuharu, 2007/09/03
- Re: [OS X] new variable for app bundle path, Seiji Zenitani, 2007/09/03
- Re: [OS X] new variable for app bundle path, YAMAMOTO Mitsuharu, 2007/09/03