emacs-devel
[Top][All Lists]
Advanced

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

Re: broken gnus summary in Cyrillic Environment


From: Juri Linkov
Subject: Re: broken gnus summary in Cyrillic Environment
Date: Sun, 03 Oct 2004 03:15:15 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

Alex Ott <address@hidden> 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/





reply via email to

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