[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-notify 160c7eb64d 12/23: org-notify-body-text: Add
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-notify 160c7eb64d 12/23: org-notify-body-text: Add time-stamp to text. |
Date: |
Mon, 25 Jul 2022 12:57:57 -0400 (EDT) |
branch: externals/org-notify
commit 160c7eb64d55d5ddc8f8a6cd9cf7c6f6da8099ec
Author: Peter Münster <pmrb@free.fr>
Commit: Peter Münster <pmrb@free.fr>
org-notify-body-text: Add time-stamp to text.
---
org-notify.el | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/org-notify.el b/org-notify.el
index 7ea2c62977..0b98f19df1 100644
--- a/org-notify.el
+++ b/org-notify.el
@@ -265,20 +265,21 @@ SECS is 20."
(run-with-timer (or (plist-get plist :duration) 3) nil
'cancel-timer timer)))
-(defun org-notify-body-text (deadline)
- "Make human readable string for remaining time to deadline.
-This time in seconds is provided by DEADLINE."
+(defun org-notify-body-text (plist)
+ "Make human readable string for remaining time to deadline."
(require 'gnus-art)
- (replace-regexp-in-string
- " in the future" ""
- (article-lapsed-string (time-add (current-time)
- (seconds-to-time deadline))
- 2)))
+ (format "%s\n(%s)"
+ (replace-regexp-in-string
+ " in the future" ""
+ (article-lapsed-string
+ (time-add (current-time)
+ (seconds-to-time (plist-get plist :deadline))) 2))
+ (plist-get plist :timestamp)))
(defun org-notify-action-email (plist)
"Send email to user."
(compose-mail user-mail-address (concat "TODO: " (plist-get plist :heading)))
- (insert (org-notify-body-text (plist-get plist :deadline)))
+ (insert (org-notify-body-text plist))
(funcall send-mail-function)
(flet ((yes-or-no-p (prompt) t))
(kill-buffer)))
@@ -321,7 +322,7 @@ org-notify window. Mostly copied from
`appt-select-lowest-window'."
(setq buffer-read-only nil buffer-undo-list t)
(erase-buffer)
(insert (format "TODO: %s, %s.\n" (get :heading)
- (org-notify-body-text (get :deadline))))
+ (org-notify-body-text plist)))
(let ((timer (run-with-timer (or (get :duration) 10) nil
'org-notify-delete-window buf)))
(dotimes (i (/ (length org-notify-actions) 2))
@@ -340,7 +341,7 @@ org-notify window. Mostly copied from
`appt-select-lowest-window'."
(let* ((duration (plist-get plist :duration))
(id (notifications-notify
:title (plist-get plist :heading)
- :body (org-notify-body-text (plist-get plist :deadline))
+ :body (org-notify-body-text plist)
:timeout (if duration (* duration 1000))
:actions org-notify-actions
:on-action 'org-notify-on-action-notify)))
@@ -355,8 +356,8 @@ terminal an emacs window."
(org-notify-action-window plist)))
;;; Provide a minimal default setup.
-(org-notify-add 'default '(:time "1h" :actions org-notify-action-message
- :period "2m"))
+(org-notify-add 'default '(:time "1h" :actions -notify/window
+ :period "2m" :duration 60))
(provide 'org-notify)
- [elpa] externals/org-notify d2e1c297fa 17/23: README.md: this module is no more in the org-mode distribution, (continued)
- [elpa] externals/org-notify d2e1c297fa 17/23: README.md: this module is no more in the org-mode distribution, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 3a9c55aabd 19/23: Fix package-lint errors, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify d61af2d334 04/23: Use common prefix for all objects., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 75df171a0a 05/23: Allow also suffixes for predefined functions., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 13afc93024 08/23: Add support for sending emails., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify dd342f86d6 11/23: org-notify-audible: new configuration variable., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 76f75705b3 13/23: org-notify-on-action: New action: show the entry., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 1c65ee9597 16/23: org-notify.el: update to version in org-mode distribution, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify f566817937 10/23: New notification type: "notify or window"., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 5875631410 09/23: Treat only one file per call of org-notify-process., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 160c7eb64d 12/23: org-notify-body-text: Add time-stamp to text.,
ELPA Syncer <=
- [elpa] externals/org-notify e4bdac5a14 15/23: Create README.md, ELPA Syncer, 2022/07/25