emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 4b0c425: Remove two string-as-unibyte in gnus-srvr.


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 4b0c425: Remove two string-as-unibyte in gnus-srvr.el
Date: Sat, 14 Apr 2018 17:54:19 -0400 (EDT)

branch: master
commit 4b0c425047b61b306e7775bae11bd0edd78a7c96
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Remove two string-as-unibyte in gnus-srvr.el
    
    * lisp/gnus/gnus-srvr.el (gnus-browse-foreign-server): We do not
    seem to need the string-as-unibyte here: We read a multibyte
    string from the *nntpd* buffer and then decode it later, and this
    apparently by some strange magic leads to the correct results in
    my test cases.
---
 lisp/gnus/gnus-srvr.el | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 94fd21b..dfca5e9 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -808,12 +808,11 @@ claim them."
              (while (not (eobp))
                (ignore-errors
                  (push (cons
-                        (string-as-unibyte
-                         (buffer-substring
-                          (point)
-                          (progn
-                            (skip-chars-forward "^ \t")
-                            (point))))
+                        (buffer-substring
+                         (point)
+                         (progn
+                           (skip-chars-forward "^ \t")
+                           (point)))
                         (let ((last (read cur)))
                           (cons (read cur) last)))
                        groups))
@@ -821,19 +820,18 @@ claim them."
            (while (not (eobp))
              (ignore-errors
                (push (cons
-                      (string-as-unibyte
-                       (if (eq (char-after) ?\")
-                           (read cur)
-                         (let ((p (point)) (name ""))
-                           (skip-chars-forward "^ \t\\\\")
-                           (setq name (buffer-substring p (point)))
-                           (while (eq (char-after) ?\\)
-                             (setq p (1+ (point)))
-                             (forward-char 2)
-                             (skip-chars-forward "^ \t\\\\")
-                             (setq name (concat name (buffer-substring
-                                                      p (point)))))
-                           name)))
+                      (if (eq (char-after) ?\")
+                          (read cur)
+                        (let ((p (point)) (name ""))
+                          (skip-chars-forward "^ \t\\\\")
+                          (setq name (buffer-substring p (point)))
+                          (while (eq (char-after) ?\\)
+                            (setq p (1+ (point)))
+                            (forward-char 2)
+                            (skip-chars-forward "^ \t\\\\")
+                            (setq name (concat name (buffer-substring
+                                                     p (point)))))
+                          name))
                       (let ((last (read cur)))
                         (cons (read cur) last)))
                      groups))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]