From 7479c64408c943f9a2198b7ba71e9bd27b018f35 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Fri, 7 Jan 2011 01:19:28 +0100 Subject: Fix formatting issues by separating subject/body. Real fix for commit 6a92e688205d48e8f91eba97e305540321b444c6: Markup is supported everywhere in 'awesome' because it is. notification-daemon supports markup in the body only, and only with paired tags. Use ^M in the body to separate lines. --- gnus-desktop-notify.el | 42 ++++++++++++------------------------------ 1 file changed, 12 insertions(+), 30 deletions(-) (limited to 'gnus-desktop-notify.el') diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el index 28bbc1e..84ea50b 100644 --- a/gnus-desktop-notify.el +++ b/gnus-desktop-notify.el @@ -54,14 +54,6 @@ ;; ;; See the `gnus-desktop-notify' customization group for more details. ;; -;; If you have KDE, or use Awesome (WM), you can use the following -;; configuration to improve the appearance of the notification (the icon path -;; is a standard Gnome stock icon): -;; -;; (setq -;; gnus-desktop-notify-send-program "notify-send -i /usr/share/icons/gnome/32x32/actions/mail_new.png" -;; gnus-desktop-notify-send-mode 'gnus-desktop-notify-multi) -;; ;; Feel free to send suggestions and patches to wavexx AT users.sf.net ;;; Code: @@ -119,24 +111,18 @@ function. Each argument will be of the form: :type 'file) (defcustom gnus-desktop-notify-send-program - "notify-send -i /usr/share/icons/gnome/16x16/actions/mail_new.png" + "notify-send -i /usr/share/icons/gnome/32x32/actions/mail_new.png" "Path and default arguments to the 'notify-send' program (part of libnotify's utilities)." :type 'file) -(defcustom gnus-desktop-notify-send-mode 'gnus-desktop-notify-safe +(defcustom gnus-desktop-notify-send-mode 'gnus-desktop-notify-multi "`gnus-desktop-notify-send' behavior. Can be either: -'gnus-desktop-notify-safe: display a single notification for - each group, without using markup. 'gnus-desktop-notify-single: display a single notification for - each group, using markup. + each group. 'gnus-desktop-notify-multi: display a multi-line notification for - all groups at once, using markup. - - Markup is supported only on certain window managers/desktops, -such as KDE and Awesome. You can use '-single' or '-multi' on -those window managers." + all groups at once." :type 'symbol) (defcustom gnus-desktop-notify-groups 'gnus-desktop-notify-all-except @@ -183,25 +169,21 @@ each argument being of the form 'number of new messages:mailbox name'." "Call 'notify-send' (as defined by `gnus-desktop-notify-send-program'), with the behavior defined by `gnus-desktop-notify-send-mode'." (case gnus-desktop-notify-send-mode - ('gnus-desktop-notify-safe - (dolist (g groups) - (call-process-shell-command gnus-desktop-notify-send-program nil 0 nil "--" - (shell-quote-argument - (format "New mail: %d:%s" (cdr g) (car g)))))) ('gnus-desktop-notify-single (dolist (g groups) (call-process-shell-command gnus-desktop-notify-send-program nil 0 nil "--" + (shell-quote-argument "New mail") (shell-quote-argument - (format "New mail: %d:%s" + (format "%3d:%s" (cdr g) (gnus-desktop-notify-escape-html-entities (car g))))))) ('gnus-desktop-notify-multi - (let ( (text "New mail:") ) - (dolist (g groups) - (setq text - (concat text - (format "
%d:%s" - (cdr g) (gnus-desktop-notify-escape-html-entities (car g)))))) + (let ( (text (mapconcat + (lambda (g) + (format "%3d:%s" + (cdr g) (gnus-desktop-notify-escape-html-entities (car g)))) + groups "\C-m")) ) (call-process-shell-command gnus-desktop-notify-send-program nil 0 nil "--" + (shell-quote-argument "New mail") (shell-quote-argument text)))))) -- cgit v1.2.3