unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* broken gnus summary in Cyrillic Environment
@ 2004-09-15  5:41 Alex Ott
  2004-10-03  0:15 ` Juri Linkov
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Ott @ 2004-09-15  5:41 UTC (permalink / raw)
  Cc: ding

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

Hello all

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.

And i can work-around this bug with custom specifier of gnus summary, such
as  "%U%R%z %I%(%6{[ %}%-23,23n%6{ ]%}%) %s\n", for example. Results of
this, you can see on the third image - gnus-good-summary.png.


[-- Attachment #2: gnus-brocken-summary.png --]
[-- Type: image/png, Size: 27636 bytes --]

[-- Attachment #3: gnus-default-summary.png --]
[-- Type: image/png, Size: 20963 bytes --]

[-- Attachment #4: gnus-good-summary.png --]
[-- Type: image/png, Size: 27889 bytes --]

[-- Attachment #5: Type: text/plain, Size: 125 bytes --]



-- 
With best wishes, Alex Ott
Jet Infosystems,       http://www.jetinfosoft.ru/
                       +7 (095) 411 76 01

[-- Attachment #6: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: broken gnus summary in Cyrillic Environment
  2004-09-15  5:41 broken gnus summary in Cyrillic Environment Alex Ott
@ 2004-10-03  0:15 ` Juri Linkov
  2004-10-03  0:51   ` Miles Bader
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2004-10-03  0:15 UTC (permalink / raw)
  Cc: ding, emacs-devel

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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: broken gnus summary in Cyrillic Environment
  2004-10-03  0:15 ` Juri Linkov
@ 2004-10-03  0:51   ` Miles Bader
  0 siblings, 0 replies; 3+ messages in thread
From: Miles Bader @ 2004-10-03  0:51 UTC (permalink / raw)
  Cc: Alex Ott, ding, emacs-devel

On Sun, Oct 03, 2004 at 03:15:15AM +0300, Juri Linkov wrote:
> Here is the patch for Gnus against Emacs CVS.  A similar patch could
> be applied to Gnus CVS as well.

If you make a change to Gnus in Emacs CVS it will be propagated to Gnus CVS
automatically.

-Miles
-- 
Freedom's just another word, for nothing left to lose   --Janis Joplin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-03  0:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-15  5:41 broken gnus summary in Cyrillic Environment Alex Ott
2004-10-03  0:15 ` Juri Linkov
2004-10-03  0:51   ` Miles Bader

Code repositories for project(s) associated with this public inbox

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

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 read-only IMAP folder(s) and NNTP newsgroup(s).