【问题标题】:org-mobile-push from bash/crontab来自 bash/crontab 的 org-mobile-push
【发布时间】:2016-10-02 17:51:45
【问题描述】:

在我以前的机器上,我会通过 crontab 执行一个包含以下内容的脚本:

#!/bin/bash
emacs --batch --load ~/.emacs --eval "(org-mobile-pull)" --eval "(org-mobile-push)"

在我的新机器上,我使用旧机器上的 .emacs、init.el 和 custom.el。但是如果我在我的新机器上执行这个脚本,我想要推送的文件不会被推送。显然,即使加载了 init.el 和 custom.el,变量 org-mobile-files 也没有被注意。更糟糕的是:虽然创建了正确的议程.org 文件,但如果我进行同步,我的 Android 手机上会出现一个空议程。如果我从正在运行的 emacs 中执行 org-mobile-push 并打开了一个 org 文件,一切正常。如何重写我的脚本以再次从 bash 或 crontab 推送我的文件/议程?

【问题讨论】:

    标签: android bash emacs org-mode


    【解决方案1】:

    好的,我终于找到了解决方案/解决方法。我更改了脚本以首先打开一个 org 文件。我的脚本现在看起来像:

    #!/bin/bash
    emacs ~/Dropbox/path-to-org-files-directory/some-file.org --batch --load ~/.emacs --eval "(org-mobile-pull)" --eval "(org-mobile-push)"
    

    这样我的脚本就可以工作了。奇怪的是:在这里回答我的问题之前,我已经尝试过:

    #!/bin/bash
    emacs ~/some-file.org --batch --load ~/.emacs --eval "(org-mobile-pull)" --eval "(org-mobile-push)"
    

    这不起作用...事实上,在正在运行的 emacs 会话中打开我的主目录中的 some-file.org,然后使用 org-mobile-push 也不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-03
      • 2016-09-17
      • 2011-06-22
      • 1970-01-01
      • 2013-04-30
      相关资源
      最近更新 更多