简体   繁体   English

Emacs批处理模式无法识别osx中的组织文件

[英]Emacs batch mode doesn't recognize org files in osx

I am trying to use emacs -batch to create a csv file that shows all the todo items in my org-mode file. 我正在尝试使用emacs -batch创建一个csv文件,该文件显示我的组织模式文件中的所有待办事项。 It works great on my linux box, but I can't get it to work in OSX. 它可以在我的Linux机器上很好地工作,但是我无法在OSX中使用它。

Here is the command I am using: 这是我正在使用的命令:

emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda-csv "t")'

OSX doesn't recognize org-batch-agenda-csv, but it will recognize a non-csv version: OSX无法识别org-batch-agenda-csv,但会识别非csv版本:

emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda "t")'

However, this still doesn't work. 但是,这仍然行不通。 It comes back with the following response: 它返回以下响应:

Agenda file ~/projects.org is not in `org-mode'

I think I have narrowed down the root problem. 我想我已经缩小了根本问题。 Emacs and emacs as opened by the terminal work differently. 终端打开的Emacs和emacs的工作方式不同。 Emacs will autorecognize my org files, but if I open them in the terminal, emacs will start in fundamental mode. Emacs将自动识别我的组织文件,但是如果我在终端中打开它们,则emacs将以基本模式启动。 I think if I could get emacs terminal mode to auto-recognize org-files the problem would go away. 我认为,如果我可以使用emacs终端模式来自动识别组织文件,则问题将消失。 Oddly, it doesn't seem to have trouble auto-recognizing other file types. 奇怪的是,自动识别其他文件类型似乎没有问题。 It is almost like it isn't actually reading my .emacs file. 几乎就像它实际上没有在读取我的.emacs文件一样。

I can't seem to find anything through google. 我似乎无法通过Google找到任何东西。 Hopefully I'm not the only person who has this issue. 希望我不是唯一遇到此问题的人。

Appreciate any pointers you can help me with. 感谢您可以帮助我的任何指示。

-- Russ -拉斯

Thanks Lindydancer. 感谢Lindydancer。 So for some reason OSX terminal opens up emacs version 22 instead of version 24. The same command works great if it is called as the binary file from Applications file. 因此,出于某些原因,OSX终端会打开emacs版本22而不是版本24。如果从Applications文件中将其称为二进制文件,则该命令也很有用。

/Applications/Emacs.app/Contents/MacOS/Emacs -batch -l ~/.emacs org-mode -eval '(org-batch-agenda "t")'

Thanks for the help! 谢谢您的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM