guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 8d419976b21d61a1b3c6d919c593cacdf16a37aa
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Fri Jun 13 12:44:32 2025 +0900
gnu: Add emacs-gnus-desktop-notify.
* gnu/packages/emacs-xyz.scm (emacs-gnus-desktop-notify): New variable.
* gnu/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch:
New
file.
* gnu/packages/patches/emacs-gnus-desktop-notify-rescan.patch: Likewise.
* gnu/local.mk (dist_patch_DATA): Register them.
Change-Id: I7f25870949411f8f1326871d67bdbdbe59feef6b
Signed-off-by: Liliana Marie Prikler <[email protected]>
---
gnu/local.mk | 2 +
gnu/packages/emacs-xyz.scm | 37 +++++++++++
...acs-gnus-desktop-notify-fix-notifications.patch | 76 ++++++++++++++++++++++
.../patches/emacs-gnus-desktop-notify-rescan.patch | 37 +++++++++++
4 files changed, 152 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 2541afa86f..b2d54ba8ae 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1230,6 +1230,8 @@ dist_patch_DATA =
\
%D%/packages/patches/emacs-eglot-x-fix-apply-text-edits.patch
\
%D%/packages/patches/emacs-exec-path.patch \
%D%/packages/patches/emacs-fix-scheme-indent-function.patch \
+ %D%/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch
\
+ %D%/packages/patches/emacs-gnus-desktop-notify-rescan.patch \
%D%/packages/patches/emacs-helpful-fix-signature.patch \
%D%/packages/patches/emacs-helpful-fix-tests.patch \
%D%/packages/patches/emacs-highlight-stages-add-gexp.patch \
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index bea64bef2c..05eaa5ebbd 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -37736,6 +37736,43 @@ message.
@end itemize")
(license license:gpl2+)))
+(define-public emacs-gnus-desktop-notify
+ (package
+ (name "emacs-gnus-desktop-notify")
+ (version "20180623.1538")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/wavexx/gnus-desktop-notify.el.git")
+ (commit "24588a3e024b204d930480fdc8bca31426f4e846")))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "06gxqlhfrc9ykq8v7qhxsr4w8hwyv1jkrifpp0kqjhf7idv96010"))
+ (patches
+ (search-patches
+ "emacs-gnus-desktop-notify-fix-notifications.patch"
+ "emacs-gnus-desktop-notify-rescan.patch"))))
+ (build-system emacs-build-system)
+ (home-page
+ "http://www.thregr.org/~wavexx/software/gnus-desktop-notify.el/")
+ (synopsis "Gnus desktop notification global minor mode")
+ (description
+ "@code{gnus-desktop-notify} provides a simple mechanism to notify the
+user when new messages are received. To get started, place the following
+configuration snippet in your @file{~/.gnus.el} configuration file:
+@lisp
+(require 'gnus-desktop-notify)
+(gnus-desktop-notify-mode)
+(gnus-demon-add-rescan)
+;; Alternatively, configure the period and idle times specifically, e.g.:
+;; (gnus-demon-add-handler 'gnus-demon-scan-news 10 1)
+@end lisp
+The above causes Gnus to scan all configured groups every two 2 hours when
+Emacs has been idle for 1 hour, with desktop notifications emitted for new
+messages received.")
+ (license license:gpl3+)))
+
(define-public emacs-ox-epub
(package
(name "emacs-ox-epub")
diff --git
a/gnu/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch
b/gnu/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch
new file mode 100644
index 0000000000..5b5648956c
--- /dev/null
+++ b/gnu/packages/patches/emacs-gnus-desktop-notify-fix-notifications.patch
@@ -0,0 +1,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 <[email protected]>
+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
+
diff --git a/gnu/packages/patches/emacs-gnus-desktop-notify-rescan.patch
b/gnu/packages/patches/emacs-gnus-desktop-notify-rescan.patch
new file mode 100644
index 0000000000..2e1f7782a3
--- /dev/null
+++ b/gnu/packages/patches/emacs-gnus-desktop-notify-rescan.patch
@@ -0,0 +1,37 @@
+Upstream-status:
https://gitlab.com/wavexx/gnus-desktop-notify.el/-/merge_requests/16
+
+diff --git a/README.rst b/README.rst
+index 4cacdcb..150a2c2 100644
+--- a/README.rst
++++ b/README.rst
+@@ -18,7 +18,7 @@ new messages are received. For basic usage, to be used in
conjunction with
+
+ (require 'gnus-desktop-notify)
+ (gnus-desktop-notify-mode)
+- (gnus-demon-add-scanmail)
++ (gnus-demon-add-rescan)
+
+ into your ``.gnus`` file. The default is to use alert_ if available, which
+ works on every operating system and allows the user to customize the
+@@ -52,7 +52,7 @@ follows:
+ (setq gnus-desktop-notify-function 'gnus-desktop-notify-exec
+ gnus-desktop-notify-exec-program "growlnotify -a Emacs.app -m")
+ (gnus-desktop-notify-mode)
+- (gnus-demon-add-scanmail)
++ (gnus-demon-add-rescan)
+
+
+ Advanced setup
+diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el
+index 97e65f3..3153807 100644
+--- a/gnus-desktop-notify.el
++++ b/gnus-desktop-notify.el
+@@ -50,7 +50,7 @@
+ ;;
+ ;; (require 'gnus-desktop-notify)
+ ;; (gnus-desktop-notify-mode)
+-;; (gnus-demon-add-scanmail)
++;; (gnus-demon-add-rescan)
+ ;;
+ ;; into your ``.gnus`` file. The default is to use `alert' if available, which
+ ;; works on every operating system and allows the user to customize the