[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-notify caea28a77f 02/23: org-notify.el: fix byte-co
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-notify caea28a77f 02/23: org-notify.el: fix byte-compilation |
Date: |
Mon, 25 Jul 2022 12:57:56 -0400 (EDT) |
branch: externals/org-notify
commit caea28a77f295d3d5eb8dfa5df9dd8de4684e783
Author: Peter Münster <pmrb@free.fr>
Commit: Peter Münster <pmrb@free.fr>
org-notify.el: fix byte-compilation
(orgntf-time-measure): not needed, since we have elp.el
---
org-notify.el | 68 +++++++++++++++++++++++++++--------------------------------
1 file changed, 31 insertions(+), 37 deletions(-)
diff --git a/org-notify.el b/org-notify.el
index fdce7863ee..9f28d4d5e6 100644
--- a/org-notify.el
+++ b/org-notify.el
@@ -57,7 +57,10 @@
(eval-when-compile (require 'cl))
(require 'org-element)
-(require 'appt)
+
+(declare-function appt-delete-window "appt" ())
+(declare-function appt-select-lowest-window "appt" ())
+(declare-function notifications-notify "notifications" (&rest params))
(defconst orgntf-actions '("done" "done" "hour" "one hour later" "day"
"one day later" "week" "one week later")
@@ -123,26 +126,16 @@
(defun orgntf-maybe-too-late (diff period heading)
"Print waring message, when notified significantly later than defined by
- PERIOD."
+PERIOD."
(if (> (/ diff period) 1.5)
(message "Warning: notification for \"%s\" behind schedule!" heading))
t)
-(defun orgntf-time-measure (func)
- "Measure execution time of FUNC, when verbose output is active."
- (if orgntf-verbose
- (let ((start (org-float-time))
- (res (funcall func)))
- (message "Execution time of `%s': %0.3fs" (symbol-name func)
- (- (org-float-time) start))
- res)
- (funcall func)))
-
(defun orgntf-process ()
"Process the todo-list, and possibly notify user about upcoming or
- forgotten tasks."
+forgotten tasks."
(macrolet ((prm (k) `(plist-get prms ,k)) (td (k) `(plist-get todo ,k)))
- (dolist (todo (orgntf-time-measure 'orgntf-todo-list))
+ (dolist (todo (orgntf-todo-list))
(let* ((deadline (td :deadline)) (heading (td :heading))
(uid (td :uid)) (last-run-sym
(intern (concat ":last-run-" uid))))
@@ -165,33 +158,33 @@
(defun org-notify-add (name &rest params)
"Add a new notification type. The NAME can be used in Org-mode property
- `notify'. If NAME is `default', the notification type applies for todo items
- without the `notify' property. This file predefines such a default
- notification type.
-
- Each element of PARAMS is a list with parameters for a given time
- distance to the deadline. This distance must increase from one element to
- the next.
- List of possible parameters:
- :time Time distance to deadline, when this type of notification shall
- start. It's a string: an integral value (positive or negative)
- followed by a unit (s, m, h, d, w, M).
- :actions A function or a list of functions to be called to notify the
- user.
- :period Optional: can be used to repeat the actions periodically. Same
- format as :time.
- :duration Some actions use this parameter to specify the duration of the
- notification. It's an integral number in seconds.
-
- For the actions, you can use your own functions or some of the predefined
- ones, whose names are prefixed with `org-notify-action-'."
+`notify'. If NAME is `default', the notification type applies for todo items
+without the `notify' property. This file predefines such a default
+notification type.
+
+Each element of PARAMS is a list with parameters for a given time
+distance to the deadline. This distance must increase from one element to
+the next.
+List of possible parameters:
+ :time Time distance to deadline, when this type of notification shall
+ start. It's a string: an integral value (positive or negative)
+ followed by a unit (s, m, h, d, w, M).
+ :actions A function or a list of functions to be called to notify the
+ user.
+ :period Optional: can be used to repeat the actions periodically. Same
+ format as :time.
+ :duration Some actions use this parameter to specify the duration of the
+ notification. It's an integral number in seconds.
+
+For the actions, you can use your own functions or some of the predefined
+ones, whose names are prefixed with `org-notify-action-'."
(setq orgntf-map (plist-put orgntf-map name params)))
(defun org-notify-start (&optional secs)
"Start the notification daemon. If SECS is positive, it's the period in
- seconds for processing the notifications, and if negative, notifications
- will be checked only when emacs is idle for -SECS seconds. The default value
- for SECS is 50."
+seconds for processing the notifications, and if negative, notifications
+will be checked only when emacs is idle for -SECS seconds. The default value
+for SECS is 50."
(if orgntf-timer
(org-notify-stop))
(setq secs (or secs 50)
@@ -257,6 +250,7 @@
(defun org-notify-action-window (plist)
"Pop up a window, mostly copied from `appt-disp-window'."
+ (require 'appt)
(save-excursion
(macrolet ((get (k) `(plist-get plist ,k)))
(let ((this-window (selected-window))
- [elpa] branch externals/org-notify created (now f47c137a96), ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 59d14e2893 01/23: first commit, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify caea28a77f 02/23: org-notify.el: fix byte-compilation,
ELPA Syncer <=
- [elpa] externals/org-notify 1ca7fe811d 07/23: Time to deadline in pop-up window now more readable., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify f16d775731 03/23: Allow popping up multiple notification windows., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 96ddaf1d87 14/23: org-notify-on-action: Raise focus of frame, when showing the todo-entry., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 6aac808924 20/23: Merge pull request #5 from jgkamat/jay/melpa, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 148ec5ad27 22/23: Integrate enhancements from Stefan Monnier, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify d05ef86787 18/23: org-notify.el (org-notify-on-action): Pressing "done" should never act on, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify 704e023ad8 21/23: Simplify call to time-add in org-notify-body-text, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify f47c137a96 23/23: Add a todo list, ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify d24a1525c1 06/23: Remove obsolete org-notify-verbose., ELPA Syncer, 2022/07/25
- [elpa] externals/org-notify d2e1c297fa 17/23: README.md: this module is no more in the org-mode distribution, ELPA Syncer, 2022/07/25