From 1afd327afb0d9e42cbd4087dabb051fa295c07a2 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 26 Feb 2017 19:44:18 +0000 Subject: Use built-in HTMl entity escaping function --- gnus-desktop-notify.el | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'gnus-desktop-notify.el') diff --git a/gnus-desktop-notify.el b/gnus-desktop-notify.el index 7c5dbd9..0c18ebc 100644 --- a/gnus-desktop-notify.el +++ b/gnus-desktop-notify.el @@ -191,20 +191,6 @@ the notification of new messages (depending on the value of (defvar gnus-desktop-notify-counts () "Map Gnus group names to their total number of articles.") -(defvar gnus-desktop-notify-html-lut - '(("&" . "&") - ("<" . "<" ) - (">" . ">" )) - "Map special characters to their HTML entities.") - -;; FIXME: Do not reinvent the wheel if possible -(defun gnus-desktop-notify-escape-html-entities (str) - "Escape HTML character entity references." - (let* ((lut gnus-desktop-notify-html-lut) - (chars (format "[%s]" (mapconcat #'car lut "")))) - (replace-regexp-in-string - chars (lambda (s) (cdr (assoc-string s lut))) str))) - (defun gnus-desktop-notify-read-count (group) (let* ((range (gnus-range-normalize (gnus-info-read group))) (count (gnus-last-element range))) @@ -223,7 +209,7 @@ collapsing." GROUP should have the form (NAME . COUNT), where NAME is the group name to display and COUNT is the corresponding number of articles." - (let ((name (gnus-desktop-notify-escape-html-entities (car group))) + (let ((name (url-insert-entities-in-string (car group))) (count (cdr group))) (format-spec gnus-desktop-notify-format (format-spec-make ?n count -- cgit v1.2.3