emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ement 909abd4442: Fix: (ement-notify) Demote errors


From: ELPA Syncer
Subject: [elpa] externals/ement 909abd4442: Fix: (ement-notify) Demote errors
Date: Sat, 24 Jun 2023 06:57:47 -0400 (EDT)

branch: externals/ement
commit 909abd44427ba1d3b9e83eda422c520dbe55880b
Author: Adam Porter <adam@alphapapa.net>
Commit: Adam Porter <adam@alphapapa.net>

    Fix: (ement-notify) Demote errors
    
    Better to demote an error to a message and continue
    syncing (notifications are sent from the main event-processing loop,
    so an error interrupts syncing).
---
 README.org      |  3 +++
 ement-notify.el | 25 +++++++++++++------------
 2 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org
index 6554f1268c..08ef48d3f0 100644
--- a/README.org
+++ b/README.org
@@ -306,6 +306,9 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 *Changes*
 + Command ~ement-room-image-show~ is not used for mouse events.
 
+*Fixes*
++ Don't stop syncing if an error is signaled while sending a notification.
+
 ** 0.10
 
 *Security Fixes*
diff --git a/ement-notify.el b/ement-notify.el
index df5357e36b..eedef263cd 100644
--- a/ement-notify.el
+++ b/ement-notify.el
@@ -183,18 +183,19 @@ margins in Emacs.  But it's useful, anyway."
   "Send notifications for EVENT in ROOM on SESSION.
 Sends if all of `ement-notify-ignore-predicates' return nil.
 Does not do anything if session hasn't finished initial sync."
-  (when (and (ement-session-has-synced-p session)
-             (cl-loop for pred in ement-notify-ignore-predicates
-                      never (funcall pred event room session)))
-    (when (and ement-notify-dbus-p
-               (run-hook-with-args-until-success 
'ement-notify-notification-predicates event room session))
-      (ement-notify--notifications-notify event room session))
-    (when (run-hook-with-args-until-success 'ement-notify-log-predicates event 
room session)
-      (ement-notify--log-to-buffer event room session))
-    (when (run-hook-with-args-until-success 'ement-notify-mention-predicates 
event room session)
-      (ement-notify--log-to-buffer event room session :buffer-name "*Ement 
Mentions*"))
-    (when (run-hook-with-args-until-success 
'ement-notify-mark-frame-urgent-predicates event room session)
-      (ement-notify--mark-frame-urgent event room session))))
+  (with-demoted-errors "ement-notify: Error: %S"
+    (when (and (ement-session-has-synced-p session)
+               (cl-loop for pred in ement-notify-ignore-predicates
+                        never (funcall pred event room session)))
+      (when (and ement-notify-dbus-p
+                 (run-hook-with-args-until-success 
'ement-notify-notification-predicates event room session))
+        (ement-notify--notifications-notify event room session))
+      (when (run-hook-with-args-until-success 'ement-notify-log-predicates 
event room session)
+        (ement-notify--log-to-buffer event room session))
+      (when (run-hook-with-args-until-success 'ement-notify-mention-predicates 
event room session)
+        (ement-notify--log-to-buffer event room session :buffer-name "*Ement 
Mentions*"))
+      (when (run-hook-with-args-until-success 
'ement-notify-mark-frame-urgent-predicates event room session)
+        (ement-notify--mark-frame-urgent event room session)))))
 
 (defun ement-notify--mark-frame-urgent (_event room _session)
   "Mark frame showing ROOM's buffer as urgent.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]