all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: 35383@debbugs.gnu.org
Subject: bug#35383: 27.0.50; Complete process of decoding Gnus group names
Date: Tue, 23 Apr 2019 14:42:23 -0700	[thread overview]
Message-ID: <87h8ao760w.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <vz11s1spw36.fsf@gmail.com> (Andy Moreton's message of "Tue, 23 Apr 2019 16:42:05 +0100")

[-- Attachment #1: Type: text/plain, Size: 2939 bytes --]

Andy Moreton <andrewjmoreton@gmail.com> writes:

> On Mon 22 Apr 2019, Eric Abrahamsen wrote:
>
>> This is part two and the completion of bug#33653, which changed Gnus's
>> obarrays into hash tables, and group names from symbols to (encoded)
>> strings. The commits in the recently-pushed "scratch/gnus-decoded"
>> branch change group names to decoded strings.
>>
>> Bug 33653 was a mess for a few reasons: I partitioned the changes
>> poorly, didn't call for testers, and it turned out that I was locally
>> testing a mismash of that change plus a couple changes included in this
>> branch, which hid some bugs.
>>
>> This time around I'll keep it cleaner: I'll locally test only this
>> change in isolation, I'm writing a semi-interactive test suite for Gnus,
>> and in a few weeks I'll rope in three or four users to road-test the
>> changes. The upside is that, once these changes are stabilized and put
>> in, it will eliminate a whole class of potential bugs.
>>
>> In the meantime I'm hanging this here as a placeholder. If any brave
>> soul does decide to give it a test-run in the meantime, back up your
>> .newsrc.eld file first!
>
> There don;t seem to bnbe any problems with the .nersrc.eld, as I have
> used the same file in emacs-26, master and scratch/gnus-decoded branches
> without obvious problems.
>
> There is a problem in the server buffer in the scratch/gnus-decoded buffer
> with group names. In my setup:
> 1) Start gnus, and open the server buffer
> 2) Select the feedbase server. This is configured as:
>
>   (gnus-secondary-select-methods
>    '((nntp "feedbase"
>            (nntp-open-connection-function nntp-open-tls-stream)
>            (nntp-port-number 563)
>            (nntp-address "feedbase.org"))
>      ...
>
> 3) Note that some group names are not decoded correctly in the server
> buffer. The group names are decoded properly in the article buffer.
>
> For example, (showing only names with problems):
>
> server buffer (master branch):
>
> K    140: feedbase.blog.københavnsskiklub
> K    208: feedbase.news.brk.høringer
> K   2017: feedbase.news.dr.hovedstadsområdet
>
>
> server buffer (scratch/gnus-decoded branch):
>
> K    140: feedbase.blog.k\303\270benhavnsskiklub
> K    208: feedbase.news.brk.h\303\270ringer
> K   2017: feedbase.news.dr.hovedstadsomr\303\245det
>
> The raw bytes (shown as escapes above) match the UTF-8 for the expected
> characters, so the decoding is not quite right.

Aha! Good catch. The attached patch fixes things for me. At first I was
a little hesitant to assume all group names are decodable as
'utf-8-emacs, but then I figured that's all that
`gnus-group-decoded-name' does, and that's worked for years, so I guess
this is safe.

And thanks for the nntp server with non-ascii group names! I had looked
for one of those with no success, this will be very useful for testing.

Eric



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-browse-srv-decoded.diff --]
[-- Type: text/x-patch, Size: 1655 bytes --]

diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 2328f1da16..da110c8bbf 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -784,11 +784,13 @@ gnus-browse-foreign-server
 	      (while (not (eobp))
 		(ignore-errors
 		  (push (cons
-			 (buffer-substring
-			  (point)
-			  (progn
-			    (skip-chars-forward "^ \t")
-			    (point)))
+			 (decode-coding-string
+			  (buffer-substring
+			   (point)
+			   (progn
+			     (skip-chars-forward "^ \t")
+			     (point)))
+			  'utf-8-emacs)
 			 (let ((last (read cur)))
 			   (cons (read cur) last)))
 			groups))
@@ -796,18 +798,20 @@ gnus-browse-foreign-server
 	    (while (not (eobp))
 	      (ignore-errors
 		(push (cons
-		       (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))
+		       (decode-coding-string
+			(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))
+			'utf-8-emacs)
 		       (let ((last (read cur)))
 			 (cons (read cur) last)))
 		      groups))

  reply	other threads:[~2019-04-23 21:42 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22 18:39 bug#35383: 27.0.50; Complete process of decoding Gnus group names Eric Abrahamsen
2019-04-23  8:12 ` Katsumi Yamaoka
2019-04-23 19:55   ` Eric Abrahamsen
2019-04-24  8:06     ` Katsumi Yamaoka
2019-04-24 17:04       ` Eric Abrahamsen
2019-04-24 23:48         ` Katsumi Yamaoka
2019-04-25 16:10           ` Eric Abrahamsen
2019-04-26  5:21             ` Katsumi Yamaoka
2019-04-26  6:53               ` Eli Zaretskii
2019-04-26  8:08                 ` Katsumi Yamaoka
2019-04-26 10:55                   ` Eli Zaretskii
2019-04-29  4:05               ` Eric Abrahamsen
2019-04-29  4:07                 ` Eric Abrahamsen
2019-04-29 15:41                   ` Eli Zaretskii
2019-04-29 20:04                     ` Eric Abrahamsen
2019-04-30  3:55                       ` Eli Zaretskii
2019-04-30 17:03                         ` Eric Abrahamsen
2019-04-30 17:11                           ` Eli Zaretskii
2019-04-30 17:19                             ` Eric Abrahamsen
2019-04-30 17:44                               ` Eli Zaretskii
2019-04-30 18:17                                 ` Eric Abrahamsen
2019-04-29 15:38                 ` Eli Zaretskii
2019-05-13  0:32     ` Katsumi Yamaoka
2019-05-13 20:14       ` Eric Abrahamsen
2019-05-18 20:25         ` Eric Abrahamsen
2019-05-18 22:12           ` Basil L. Contovounesios
2019-05-18 23:23             ` Eric Abrahamsen
2019-05-19  1:03               ` Basil L. Contovounesios
2019-05-19  2:56                 ` Eric Abrahamsen
2019-05-19 17:02                   ` Eric Abrahamsen
2019-06-10 23:19                     ` Katsumi Yamaoka
2019-06-11  0:03                       ` Eric Abrahamsen
2019-06-11  4:33                       ` Eric Abrahamsen
2019-06-11  8:09                         ` Katsumi Yamaoka
2019-04-23 15:42 ` Andy Moreton
2019-04-23 21:42   ` Eric Abrahamsen [this message]
2019-04-23 22:58     ` Andy Moreton
2019-06-17  6:06 ` Eric Abrahamsen
2019-06-17 12:12   ` Deus Max
2019-06-17 16:22     ` Eric Abrahamsen
2019-06-19 20:57       ` Deus Max
2019-06-19 21:02       ` Deus Max
2019-06-19 21:40         ` Eric Abrahamsen
2019-06-20 13:00           ` Deus Max
2019-06-20 16:29             ` Eric Abrahamsen
2019-06-20 19:01               ` Deus Max
2019-06-20 19:16                 ` Eric Abrahamsen
2019-06-21 20:59                   ` Eric Abrahamsen
2019-06-22 14:44                     ` Deus Max
2019-06-22 16:09                       ` Eric Abrahamsen
2019-06-23 10:27                         ` Deus Max
2019-07-08  3:09                           ` Eric Abrahamsen
2019-07-08 19:46                             ` Deus Max
2019-07-23 23:52                               ` Eric Abrahamsen
2019-07-30 23:00                               ` Eric Abrahamsen
2019-08-01 12:07                                 ` Lars Ingebrigtsen
2019-08-01 16:22                                   ` Eric Abrahamsen
2019-08-03 21:53                                   ` Eric Abrahamsen
2019-09-27 14:58                                     ` Lars Ingebrigtsen
2019-06-19 21:28       ` Deus Max

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h8ao760w.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=35383@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.