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

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

[elpa] externals/ement 36db1869dd 04/13: Change/Fix


From: ELPA Syncer
Subject: [elpa] externals/ement 36db1869dd 04/13: Change/Fix
Date: Fri, 8 Sep 2023 06:58:07 -0400 (EDT)

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

    Change/Fix
---
 ement-notifications.el | 23 +++++++++++++----------
 ement-notify.el        |  2 +-
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/ement-notifications.el b/ement-notifications.el
index b14138021f..8d4a4e4169 100644
--- a/ement-notifications.el
+++ b/ement-notifications.el
@@ -89,15 +89,18 @@ to `ement-api', which see."
   (interactive (list (ement-complete-session)
                      :only (when current-prefix-arg
                              "highlight")))
-  (let ((endpoint "notifications")
-        (params (remq nil
-                      (list (when from
-                              (list "from" from))
-                            (when limit
-                              (list "limit" (number-to-string limit)))
-                            (when only
-                              (list "only" only))))))
-    (ement-api session endpoint :params params :then then :else else)))
+  (if-let ((buffer (get-buffer "*Ement Notifications*")))
+      (pop-to-buffer buffer)
+    (let ((endpoint "notifications")
+          (params (remq nil
+                        (list (when from
+                                (list "from" from))
+                              (when limit
+                                (list "limit" (number-to-string limit)))
+                              (when only
+                                (list "only" only))))))
+      (ement-api session endpoint :params params :then then :else else)
+      (ement-message "Fetching notifications for <%s>..." (ement-user-id 
(ement-session-user session))))))
 
 (cl-defun ement-notifications-callback (session data &key (buffer 
(ement-notifications--log-buffer)))
   "Callback for `ement-notifications' on SESSION which receives DATA."
@@ -151,7 +154,7 @@ to `ement-api', which see."
        :else (lambda (plz-error)
                (setf (buffer-local-value 'ement-notifications-retro-loading 
buffer) nil)
                (ement-api-error plz-error)))
-      (message "Loading %s earlier messages..." number)
+      (ement-message "Loading %s earlier messages..." number)
       (setf ement-notifications-retro-loading t))))
 
 ;;;; Functions
diff --git a/ement-notify.el b/ement-notify.el
index 918955d962..58e27d0e12 100644
--- a/ement-notify.el
+++ b/ement-notify.el
@@ -171,7 +171,7 @@ margins in Emacs.  But it's useful, anyway."
   "Switch to \"*Ement Notifications*\" buffer."
   (declare (function ement-notifications--log-buffer "ement-notifications"))
   (interactive)
-  (switch-to-buffer (ement-notifications--log-buffer :name "*Ement 
Notifications*")))
+  (call-interactively #'ement-notifications))
 
 (defun ement-notify-switch-to-mentions-buffer ()
   "Switch to \"*Ement Mentions*\" buffer."



reply via email to

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