Hooking some Emacs events to improve org-mode/MobileOrg integration

99封情书 提交于 2019-12-03 08:29:42
icyrock.com

I don't have Emacs installed on this machine, but here's what you can do:

  1. http://www.gnu.org/s/emacs/manual/html_node/elisp/Standard-Hooks.html - look for after-save-hook
  2. Startup things go to your .emacs file - if you put the call to org-mobile-pull at the end of this file, you will have it run every time you open Emacs
  3. Check this SO answer for a periodical run of some function: How to periodically run a task within emacs?

Hope this helps.

Here's what I use

(add-hook 
  'after-save-hook 
  (lambda () 
     (if (string= buffer-file-name "<path to my notes.org>") 
        (org-mobile-push)
     )
  ))
senf78

In this reply I've posted code that automatically pulls and then pushes after MobileOrg has synced, and automatically pushes whenever a relevant org file is saved. This makes it fully automatic and you don't have to wait for an hourly period.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!