比如说到21点、22点、23点提醒我该做任务中的事情。
我找到了一个插件叫org-alert,但是每次在任务前5分钟把当天所有没做的事情都提醒我了。
我Lisp水平有限,有思路但是改总出错。
如果目前没有别的解决方案,我们就一起改一下这个插件吧~
-----------------------解决方案-------------------------
已解决
(require 'appt)
(setq appt-time-msg-list nil) ;; clear existing appt list
(setq appt-display-interval '5) ;; warn every 5 minutes from t - appt-message-warning-time
(setq
appt-message-warning-time '15 ;; send first warning 15 minutes before appointment
appt-display-mode-line nil ;; don't show in the modeline
appt-display-format 'window) ;; pass warnings to the designated window function
(appt-activate 1) ;; activate appointment notification
(display-time) ;; activate time display
(org-agenda-to-appt) ;; generate the appt list from org agenda files on emacs launch
(run-at-time "24:01" 3600 'org-agenda-to-appt) ;; update appt list hourly
(add-hook 'org-finalize-agenda-hook 'org-agenda-to-appt) ;; update appt list on agenda view
(defun my-appt-display (min-to-app new-time msg)
(notify-osx
(format "Appointment in %s minutes" min-to-app) ;; passed to -title in terminal-notifier call
(format "%s" msg))) ;; passed to -message in terminal-notifier call
(setq appt-disp-window-function (function my-appt-display))
其中notify-osx
代码如下
(defun notify-osx (title message)
(call-process "terminal-notifier"
nil 0 nil
"-group" "Emacs"
"-title" title
"-sender" "org.gnu.Emacs"
"-message" message
"-activate" "oeg.gnu.Emacs"))
需要额外安装插件terminal-notifier
,可以参考这里
每次打开 Emacs/Agenda View 自动更新通知内容; 每个任务前15分钟通知,每5分钟提醒一次