diff options
author | Basil L. Contovounesios <contovob@tcd.ie> | 2017-02-26 19:44:18 +0000 |
---|---|---|
committer | Basil L. Contovounesios <contovob@tcd.ie> | 2017-02-26 20:18:10 +0000 |
commit | 1afd327afb0d9e42cbd4087dabb051fa295c07a2 (patch) | |
tree | 4e2e5030eb3f90423aba4c248d218230515ba6f0 /gnus-desktop-notify.el | |
parent | 8fd980c4a4ba18085ec87a2f0c71875c5d01087f (diff) |
Use built-in HTMl entity escaping function
Diffstat (limited to 'gnus-desktop-notify.el')
-rw-r--r-- | gnus-desktop-notify.el | 16 |
1 files changed, 1 insertions, 15 deletions
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 |