Gnus development mailing list
 help / color / mirror / Atom feed
From: Juri Linkov <juri@jurta.org>
Cc: ding@gnus.org, emacs-devel@gnu.org
Subject: Re: broken gnus summary in Cyrillic Environment
Date: Sun, 03 Oct 2004 03:15:15 +0300	[thread overview]
Message-ID: <871xgg7j4g.fsf@mail.jurta.org> (raw)
In-Reply-To: <ht2zn3sccm2.fsf@seal.service.jet.msk.su> (Alex Ott's message of "Wed, 15 Sep 2004 09:41:57 +0400")

Alex Ott <ott@jet.msk.su> writes:
> I found strange bug when working with gnus 5.10.x and No Gnus with Emacs
> from CVS. When i use default summary spec and Cyrillic-KOI8 environment,
> summary lines is not updated in run-time (you can see this on first image
> - gnus-brocken-summary.png, in this image, first two articles is readed,
> but not marked by gnus). Also with this error, not working mark-processing
> functions, such as, spam-move, etc.
>
> With default language environment, all works fine - you can see this on the
> second image - gnus-default-summary.png - this image was taken from gnus
> and emacs without any customisation.

This bug is caused by using the search strings with octal values which
don't match the corresponding characters in multibyte buffers.

In http://lists.gnu.org/archive/html/emacs-devel/2003-11/msg00350.html
Kenichi Handa suggested to fix this bug (in another place where it was
revealed too with overlapped regexp range ends in coding systems
where octal values from regexp ranges are converted to values which
make the ending character value less than the starting character value)
by using `string-as-multibyte' to convert a regexp to a multibyte string.

I think this bug should be fixed in Gnus CVS as well as in Emacs CVS
before the next release because it makes Gnus unusable in some
language environments.

Here is the patch for Gnus against Emacs CVS.  A similar patch could
be applied to Gnus CVS as well.  However, I don't know how this fix
will behave in Unicode Emacs 22.

cvs diff: Diffing lisp/gnus
Index: lisp/gnus/gnus-sum.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-sum.el,v
retrieving revision 1.45
diff -u -r1.45 gnus-sum.el
--- lisp/gnus/gnus-sum.el	1 Oct 2004 06:40:26 -0000	1.45
+++ lisp/gnus/gnus-sum.el	2 Oct 2004 22:20:24 -0000
@@ -3231,20 +3231,24 @@
 	   [0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil]
 	   0 nil t 128 t nil "" nil 1)
 	  (goto-char (point-min))
-	  (setq pos (list (cons 'unread (and (search-forward "\200" nil t)
-					     (- (point) (point-min) 1)))))
+	  (setq pos (list (cons 'unread
+                                (and (search-forward
+                                      (string-as-multibyte "\200") nil t)
+                                     (- (point) (point-min) 1)))))
 	  (goto-char (point-min))
-	  (push (cons 'replied (and (search-forward "\201" nil t)
-				    (- (point) (point-min) 1)))
+	  (push (cons 'replied (and (search-forward
+                                     (string-as-multibyte "\201") nil t)
+                                    (- (point) (point-min) 1)))
 		pos)
 	  (goto-char (point-min))
-	  (push (cons 'score (and (search-forward "\202" nil t)
-				  (- (point) (point-min) 1)))
+	  (push (cons 'score (and (search-forward
+                                   (string-as-multibyte "\202") nil t)
+                                  (- (point) (point-min) 1)))
 		pos)
 	  (goto-char (point-min))
-	  (push (cons 'download
-		      (and (search-forward "\203" nil t)
-			   (- (point) (point-min) 1)))
+	  (push (cons 'download (and (search-forward
+                                      (string-as-multibyte "\203") nil t)
+                                     (- (point) (point-min) 1)))
 		pos)))
       (setq gnus-summary-mark-positions pos))))
 
Index: lisp/gnus/message.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/message.el,v
retrieving revision 1.62
diff -u -r1.62 message.el
--- lisp/gnus/message.el	27 Sep 2004 07:44:44 -0000	1.62
+++ lisp/gnus/message.el	2 Oct 2004 22:20:38 -0000
@@ -4399,7 +4399,9 @@
 	     nil))))
    ;; Check for control characters.
    (message-check 'control-chars
-     (if (re-search-forward "[\000-\007\013\015-\032\034-\037\200-\237]" nil t)
+     (if (re-search-forward
+          (string-as-multibyte "[\000-\007\013\015-\032\034-\037\200-\237]")
+          nil t)
 	 (y-or-n-p
 	  "The article contains control characters.  Really post? ")
        t))
Index: lisp/gnus/gnus-group.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-group.el,v
retrieving revision 1.26
diff -u -r1.26 gnus-group.el
--- lisp/gnus/gnus-group.el	20 Sep 2004 12:03:04 -0000	1.26
+++ lisp/gnus/gnus-group.el	2 Oct 2004 22:19:55 -0000
@@ -1046,7 +1046,8 @@
       (gnus-group-insert-group-line "dummy.group" 0 nil 0 nil)
       (goto-char (point-min))
       (setq gnus-group-mark-positions
-	    (list (cons 'process (and (search-forward "\200" nil t)
+	    (list (cons 'process (and (search-forward
+                                       (string-as-multibyte "\200") nil t)
 				      (- (point) 2))))))))
 
 (defun gnus-mouse-pick-group (e)
Index: lisp/gnus/gnus-msg.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/gnus/gnus-msg.el,v
retrieving revision 1.23
diff -u -r1.23 gnus-msg.el
--- lisp/gnus/gnus-msg.el	27 Sep 2004 07:44:43 -0000	1.23
+++ lisp/gnus/gnus-msg.el	2 Oct 2004 22:19:58 -0000
@@ -1534,7 +1534,8 @@
     ;; Remove any control chars - they seem to cause trouble for some
     ;; mailers.  (Byte-compiled output from the stuff above.)
     (goto-char point)
-    (while (re-search-forward "[\000-\010\013-\037\200-\237]" nil t)
+    (while (re-search-forward (string-as-multibyte
+                               "[\000-\010\013-\037\200-\237]") nil t)
       (replace-match (format "\\%03o" (string-to-char (match-string 0)))
 		     t t))))
 

-- 
Juri Linkov
http://www.jurta.org/emacs/

  parent reply	other threads:[~2004-10-03  0:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-15  5:41 Alex Ott
2004-09-15  7:57 ` Alex Ott
2004-10-03  0:15 ` Juri Linkov [this message]
2004-10-03  0:51   ` Miles Bader

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=871xgg7j4g.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).