[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org-notify f16d775731 03/23: Allow popping up multiple
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org-notify f16d775731 03/23: Allow popping up multiple notification windows. |
Date: |
Mon, 25 Jul 2022 12:57:56 -0400 (EDT) |
branch: externals/org-notify
commit f16d77573128697977fa327f977d7b4c7a0ce8d3
Author: Peter Münster <pmrb@free.fr>
Commit: Peter Münster <pmrb@free.fr>
Allow popping up multiple notification windows.
---
org-notify.el | 27 ++++++++++++++++++++++-----
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/org-notify.el b/org-notify.el
index 9f28d4d5e6..0fdeca8e4f 100644
--- a/org-notify.el
+++ b/org-notify.el
@@ -59,7 +59,6 @@
(require 'org-element)
(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"
@@ -225,7 +224,9 @@ for SECS is 50."
(defun orgntf-delete-window (buffer)
"Delete the notification window."
- (let ((appt-buffer-name buffer) (appt-audible nil))
+ (require 'appt)
+ (let ((appt-buffer-name buffer)
+ (appt-audible nil))
(appt-delete-window)))
(defun orgntf-on-close (id reason)
@@ -248,9 +249,25 @@ for SECS is 50."
; todo
)
+(defun orgntf-select-highest-window ()
+ "Select the highest window on the frame, that is not is not an
+org-notify window. Copied mostly from `appt-select-lowest-window'."
+ (let ((highest-window (selected-window))
+ (bottom-edge (nth 3 (window-edges)))
+ next-bottom-edge)
+ (walk-windows (lambda (w)
+ (when (and
+ (not (string-match "^\\*org-notify-.*\\*$"
+ (buffer-name
+ (window-buffer w))))
+ (> bottom-edge (setq next-bottom-edge
+ (nth 3 (window-edges w)))))
+ (setq bottom-edge next-bottom-edge
+ highest-window w))) 'nomini)
+ (select-window highest-window)))
+
(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))
@@ -263,9 +280,9 @@ for SECS is 50."
(progn (set-buffer buf) (display-buffer buf))
(unless (or (special-display-p (buffer-name buf))
(same-window-p (buffer-name buf)))
- (appt-select-lowest-window)
+ (orgntf-select-highest-window)
(when (>= (window-height) (* 2 window-min-height))
- (select-window (split-window))))
+ (select-window (split-window nil nil 'above))))
(switch-to-buffer buf))
(setq buffer-read-only nil buffer-undo-list t)
(erase-buffer)
- [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, 2022/07/25
- [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 <=
- [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
- [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