summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorEric Abrahamsen <eric@ericabrahamsen.net>2019-03-31 09:09:18 -0700
committerEric Abrahamsen <eric@ericabrahamsen.net>2019-04-08 19:03:03 -0700
commit8b2dad2891fe2d0ed4d163b4e63263f1068b8b3e (patch)
tree8ee518d42781d803ab33973220e65feb794b6811 /lisp/gnus
parent3e5e097fdf056f4b3440993dd25ebdbad436abc3 (diff)
downloademacs-8b2dad2891fe2d0ed4d163b4e63263f1068b8b3e.tar.gz
Fix encoding and access of Gnus group names
* lisp/gnus/gnus-start.el (gnus-active-to-gnus-format): Encode group names as 'latin-1. * lisp/gnus/nnmail.el (nnmail-parse-active): Ditto. * lisp/gnus/nnml.el (nnml-request-group, nnml-request-create-group, nnml-request-expire-articles, nnml-request-delete-group, nnml-request-rename-group, nnml-deletable-article-p, nnml-active-number, nnml-open-incremental-nov): Use assoc-string with nnml-group-alist. * lisp/gnus/nnrss.el (nnrss-request-delete-group, nnrss-retrieve-groups, nnrss-read-group-data, nnrss-check-group, nnrss-generate-download-script): Use assoc-string with nnrss-group-alist.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/gnus-start.el15
-rw-r--r--lisp/gnus/nnmail.el2
-rw-r--r--lisp/gnus/nnml.el16
-rw-r--r--lisp/gnus/nnrss.el18
4 files changed, 27 insertions, 24 deletions
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index 9b1be650673..2beb685822f 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -2145,12 +2145,15 @@ The info element is shared with the same element of
(condition-case ()
(if (and (stringp (progn
(setq group (read cur)
- group (cond ((numberp group)
- (number-to-string group))
- ((symbolp group)
- (symbol-name group))
- ((stringp group)
- group)))))
+ group
+ (encode-coding-string
+ (cond ((numberp group)
+ (number-to-string group))
+ ((symbolp group)
+ (symbol-name group))
+ ((stringp group)
+ group))
+ 'latin-1))))
(numberp (setq max (read cur)))
(numberp (setq min (read cur)))
(null (progn
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index a95cdb4a4f8..b6dbbea74cc 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -663,7 +663,7 @@ nn*-request-list should have been called before calling this function."
(narrow-to-region (point) (point-at-eol))
(setq group (read buffer))
(unless (stringp group)
- (setq group (symbol-name group)))
+ (setq group (encode-coding-string (symbol-name group) 'latin-1)))
(if (and (numberp (setq max (read buffer)))
(numberp (setq min (read buffer))))
(push (list group (cons min max))
diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el
index 5770777ad4b..205e9e48034 100644
--- a/lisp/gnus/nnml.el
+++ b/lisp/gnus/nnml.el
@@ -259,7 +259,7 @@ non-nil.")
(t
(nnheader-re-read-dir nnml-current-directory)
(nnmail-activate 'nnml)
- (let ((active (nth 1 (assoc group nnml-group-alist))))
+ (let ((active (nth 1 (assoc-string group nnml-group-alist))))
(if (not active)
(nnheader-report 'nnml "No such group: %s" decoded)
(nnheader-report 'nnml "Selected group %s" decoded)
@@ -295,7 +295,7 @@ non-nil.")
(nnheader-report 'nnml "%s is a file"
(directory-file-name (nnml-group-pathname group
nil server))))
- ((assoc group nnml-group-alist)
+ ((assoc-string group nnml-group-alist)
t)
(t
(let (active)
@@ -379,7 +379,7 @@ non-nil.")
(nnml-nov-delete-article group number))
(push number rest)))
(push number rest)))
- (let ((active (nth 1 (assoc group nnml-group-alist))))
+ (let ((active (nth 1 (assoc-string group nnml-group-alist))))
(when active
(setcar active (or (and active-articles
(apply 'min active-articles))
@@ -520,7 +520,7 @@ non-nil.")
(nnheader-report 'nnml "No such directory: %s/" file))
;; Remove the group from all structures.
(setq nnml-group-alist
- (delq (assoc group nnml-group-alist) nnml-group-alist)
+ (delq (assoc-string group nnml-group-alist) nnml-group-alist)
nnml-current-group nil
nnml-current-directory nil)
;; Save the active file.
@@ -549,7 +549,7 @@ non-nil.")
(when (<= (length (directory-files old-dir)) 2)
(ignore-errors (delete-directory old-dir)))
;; That went ok, so we change the internal structures.
- (let ((entry (assoc group nnml-group-alist)))
+ (let ((entry (assoc-string group nnml-group-alist)))
(when entry
(setcar entry new-name))
(setq nnml-current-directory nil
@@ -597,7 +597,7 @@ non-nil.")
(when (setq path (nnml-article-to-file article))
(when (file-writable-p path)
(or (not nnmail-keep-last-article)
- (not (eq (cdr (nth 1 (assoc group nnml-group-alist)))
+ (not (eq (cdr (nth 1 (assoc-string group nnml-group-alist)))
article)))))))
;; Find an article number in the current group given the Message-ID.
@@ -742,7 +742,7 @@ article number. This function is called narrowed to an article."
"Compute the next article number in GROUP on SERVER."
(let* ((encoded (if nnmail-group-names-not-encoded-p
(nnml-encoded-group-name group server)))
- (active (cadr (assoc (or encoded group) nnml-group-alist))))
+ (active (cadr (assoc-string (or encoded group) nnml-group-alist))))
;; The group wasn't known to nnml, so we just create an active
;; entry for it.
(unless active
@@ -783,7 +783,7 @@ article number. This function is called narrowed to an article."
(cdr nnml-incremental-nov-buffer-alist)))))
(defun nnml-open-incremental-nov (group)
- (or (cdr (assoc group nnml-incremental-nov-buffer-alist))
+ (or (cdr (assoc-string group nnml-incremental-nov-buffer-alist))
(let ((buffer (nnml-get-nov-buffer group t)))
(push (cons group buffer) nnml-incremental-nov-buffer-alist)
buffer)))
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index 7f2accc2b66..0bfecb28e09 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -340,10 +340,10 @@ for decoding when the cdr that the data specify is not available.")
(let (elem)
;; There may be two or more entries in `nnrss-group-alist' since
;; this function didn't delete them formerly.
- (while (setq elem (assoc group nnrss-group-alist))
+ (while (setq elem (assoc-string group nnrss-group-alist))
(setq nnrss-group-alist (delq elem nnrss-group-alist))))
(setq nnrss-server-data
- (delq (assoc group nnrss-server-data) nnrss-server-data))
+ (delq (assoc-string group nnrss-server-data) nnrss-server-data))
(nnrss-save-server-data server)
(ignore-errors
(let ((file-name-coding-system nnmail-pathname-coding-system))
@@ -367,7 +367,7 @@ for decoding when the cdr that the data specify is not available.")
(with-current-buffer nntp-server-buffer
(erase-buffer)
(dolist (group groups)
- (let ((elem (assoc (gnus-group-decoded-name group) nnrss-server-data)))
+ (let ((elem (assoc-string (gnus-group-decoded-name group) nnrss-server-data)))
(insert (format "%S %s 1 y\n" group (or (cadr elem) 0)))))
'active))
@@ -539,7 +539,7 @@ which RSS 2.0 allows."
(if (hash-table-p nnrss-group-hashtb)
(clrhash nnrss-group-hashtb)
(setq nnrss-group-hashtb (make-hash-table :test 'equal)))
- (let ((pair (assoc group nnrss-server-data)))
+ (let ((pair (assoc-string group nnrss-server-data)))
(setq nnrss-group-max (or (cadr pair) 0))
(setq nnrss-group-min (+ nnrss-group-max 1)))
(let ((file (nnrss-make-filename group server))
@@ -644,8 +644,8 @@ which RSS 2.0 allows."
(concat group ".xml"))
nnrss-directory))))
(setq xml (nnrss-fetch file t))
- (setq url (or (nth 2 (assoc group nnrss-server-data))
- (cadr (assoc group nnrss-group-alist))))
+ (setq url (or (nth 2 (assoc-string group nnrss-server-data))
+ (cadr (assoc-string group nnrss-group-alist))))
(unless url
(setq url
(cdr
@@ -653,7 +653,7 @@ which RSS 2.0 allows."
(nnrss-discover-feed
(read-string
(format "URL to search for %s: " group) "http://")))))
- (let ((pair (assoc group nnrss-server-data)))
+ (let ((pair (assoc-string group nnrss-server-data)))
(if pair
(setcdr (cdr pair) (list url))
(push (list group nnrss-group-max url) nnrss-server-data)))
@@ -721,7 +721,7 @@ which RSS 2.0 allows."
(setq extra nil))
(when changed
(nnrss-save-group-data group server)
- (let ((pair (assoc group nnrss-server-data)))
+ (let ((pair (assoc-string group nnrss-server-data)))
(if pair
(setcar (cdr pair) nnrss-group-max)
(push (list group nnrss-group-max) nnrss-server-data)))
@@ -792,7 +792,7 @@ It is useful when `(setq nnrss-use-local t)'."
(insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
(dolist (elem nnrss-server-data)
(let ((url (or (nth 2 elem)
- (cadr (assoc (car elem) nnrss-group-alist)))))
+ (cadr (assoc-string (car elem) nnrss-group-alist)))))
(insert "$WGET -q -O \"$RSSDIR\"/'"
(nnrss-translate-file-chars (concat (car elem) ".xml"))
"' '" url "'\n"))))