From: Seiji Zenitani <zenitani@mac.com>
To: emacs-devel@gnu.org
Subject: [OS X] new variable for app bundle path
Date: Sat, 1 Sep 2007 21:37:35 -0400 [thread overview]
Message-ID: <61C33CA6-BE86-48EF-8B7E-E2CE093F8876@mac.com> (raw)
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
zenitani@mac.com
--- 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
next reply other threads:[~2007-09-02 1:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-02 1:37 Seiji Zenitani [this message]
2007-09-02 2:11 ` [OS X] new variable for app bundle path YAMAMOTO Mitsuharu
2007-09-03 2:54 ` Seiji Zenitani
2007-09-03 3:16 ` YAMAMOTO Mitsuharu
2007-09-03 3:59 ` Seiji Zenitani
2007-09-03 4:18 ` YAMAMOTO Mitsuharu
2007-09-03 20:32 ` Seiji Zenitani
2007-09-04 0:15 ` YAMAMOTO Mitsuharu
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61C33CA6-BE86-48EF-8B7E-E2CE093F8876@mac.com \
--to=zenitani@mac.com \
--cc=emacs-devel@gnu.org \
/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 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).