]> git.eshelyaron.com Git - emacs.git/commitdiff
Preserve group name encoding in newsrc.eld files
authorEric Abrahamsen <eric@ericabrahamsen.net>
Fri, 7 Jun 2019 03:43:27 +0000 (20:43 -0700)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Fri, 7 Jun 2019 03:43:27 +0000 (20:43 -0700)
* lisp/gnus/gnus-start.el (gnus-gnus-to-quick-newsrc-format): Preserve
  Gnus' earlier odd encoding of group names. Don't change any file
  formats until it's time to release a new Gnus version.

lisp/gnus/gnus-start.el

index 9a93ad0549821f2387b0c0a74aaf90e06bb1f97e..32d438aadcef0fc2519886d5999b3e6641a58226 100644 (file)
@@ -2887,7 +2887,19 @@ SPECIFIC-VARIABLES, or those in `gnus-variable-list'."
       (set (nth (seq-position gnus-variable-list 'gnus-newsrc-alist)
                gnus-variable-list)
           (mapcar (lambda (g)
-                    (nth 1 (gethash g gnus-newsrc-hashtb)))
+                    (let ((entry (copy-sequence
+                                  (nth 1 (gethash g gnus-newsrc-hashtb)))))
+                      ;; Encode in order to keep newsrc.eld files
+                      ;; compatible with older versions of Gnus.  At
+                      ;; some point, if/when a new version of Gnus is
+                      ;; released, drop this (and the corresponding
+                      ;; decode in
+                      ;; `gnus-make-hashtable-from-newsrc-alist').
+                      (setf (car entry)
+                            (encode-coding-string
+                             (car entry)
+                             'utf-8-emacs))
+                      entry))
                   (delete "dummy.group" gnus-group-list)))
 
       ;; Insert the variables into the file.