From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/58712 Path: main.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: broken gnus summary in Cyrillic Environment Date: Sun, 03 Oct 2004 03:15:15 +0300 Organization: JURTA Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: <871xgg7j4g.fsf@mail.jurta.org> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1096763884 28025 80.91.229.6 (3 Oct 2004 00:38:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 3 Oct 2004 00:38:04 +0000 (UTC) Cc: ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 03 02:37:50 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CDuNp-0005wd-00 for ; Sun, 03 Oct 2004 02:37:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDuUL-0004Pp-JQ for ged-emacs-devel@m.gmane.org; Sat, 02 Oct 2004 20:44:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CDuUD-0004Pk-9g for emacs-devel@gnu.org; Sat, 02 Oct 2004 20:44:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CDuUD-0004PY-0k for emacs-devel@gnu.org; Sat, 02 Oct 2004 20:44:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CDuUC-0004PV-N6 for emacs-devel@gnu.org; Sat, 02 Oct 2004 20:44:24 -0400 Original-Received: from [66.33.205.9] (helo=spatula.dreamhost.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CDuNL-0004Pb-4X for emacs-devel@gnu.org; Sat, 02 Oct 2004 20:37:19 -0400 Original-Received: from mail.jurta.org (80-235-37-197-dsl.mus.estpak.ee [80.235.37.197]) by spatula.dreamhost.com (Postfix) with ESMTP id 77F0117D01C; Sat, 2 Oct 2004 17:37:12 -0700 (PDT) Original-To: Alex Ott In-Reply-To: (Alex Ott's message of "Wed, 15 Sep 2004 09:41:57 +0400") User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27810 gmane.emacs.gnus.general:58712 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:58712 Alex Ott 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/