summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch
blob: 5b5648956c808c339b157bef75bbdc150f078b2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Upstream status: https://gitlab.com/wavexx/gnus-desktop-notify.el/-/merge_requests/15

From 905e7ea41560783ec723aa0167911ba050f91789 Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Mon, 16 Jun 2025 09:24:07 +0900
Subject: [PATCH] Revert to use the notifications library by default.

The alert library project itself mentions that:

  For desktop notifications, the notifications package that is
  installed with emacs, provides a probably better alternative for
  most users.

and it appears true, as by default `alert' simply print notification
messages to the `*Messages*' buffer, which is not exactly a desktop
notification.

* gnus-desktop-notify.el (require): Require notifications first,
falling back to alert.
(gnus-desktop-notify-function): Test for the notifications feature
first.  Mention `notifications' is the default in its doc.
---
 gnus-desktop-notify.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el
index 97e65f3..a12e444 100644
--- a/gnus-desktop-notify.el
+++ b/gnus-desktop-notify.el
@@ -26,6 +26,11 @@
 
 ;;; Change Log:
 
+;; 1.5:
+;; * Revert to use the `notifications' library by default if
+;;   available.  The `alert' library doesn't do anything useful in its
+;;   default configuration.
+;;
 ;; 1.4:
 ;; * Use `alert' package by default if available (`gnus-desktop-notify-alert').
 ;;
@@ -83,8 +88,8 @@
 (require 'format-spec)
 (require 'gnus-group)
 
-(unless (require 'alert nil t)
-  (require 'notifications nil t))
+(unless (require 'notifications nil t)
+  (require 'alert nil t))
 
 (declare-function alert "alert")
 (declare-function notifications-notify "notifications")
@@ -96,8 +101,8 @@
   :group 'gnus)
 
 (defcustom gnus-desktop-notify-function
-  (cond ((featurep 'alert)         'gnus-desktop-notify-alert)
-        ((featurep 'notifications) 'gnus-desktop-notify-dbus)
+  (cond ((featurep 'notifications) 'gnus-desktop-notify-dbus)
+        ((featurep 'alert)         'gnus-desktop-notify-alert)
         (t                         'gnus-desktop-notify-send))
   "Notification backend used when a group receives new messages.
 The backend is passed the notification content as a single,
@@ -109,8 +114,8 @@ or fallback to the generic `gnus-desktop-notify-send' otherwise.
 
 The following functions are available (whose documentation see):
 
+`gnus-desktop-notify-dbus':  Use the `notifications' library (default).
 `gnus-desktop-notify-alert': Use the `alert' library.
-`gnus-desktop-notify-dbus':  Use the `notifications' library.
 `gnus-desktop-notify-send':  Call the `notify-send' program.
 `gnus-desktop-notify-exec':  Call a customizable program."
   :type 'function)
-- 
GitLab