Org-mode 任务添加提醒

org-mode中的约会日程有提醒功能,这样设置就行:

;; ;;; 提醒
;; (require 'appt)
;; (appt-activate t);启用约会提醒
;; (setq appt-display-format 'window);提醒出现的方式
;; (setq appt-message-warning-time '5);在到期前5分钟提醒
;; (setq appt-display-duration '30);提醒持续时间(秒)
;; (setq appt-audible t)  ;声音提醒 -->没有响声!!?????
;; (setq appt-display-mode-line t);在状态栏显示时间(分钟)

但是任务TODO却没有提醒功能。搜索很久发现这些:

第一种方法:
(require 'appt)
(setq org-agenda-include-diary t)
(setq appt-time-msg-list nil)
(org-agenda-to-appt)

(defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
  "Pressing `r' on the agenda will also add appointments."
  (progn
    (setq appt-time-msg-list nil)
    (org-agenda-to-appt)))

(ad-activate 'org-agenda-redo)

(progn
  (appt-activate 1)
  (setq appt-display-format 'window)
  (setq appt-disp-window-function (function my-appt-disp-window))
  (defun my-appt-disp-window (min-to-app new-time msg)
    (call-process "~/bin/popup.py" nil 0 nil min-to-app msg new-time)))
这种方法可以调用外部程序,更灵活些。要注意的是,添加完日期和时间后,记得要在org agenda的视图(C-c a a)中按 r(刷新日程,把刚添加的时间包含进来。)。

第二种方法:
(defun wl-org-agenda-to-appt ()
  ;; Dangerous!!!  This might remove entries added by `appt-add' manually. 
  (org-agenda-to-appt t "TODO"))

(wl-org-agenda-to-appt)
(defadvice  org-agenda-redo (after org-agenda-redo-add-appts)
  "Pressing `r' on the agenda will also add appointments."
  (progn
    (let ((config (current-window-configuration)))
      (appt-check t)
      (set-window-configuration config))
    (wl-org-agenda-to-appt)))

(ad-activate 'org-agenda-redo)
这种方法只是在emacs中的buffer上显示一个frame,在里面显示提示信息。

注意TODO的时间格式应该是这样:

** TODO just a test
 <2015-05-1621:32>

可以按C-c . 选择日期和时间。

一定记得在Org Agenda里按 r

 

--End--

posted @ 2015-05-16 22:19  ibg  阅读(1513)  评论(0编辑  收藏  举报