我怎么能有makefile / shell脚本调用/Applications/application.app?


4

操作系统Mac OS X 10.6.6 emacs 23.2.1

我目前正在尝试使用他们提出的make解决方案在carbon emacs上安装magit。我是一个几乎完整的makefile newby所以我可能完全走错了路。Makefile显示:

%.elc: %.el
$(BATCH) --eval '(byte-compile-file "$<")'

它扩展到:

emacs -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \".\") load-path))" --eval '(byte-compile-file "magit.el")'

我明白了什么。然而它回来了:

Cannot open load file: subst-ksc

经过一番谷歌搜索后发现了一些丢失的库。我还意识到扩展命令中引用的emacs指向/usr/bin/emacs哪个是大文件,我没有看到正常的lisp / site-lisp / etc目录。我也知道我喜欢的emacs是碳封面/Application/Emacs.app,只是在点击它时打开,或者我可以用终端打开它:

open /Application/MyApp.app

最后标题问题:如何使用应用程序目录中的Emacs.app制作Makefile?我希望有人知道答案,或者可以指出我的选择。

问候,Jeroen。


我认为这属于

site-lisp位于:/usr/share/emacs/site-lisp

Answers:


5

要从shell使用Emacs.app,您需要嵌入其中的unix可执行文件。它在Emacs.app/Contents/MacOS/Emacs(我没有这个版本的emacs所以大写可能不同)

另一种方法是使用open来使用open从工作区启动任何应用程序。

例如

open -a Emacs.app --args <all those passed to emacs>

1
谢谢您的回答!第一个选项很顺利,谢谢(甚至大写都是现货!)。我无法获得第二种选择。open -a确实将emacs带到了前台(它已经打开)但就是这样。批处理/ eval选项/属性似乎被忽略:open -a /Applications/Emacs22.app --args -batch -q -no-site-file -eval“(setq load-path(cons(expand-file-name) \“。\”)load-path))“ - eval'(byte-compile-file”magit.el“)'
dr jerry

从头开始调用(emacs关闭)给出错误消息:LSOpenURLsWithRole()对于应用程序/Applications/Emacs.app失败,错误为-10810。
史密斯博士

3

我正在回答一个较旧的问题,以防万一其他人通过Google发生这种情况。

正如Mark指出的那样,要使用Emacs.app可执行文件对文件进行字节编译,您需要替换emacs/usr/bin/emacs在Makefile中使用/Applications/Emacs.app/Contents/MacOS/Emacs。我相信通常字节编译的文件在不同版本的Emacs中是不兼容的,所以在安装用于Emacs.app的软件包时,你应该使用这个可执行文件对其进行字节编译,而不是使用默认的Apple安装/usr/bin/emacs(这是一个在我的10.6系统上版本22 emacs)。

如果您确实需要运行/usr/bin/emacs其他原因,请注意EMACSLOADPATH不包含属于较新Emacs的文件。这是错误消息的一个潜在原因,例如

Cannot open load file: subst-ksc

从shell调用emacs为

EMACSLOADPATH=/usr/share/emacs/22.1/leim:/usr/share/emacs/22.1/lisp:/usr/share/emacs/22.1/site-lisp emacs

应该做的伎俩。

希望这有助于其他人!

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.