* [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? @ 2004-10-14 15:51 zrr 2004-10-14 17:24 ` [BUG]What does this mean:"Mention that multibyte characters Reiner Steib 2004-10-14 17:44 ` [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? Xavier Maillard 0 siblings, 2 replies; 18+ messages in thread From: zrr @ 2004-10-14 15:51 UTC (permalink / raw) Hello, I have reported this problem several days ago that the most recent Gnus can't mark articles in the summary buffer. Eventually, I went back to the old version. Today, I checked out the Emacs CVS tree and encountered this problem again. Perhaps I had ignored an important factor in my first bug report, that my emacs is emacs-unicode-2 branch, because same version Gnus works perfectly in emacs trunk. I checked Gnus ChangeLog and find this line: * gnus-sum.el: Mention that multibyte characters don't work as marks. What does this mean? Does it indicate following lines in the 'gnus-sum.el'? ;; FIXME: Although the custom type is `character' for the following variables, ;; using multibyte characters (Latin-1, UTF-8) doesn't work. -- rs however, I have never customized this variables. I managed to load the old 'gnus-sum.el', as I expected, it works. I also performed a diff on two version 'gnus-sum.el' and find out this problem is caused by the change of 'gnus-update-summary-mark-positions'. Although there are very few people use unicode-2 branch now, I think this bug should be solved sooner or later. Regards! Tang ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-14 15:51 [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? zrr @ 2004-10-14 17:24 ` Reiner Steib 2004-10-14 18:33 ` zrr 2004-10-14 17:44 ` [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? Xavier Maillard 1 sibling, 1 reply; 18+ messages in thread From: Reiner Steib @ 2004-10-14 17:24 UTC (permalink / raw) On Thu, Oct 14 2004, zrr wrote: > Perhaps I had ignored an important factor in my first bug > report, that my emacs is emacs-unicode-2 branch, because same > version Gnus works perfectly in emacs trunk. That is probably an important point. > * gnus-sum.el: Mention that multibyte characters don't work as marks. > > What does this mean? Does it indicate following lines in the > 'gnus-sum.el'? Yes. > ;; FIXME: Although the custom type is `character' for the following variables, > ;; using multibyte characters (Latin-1, UTF-8) doesn't work. -- rs > > however, I have never customized this variables. I have added this remark. If you change e.g. `gnus-unseen-mark' to "·", it won't work, see <URL:http://thread.gmane.org/v91xqb4gau.fsf@marauder.physik.uni-ulm.de>. > I managed to load the old 'gnus-sum.el', as I expected, it > works. I also performed a diff on two version 'gnus-sum.el' and > find out this problem is caused by the change of > 'gnus-update-summary-mark-positions'. Could you please be more specific, which change you mean and which version worked. And please tell us the Gnus+Emacs for each. I don't know if your problems are related to my "FIXME" comment. Okay, I checked you previous report (http://thread.gmane.org/m2pt3ryt2b.fsf@yahoo.com.cn). The screenshot <URL:http://ftp.cdaan.com/sy/light/gnus-1.png> suggest that you have some non-ASCII character as `gnus-WhatEver-mark' (in the first two lines), `gnus-no-mark' probably. ,----[ C-h v gnus-no-mark RET ] | gnus-no-mark's value is 32 | | *Mark used for articles that have no other secondary mark. `---- Show us the output of `C-h v gnus-no-mark RET', please. > Although there are very few people use unicode-2 branch now, I > think this bug should be solved sooner or later. Of course it should. If it only happens in the Unicode branch, it would be better to report the problem on emacs-devel, too (or the Emacs Unicode List? I dunno if this list still exists). Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-14 17:24 ` [BUG]What does this mean:"Mention that multibyte characters Reiner Steib @ 2004-10-14 18:33 ` zrr 0 siblings, 0 replies; 18+ messages in thread From: zrr @ 2004-10-14 18:33 UTC (permalink / raw) Reiner Steib <reinersteib+gmane@imap.cc> writes: > > Could you please be more specific, which change you mean and which > version worked. And please tell us the Gnus+Emacs for each. > > I don't know if your problems are related to my "FIXME" comment. > Sorry, my statement is not clearly. At first, I doubted that this problem relates to the comment, but after I compared the newest 'gnus-sum.el' with the 'gnus-sum.el' in the 9/21/2004 Emacs trunk I realized that the bug is caused by some changes made on 'gnus-update-summary-mark-positions'. I made an experiment again. Just eval (C-x C-e) 'gnus-update-summary-mark-positions' function in the old version instead of loading entire 'gnus-sum.el'. It works fine. :-) Because there is no version number in the file. I give you a portion of diff output: diff -c /usr/local/stow/emacs-unicode/share/emacs/22.0.0/lisp/gnus/gnus-sum.el /usr/local/stow/emacs-cvs-20040921/share/emacs/21.3.50/lisp/gnus/gnus-sum.el *** /usr/local/stow/emacs-unicode/share/emacs/22.0.0/lisp/gnus/gnus-sum.el 2004-10-14 17:44:38.000000000 +0800 --- /usr/local/stow/emacs-cvs-20040921/share/emacs/21.3.50/lisp/gnus/gnus-sum.el 2004-09-20 20:03:05.000000000 +0800 *************** *** 3234,3257 **** [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 ! (mm-string-as-multibyte "\200") nil t) ! (- (point) (point-min) 1))))) (goto-char (point-min)) ! (push (cons 'replied (and (search-forward ! (mm-string-as-multibyte "\201") nil t) (- (point) (point-min) 1))) pos) (goto-char (point-min)) ! (push (cons 'score (and (search-forward ! (mm-string-as-multibyte "\202") nil t) (- (point) (point-min) 1))) pos) (goto-char (point-min)) ! (push (cons 'download (and (search-forward ! (mm-string-as-multibyte "\203") nil t) ! (- (point) (point-min) 1))) pos))) (setq gnus-summary-mark-positions pos)))) --- 3231,3250 ---- [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))))) (goto-char (point-min)) ! (push (cons 'replied (and (search-forward "\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))) pos) (goto-char (point-min)) ! (push (cons 'download ! (and (search-forward "\203" nil t) ! (- (point) (point-min) 1))) pos))) (setq gnus-summary-mark-positions pos)))) Maybe the "mm-string-as-multibyte" caused this problem? > Okay, I checked you previous report > (http://thread.gmane.org/m2pt3ryt2b.fsf@yahoo.com.cn). The screenshot > <URL:http://ftp.cdaan.com/sy/light/gnus-1.png> suggest that you have > some non-ASCII character as `gnus-WhatEver-mark' (in the first two > lines), `gnus-no-mark' probably. Thank you for your responsibility. That is not mark. I use some unicode chars to beautify the thread display. See http://my.gnus.org/node/view/22 > > ,----[ C-h v gnus-no-mark RET ] > | gnus-no-mark's value is 32 > | > | *Mark used for articles that have no other secondary mark. > `---- > > Show us the output of `C-h v gnus-no-mark RET', please. Ok, the output is as follows: gnus-no-mark's value is 32 *Mark used for articles that have no other secondary mark. You can customize this variable. Defined in `gnus-sum'. >> Although there are very few people use unicode-2 branch now, I >> think this bug should be solved sooner or later. > > Of course it should. If it only happens in the Unicode branch, it > would be better to report the problem on emacs-devel, too (or the > Emacs Unicode List? I dunno if this list still exists). If it can't be fixed in a moment, I will report to emacs-devel. Best Regards! Tang > > Bye, Reiner. > -- > ,,, > (o o) > ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? 2004-10-14 15:51 [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? zrr 2004-10-14 17:24 ` [BUG]What does this mean:"Mention that multibyte characters Reiner Steib @ 2004-10-14 17:44 ` Xavier Maillard 2004-10-14 18:41 ` [BUG]What does this mean:"Mention that multibyte characters zrr 1 sibling, 1 reply; 18+ messages in thread From: Xavier Maillard @ 2004-10-14 17:44 UTC (permalink / raw) On 14 oct 2004, zrr wrote: > Hello, 'lo, > * gnus-sum.el: Mention that multibyte characters don't work as > marks. Dunno if it is related to my bug report on problem with gnus score marks: I tried to use unicode characters as the score marks and it was rejected by gnus. > Although there are very few people use unicode-2 branch now, I > think this bug should be solved sooner or later. Can you tell me/us how to use the unicode branch ? Regards. -- Xavier Maillard| "Stand Back! I'm a programmer!" .0. zedek@gnu-rox.orgz| ..0 (+33) 326 770 221 | Webmaster, emacsfr.org 000 PGP : 0x1E028EA5 | Membre de l' APRIL ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-14 17:44 ` [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? Xavier Maillard @ 2004-10-14 18:41 ` zrr 2004-10-14 21:33 ` Xavier Maillard 0 siblings, 1 reply; 18+ messages in thread From: zrr @ 2004-10-14 18:41 UTC (permalink / raw) Xavier Maillard <zedek@gnu-rox.org> writes: > On 14 oct 2004, zrr wrote: > >> Hello, > > 'lo, > >> * gnus-sum.el: Mention that multibyte characters don't work as >> marks. > > Dunno if it is related to my bug report on problem with gnus > score marks: I tried to use unicode characters as the score marks > and it was rejected by gnus. Maybe my problem is not related to yours. > >> Although there are very few people use unicode-2 branch now, I >> think this bug should be solved sooner or later. > > Can you tell me/us how to use the unicode branch ? > export CVS_RSH="ssh" cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/emacs co -r emacs-unicode-2 emacs Cheers! Tang > Regards. > -- > Xavier Maillard| "Stand Back! I'm a programmer!" > .0. zedek@gnu-rox.orgz| > ..0 (+33) 326 770 221 | Webmaster, emacsfr.org > 000 PGP : 0x1E028EA5 | Membre de l' APRIL ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-14 18:41 ` [BUG]What does this mean:"Mention that multibyte characters zrr @ 2004-10-14 21:33 ` Xavier Maillard 2004-10-15 5:43 ` Katsumi Yamaoka 0 siblings, 1 reply; 18+ messages in thread From: Xavier Maillard @ 2004-10-14 21:33 UTC (permalink / raw) On 14 oct 2004, zrr wrote: > Maybe my problem is not related to yours. Maybe :/ > > > Although there are very few people use unicode-2 branch > > > now, I think this bug should be solved sooner or later. > > > > Can you tell me/us how to use the unicode branch ? > > > export CVS_RSH="ssh" > > cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/emacs co -r > emacs-unicode-2 emacs Great. Thank you. -- .o. | Hacker wonderland ..o | ooo | ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-14 21:33 ` Xavier Maillard @ 2004-10-15 5:43 ` Katsumi Yamaoka 2004-10-15 14:12 ` Katsumi Yamaoka 0 siblings, 1 reply; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-15 5:43 UTC (permalink / raw) Cc: ding Hi, 2004-10-05 Juri Linkov <juri@jurta.org> * gnus-group.el (gnus-update-group-mark-positions): * gnus-sum.el (gnus-update-summary-mark-positions): * message.el (message-check-news-body-syntax): * gnus-msg.el (gnus-debug): Use `string-as-multibyte' to convert 8-bit unibyte values to a multibyte string for search functions. Isn't at least the change to gnus-sum.el wrong? When using Emacs 22.0.0, there's a problem that we cannot set marks to articles in the Gnus summary buffer. For instance: >>>>> In <m2pt3ryt2b.fsf@yahoo.com.cn> >>>>> zrr <beijing_2008_gold@yahoo.com.cn> wrote: > I pressed 'E' to expire the artile, but the article still be > regarded as not expired. There is no mark symbol appeared and no > highlight on the current line. I realized Gnus searches the unibyte strings "\200", "\201", "\202" and "\203" in the multibyte buffer named " *gnus work*" when entering into the summary mode. Your change made Gnus search multibyte strings and it fails. OTOH, Emacs 21.3.50 doesn't fail it as follows: (with-temp-buffer (set-buffer-multibyte t) (insert (string-as-unibyte "\200")) (goto-char (point-min)) (search-forward (string-as-multibyte "\200") nil t)) => 2 (02, 0x2) = ?\C-b Probably, possible solution will be to withdraw your change or to use string-as-unibyte. Please note that you should use mm-string-as-unibyte instead of string-as-unibyte since Gnus supports XEmacs as well as Emacs. Best regards, ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 5:43 ` Katsumi Yamaoka @ 2004-10-15 14:12 ` Katsumi Yamaoka 2004-10-15 14:45 ` zrr ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-15 14:12 UTC (permalink / raw) Cc: ding >>>>> In <b9ypt3k5yfh.fsf@jpl.org> >>>>> Katsumi Yamaoka <yamaoka@jpl.org> wrote: > I realized Gnus searches the unibyte strings "\200", "\201", > "\202" and "\203" in the multibyte buffer named " *gnus work*" > when entering into the summary mode. Your change made Gnus > search multibyte strings and it fails. OTOH, Emacs 21.3.50 > doesn't fail it as follows: > (with-temp-buffer > (set-buffer-multibyte t) > (insert (string-as-unibyte "\200")) > (goto-char (point-min)) > (search-forward (string-as-multibyte "\200") nil t)) > => 2 (02, 0x2) = ?\C-b I learned why the form returns nil for Emacs 22 and non-nil for Emacs 21.3.50 from Kenichi Handa. I also learned that behavior changes by the LANG environments. Next week, I'll look for the right way Gnus should take. I wish you withdraw the change to gnus-sum.el as a emergency measure. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 14:12 ` Katsumi Yamaoka @ 2004-10-15 14:45 ` zrr 2004-10-15 14:51 ` Reiner Steib 2004-10-15 16:19 ` Juri Linkov 2 siblings, 0 replies; 18+ messages in thread From: zrr @ 2004-10-15 14:45 UTC (permalink / raw) Katsumi Yamaoka <yamaoka@jpl.org> writes: >>>>>> In <b9ypt3k5yfh.fsf@jpl.org> >>>>>> Katsumi Yamaoka <yamaoka@jpl.org> wrote: > >> I realized Gnus searches the unibyte strings "\200", "\201", >> "\202" and "\203" in the multibyte buffer named " *gnus work*" >> when entering into the summary mode. Your change made Gnus >> search multibyte strings and it fails. OTOH, Emacs 21.3.50 >> doesn't fail it as follows: > >> (with-temp-buffer >> (set-buffer-multibyte t) >> (insert (string-as-unibyte "\200")) >> (goto-char (point-min)) >> (search-forward (string-as-multibyte "\200") nil t)) >> => 2 (02, 0x2) = ?\C-b > > I learned why the form returns nil for Emacs 22 and non-nil for > Emacs 21.3.50 from Kenichi Handa. I also learned that behavior > changes by the LANG environments. Next week, I'll look for the > right way Gnus should take. I wish you withdraw the change to > gnus-sum.el as a emergency measure. I have reported this bug to Kenichi Handa and went back to old version for the moment. Cheers! Tang ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 14:12 ` Katsumi Yamaoka 2004-10-15 14:45 ` zrr @ 2004-10-15 14:51 ` Reiner Steib 2004-10-15 18:49 ` Derek 2004-10-15 16:19 ` Juri Linkov 2 siblings, 1 reply; 18+ messages in thread From: Reiner Steib @ 2004-10-15 14:51 UTC (permalink / raw) Cc: ding, emacs-devel On Fri, Oct 15 2004, Katsumi Yamaoka wrote: > I learned why the form returns nil for Emacs 22 and non-nil for > Emacs 21.3.50 from Kenichi Handa. I also learned that behavior > changes by the LANG environments. Next week, I'll look for the > right way Gnus should take. I wish you withdraw the change to > gnus-sum.el as a emergency measure. As the problem only affects Emacs 22 (which is in unstable "may eat your files for breakfast" state, IIRC), such an emergency measure is not necessary if we can expect to have a proper fix next week, IMHO. Note that merging (or not merging?) of this emergency-fix from or to the unicode branch will require some extra attention when Miles is syncing other changes. Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 14:51 ` Reiner Steib @ 2004-10-15 18:49 ` Derek 2004-10-17 23:18 ` Katsumi Yamaoka 0 siblings, 1 reply; 18+ messages in thread From: Derek @ 2004-10-15 18:49 UTC (permalink / raw) On 15 Окт 2004, Reiner Steib wrote: On Fri, Oct 15 2004, Katsumi Yamaoka wrote: > >> I learned why the form returns nil for Emacs 22 and non-nil for >> Emacs 21.3.50 from Kenichi Handa. I also learned that behavior >> changes by the LANG environments. Next week, I'll look for the >> right way Gnus should take. I wish you withdraw the change to >> gnus-sum.el as a emergency measure. > > As the problem only affects Emacs 22 (which is in unstable "may eat > your files for breakfast" state, IIRC), such an emergency measure is > not necessary if we can expect to have a proper fix next week, IMHO. This problem affects Emacs 21.3.50 as well. Bug happens with certain combinations of language environment and gnus-summary-line-format. And in old gnus-sum.el this happens too. For me (Russian language environment) old gnus-sum.el: g-s-l-f "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" doesn't work, ":%U%R%z%I%(%[%4L %-23,23f%]%) %s" does. new gnus-sum.el: "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" does work, ":%U%R%z%I%(%[%4L %-23,23f%]%) %s" doesn't. Cyrillic-* and Vietnamese language environments affected. Maybe there's more. -- Denis K.Y. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 18:49 ` Derek @ 2004-10-17 23:18 ` Katsumi Yamaoka 2004-10-19 5:41 ` Katsumi Yamaoka 0 siblings, 1 reply; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-17 23:18 UTC (permalink / raw) >>>>> In <m3d5zj4y1j.fsf@lsi.ru> Derek wrote: > On 15 Окт 2004, Reiner Steib wrote: > This problem affects Emacs 21.3.50 as well. Bug happens with certain > combinations of language environment and gnus-summary-line-format. And > in old gnus-sum.el this happens too. For me (Russian language > environment) > old gnus-sum.el: g-s-l-f "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" doesn't > work, ":%U%R%z%I%(%[%4L %-23,23f%]%) %s" does. > new gnus-sum.el: "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n" does work, > ":%U%R%z%I%(%[%4L %-23,23f%]%) %s" doesn't. > Cyrillic-* and Vietnamese language environments affected. Maybe there's > more. This is just what I learned from Kenichi Handa. I'll fix it within a couple of days and, if possible, I'll also summarize how string-(as|make|to)-multibyte works. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-17 23:18 ` Katsumi Yamaoka @ 2004-10-19 5:41 ` Katsumi Yamaoka 2004-10-19 8:41 ` zrr ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-19 5:41 UTC (permalink / raw) Cc: Juri Linkov >>>>> In <m2pt3ryt2b.fsf@yahoo.com.cn> >>>>> zrr <beijing_2008_gold@yahoo.com.cn> wrote: > I pressed 'E' to expire the artile, but the article still be > regarded as not expired. There is no mark symbol appeared and no > highlight on the current line. >>>>> In <b9yd5zhrl1u.fsf@jpl.org> Katsumi Yamaoka wrote: > I'll fix it within a couple of days and, if possible,... I've fixed it in both the Gnus trunk and the v5-10 branch. It will help not only Emacs 22 users but also Russian users, Ukrainian users and much more. There are two ways that gnus-update-summary-mark-positions inserts a dummy mark in a multibyte buffer. Which of them is used depends on the value of gnus-summary-line-format. (insert ?\200) (insert (format "%c" ?\200)) In order to look for the position of a line where it is inserted, the recent gnus-update-summary-mark-positions searched for the string: (mm-string-as-multibyte "\200") I noticed those three strings will differ by the language environment and the version of Emacs. The following form shows how they are different. (with-temp-buffer (set-buffer-multibyte t) (insert ?\200 (format "%c" ?\200)) (list (car (split-char (char-after (point-min)))) (car (split-char (char-after (1+ (point-min))))) (car (split-char (string-to-char (string-as-multibyte "\200")))))) In the Russian language environment, it returns as follows: ;; Emacs 21.3.50 (eight-bit-control mule-unicode-2500-33ff eight-bit-control) ;; Emacs 22.0.0 (iso-8859-1 iso-8859-1 eight-bit) Even in the English language environment, Emacs 22.0.0 returns: (iso-8859-1 iso-8859-1 eight-bit) Those are the cause of the problem which troubled Tang and Derek. > I'll also summarize how string-(as|make|to)-multibyte works. I'll try translation of Kenichi Handa's advice next time. By the way, I'm not sure whether Juri Linkov's similar changes for the other places don't cause similar problems. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-19 5:41 ` Katsumi Yamaoka @ 2004-10-19 8:41 ` zrr 2004-10-20 5:36 ` Katsumi Yamaoka 2004-10-27 11:55 ` Katsumi Yamaoka 2 siblings, 0 replies; 18+ messages in thread From: zrr @ 2004-10-19 8:41 UTC (permalink / raw) Katsumi Yamaoka <yamaoka@jpl.org> writes: Thank you for your hard work. I will try it soon. Best Regards! Tang >>>>>> In <m2pt3ryt2b.fsf@yahoo.com.cn> >>>>>> zrr <beijing_2008_gold@yahoo.com.cn> wrote: > >> I pressed 'E' to expire the artile, but the article still be >> regarded as not expired. There is no mark symbol appeared and no >> highlight on the current line. > >>>>>> In <b9yd5zhrl1u.fsf@jpl.org> Katsumi Yamaoka wrote: > >> I'll fix it within a couple of days and, if possible,... > > I've fixed it in both the Gnus trunk and the v5-10 branch. It > will help not only Emacs 22 users but also Russian users, > Ukrainian users and much more. > > There are two ways that gnus-update-summary-mark-positions > inserts a dummy mark in a multibyte buffer. Which of them is > used depends on the value of gnus-summary-line-format. > > (insert ?\200) > (insert (format "%c" ?\200)) > > In order to look for the position of a line where it is inserted, > the recent gnus-update-summary-mark-positions searched for the > string: > > (mm-string-as-multibyte "\200") > > I noticed those three strings will differ by the language > environment and the version of Emacs. The following form shows > how they are different. > > (with-temp-buffer > (set-buffer-multibyte t) > (insert ?\200 > (format "%c" ?\200)) > (list > (car (split-char (char-after (point-min)))) > (car (split-char (char-after (1+ (point-min))))) > (car (split-char (string-to-char (string-as-multibyte "\200")))))) > > In the Russian language environment, it returns as follows: > > ;; Emacs 21.3.50 > (eight-bit-control mule-unicode-2500-33ff eight-bit-control) > ;; Emacs 22.0.0 > (iso-8859-1 iso-8859-1 eight-bit) > > Even in the English language environment, Emacs 22.0.0 returns: > > (iso-8859-1 iso-8859-1 eight-bit) > > Those are the cause of the problem which troubled Tang and Derek. > >> I'll also summarize how string-(as|make|to)-multibyte works. > > I'll try translation of Kenichi Handa's advice next time. > > By the way, I'm not sure whether Juri Linkov's similar changes > for the other places don't cause similar problems. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-19 5:41 ` Katsumi Yamaoka 2004-10-19 8:41 ` zrr @ 2004-10-20 5:36 ` Katsumi Yamaoka 2004-10-27 11:55 ` Katsumi Yamaoka 2 siblings, 0 replies; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-20 5:36 UTC (permalink / raw) Cc: Juri Linkov >>>>> In <b9yacuji7t6.fsf@jpl.org> Katsumi Yamaoka wrote: > I'll try translation of Kenichi Handa's advice next time. This is practice of my English composition. No matter what mistake may be there, the responsibility is in me. >>>>> Katsumi Yamaoka wrote: > With the following form, Emacs 21.3.50 returns non-nil, and 22.0.0 > returns nil. Could you let me know for reference what occurs there? > (with-temp-buffer > (set-buffer-multibyte t) > (insert (string-as-unibyte "\200")) > (goto-char (point-min)) > (search-forward (string-as-multibyte "\200") nil t)) ;; Annotation by K.Y.: ;; At that time, I didn't know the possible insertion forms are ;; `(insert ?\200)' and `(insert (format "%c" ?\200))' yet. >>>>> Kenichi Handa wrote: Even with Emacs 21.3.50, the above form will return nil according to a certain language environment (e.g., Vietnamese, etc.). You have to understand first that a unibyte string is converted into a multibyte string by `string-make-multibyte' when inserting a unibyte ^^^^ string in a multibyte buffer. Therefore, the `(insert (string-as-unibyte "\200"))' form is identical to the `(insert (string-make-multibyte (string-as-unibyte "\200")))' form. Where how `string-make-multibyte' converts depends on the language environment. As for Emacs 21, in the Latin-1 language environment, for example, the string of "\200" will be converted into the character which corresponds to \200 in the eight-bit-control charset since the primary charset latin-iso8859-1 doesn't contain \200. Second, `string-as-multibyte' converts STRING into the multibyte string, keeping its byte sequence as much as possible. It works ``as much as possible'' but sometimes brings differences. For example, the string of "\200" will be converted into the byte-sequence of "\236\240" which is a character contained in the eight-bit-control charset. It is the same as the character which the above program inserted in the buffer. Consequently, in the Latin-1 language environment, for example, the above program returned non-nil, in Emacs 21. On the other hand, in Emacs 22, since iso-8859-1 which is the primary charset for Latin-1 contains \200, the form (insert (string-as-unibyte "\200")) inserts the character of U+0080 rather than the character which belongs to eight-bit-control. However, `string-as-multibyte' always converts \200 into the character of eight-bit-control. This is the reason that program returns nil. If you have a need to look for \200 after inserting it in a buffer, it will go well in both Emacs 21 and 22 using the following way for example: (with-temp-buffer (set-buffer-multibyte t) (insert (string-to-multibyte "\200")) (goto-char (point-min)) (search-forward (string-to-multibyte "\200") nil t)) ;; Annotation by K.Y.: ;; I didn't use that way in the `gnus-update-summary-mark-positions' ;; function (which see). `string-to-multibyte' always converts a string into the characters which belong to eight-bit-control or eight-bit-graphic, so the string which it makes will never match usual string. P.S. In Emacs 21, the form `(insert (string-to-multibyte "\200"))' does the same as the form `(insert ?\200)' does. It is because there is not the character corresponding to 128 in the multibyte buffer, and it is treated as the raw byte which belongs to eight-bit-control. However, it differs in Emacs 22. Since the character corresponding to 128 exists as U+0080, it will be inserted. ;; Annotation by K.Y.: ;; I deeply thank to Kenichi Handa. There was all knowledge that I ;; needed. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-19 5:41 ` Katsumi Yamaoka 2004-10-19 8:41 ` zrr 2004-10-20 5:36 ` Katsumi Yamaoka @ 2004-10-27 11:55 ` Katsumi Yamaoka 2004-10-27 23:56 ` Katsumi Yamaoka 2 siblings, 1 reply; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-27 11:55 UTC (permalink / raw) Cc: Kenichi Handa >>>>> In <b9yacuji7t6.fsf@jpl.org> Katsumi Yamaoka wrote: >>>>>> In <m2pt3ryt2b.fsf@yahoo.com.cn> >>>>>> zrr <beijing_2008_gold@yahoo.com.cn> wrote: >> I pressed 'E' to expire the artile, but the article still be >> regarded as not expired. There is no mark symbol appeared and no >> highlight on the current line. > I've fixed it in both the Gnus trunk and the v5-10 branch. It > will help not only Emacs 22 users but also Russian users, > Ukrainian users and much more. Kenichi Handa suggested there is potentially another problem. It existed, even before I modified gnus-sum.el. In order to know column positions of summary lines where marks should be inserted, Gnus makes a dummy summary line. There four characters which correspond to the data \200, \201, \202 and \203 are used as dummy marks, and Gnus look for them. See the gnus-update-summary-mark-positions function: (let ((gnus-replied-mark 129) (gnus-score-below-mark 130) (gnus-score-over-mark 130) (gnus-undownloaded-mark 131) Although those characters will never be printable in the Latin-1 language environment and so forth, they might be usually being used in the Russian language environment, for example. So, it is possible that gnus-summary-line-format contains them and gnus-user-format-function-* may return them. In those cases, Gnus will recognize incorrect mark positions. You can try it using the following way: (set-language-environment 'Russian) (setq gnus-summary-line-format (concat (string-make-multibyte "\200\201\202\203") "%U%R%z%I%(%[%4L: %-23,23f%]%) %s\n") (gnus-update-format-specifications t 'summary) He hinted using \0, \1, etc. instead. However, I'm not sure of whether they don't bring about damage. For the moment, I'm planning to replace \200, \201, etc. to just space, if gnus-summary-line-format contains them or gnus-user-format-function-* returns them. Is it unnecessary worries? ;-) ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-27 11:55 ` Katsumi Yamaoka @ 2004-10-27 23:56 ` Katsumi Yamaoka 0 siblings, 0 replies; 18+ messages in thread From: Katsumi Yamaoka @ 2004-10-27 23:56 UTC (permalink / raw) Cc: Kenichi Handa >>>>> In <b9ylldse5or.fsf@jpl.org> Katsumi Yamaoka wrote: > Kenichi Handa suggested there is potentially another problem. [...] > For the moment, I'm planning to replace \200, \201, etc. to > just space, if gnus-summary-line-format contains them or > gnus-user-format-function-* returns them. I probably found a better solution. I'll grapple with it. BTW, I noticed the gnus-update-summary-mark-positions function is called twice when entering into a group in addition to this. I'll also look into it. ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [BUG]What does this mean:"Mention that multibyte characters 2004-10-15 14:12 ` Katsumi Yamaoka 2004-10-15 14:45 ` zrr 2004-10-15 14:51 ` Reiner Steib @ 2004-10-15 16:19 ` Juri Linkov 2 siblings, 0 replies; 18+ messages in thread From: Juri Linkov @ 2004-10-15 16:19 UTC (permalink / raw) Cc: ding Katsumi Yamaoka <yamaoka@jpl.org> writes: > I learned why the form returns nil for Emacs 22 and non-nil for > Emacs 21.3.50 from Kenichi Handa. I also learned that behavior > changes by the LANG environments. Next week, I'll look for the > right way Gnus should take. I wish you withdraw the change to > gnus-sum.el as a emergency measure. Never retreat. If there is no acceptable solution at hand, at least as a emergency measure we can check for Emacs version and use mm-string-as-multibyte for versions with major number less than 22. -- Juri Linkov http://www.jurta.org/emacs/ ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2004-10-27 23:56 UTC | newest] Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-10-14 15:51 [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? zrr 2004-10-14 17:24 ` [BUG]What does this mean:"Mention that multibyte characters Reiner Steib 2004-10-14 18:33 ` zrr 2004-10-14 17:44 ` [BUG]What does this mean:"Mention that multibyte characters don't work as marks."? Xavier Maillard 2004-10-14 18:41 ` [BUG]What does this mean:"Mention that multibyte characters zrr 2004-10-14 21:33 ` Xavier Maillard 2004-10-15 5:43 ` Katsumi Yamaoka 2004-10-15 14:12 ` Katsumi Yamaoka 2004-10-15 14:45 ` zrr 2004-10-15 14:51 ` Reiner Steib 2004-10-15 18:49 ` Derek 2004-10-17 23:18 ` Katsumi Yamaoka 2004-10-19 5:41 ` Katsumi Yamaoka 2004-10-19 8:41 ` zrr 2004-10-20 5:36 ` Katsumi Yamaoka 2004-10-27 11:55 ` Katsumi Yamaoka 2004-10-27 23:56 ` Katsumi Yamaoka 2004-10-15 16:19 ` Juri Linkov
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).