Gnus development mailing list
 help / color / mirror / Atom feed
* re-search bug?
@ 2005-02-03  1:12 Katsumi Yamaoka
  2005-02-03  2:23 ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-02-03  1:12 UTC (permalink / raw)
  Cc: ding

Hi,

With the latest Emacs CVS, the following form causes an error.

(with-temp-buffer
  (insert "Sender: ")
  (let ((pt (point)))
    (insert "ding-owner@lists.math.uh.edu")
    (re-search-backward "ding-owner@lists\\.math\\.uh\\.edu" pt)))

It's quite strange.  Because of this, all mails delivered to the
ding list are stored into the `bogus' group.  Please help!



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

* Re: re-search bug?
  2005-02-03  1:12 re-search bug? Katsumi Yamaoka
@ 2005-02-03  2:23 ` Kenichi Handa
  2005-02-03  3:13   ` Katsumi Yamaoka
  2005-02-03 19:14   ` Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Kenichi Handa @ 2005-02-03  2:23 UTC (permalink / raw)
  Cc: ding, emacs-devel

In article <b9yekfytpjy.fsf@jpl.org>, Katsumi Yamaoka <yamaoka@jpl.org> writes:

> Hi,
> With the latest Emacs CVS, the following form causes an error.

> (with-temp-buffer
>   (insert "Sender: ")
>   (let ((pt (point)))
>     (insert "ding-owner@lists.math.uh.edu")
>     (re-search-backward "ding-owner@lists\\.math\\.uh\\.edu" pt)))

> It's quite strange.  Because of this, all mails delivered to the
> ding list are stored into the `bogus' group.  Please help!

This is due to my last change for handling cases for
I-WITH-DOT-ABOVE and DOTLESS-i.  I've just cancelled those
changes.

It seems that the current code in casefiddle.c has a serious
bug in supporting this kind of case-mapping.

i <--up/downcase--> I
DOTLESS-i --upcase-> I
I-WITH-DOT-ABOVE --downcase-> i

---
Ken'ichi HANDA
handa@m17n.org

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

* Re: re-search bug?
  2005-02-03  2:23 ` Kenichi Handa
@ 2005-02-03  3:13   ` Katsumi Yamaoka
  2005-02-03 19:14   ` Richard Stallman
  1 sibling, 0 replies; 7+ messages in thread
From: Katsumi Yamaoka @ 2005-02-03  3:13 UTC (permalink / raw)
  Cc: emacs-devel, ding

>>>>> In <200502030223.LAA24558@etlken.m17n.org> Kenichi Handa wrote:

>> With the latest Emacs CVS, the following form causes an error.

>> (with-temp-buffer
>>   (insert "Sender: ")
>>   (let ((pt (point)))
>>     (insert "ding-owner@lists.math.uh.edu")
>>     (re-search-backward "ding-owner@lists\\.math\\.uh\\.edu" pt)))

> This is due to my last change for handling cases for
> I-WITH-DOT-ABOVE and DOTLESS-i.  I've just cancelled those
> changes.

I confirmed it has been fixed.  Thanks.  At just the time
Handa-san fixed it, I was looking for the cause of the problem. ;-)

> It seems that the current code in casefiddle.c has a serious
> bug in supporting this kind of case-mapping.

> i <--up/downcase--> I
> DOTLESS-i --upcase-> I
> I-WITH-DOT-ABOVE --downcase-> i

I see it is the case issue.  The form above did work if
`case-fold-search' was bound to nil.

Regards,




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

* Re: re-search bug?
  2005-02-03  2:23 ` Kenichi Handa
  2005-02-03  3:13   ` Katsumi Yamaoka
@ 2005-02-03 19:14   ` Richard Stallman
  2005-02-04  1:14     ` Kenichi Handa
  1 sibling, 1 reply; 7+ messages in thread
From: Richard Stallman @ 2005-02-03 19:14 UTC (permalink / raw)
  Cc: yamaoka, ding, emacs-devel

    It seems that the current code in casefiddle.c has a serious
    bug in supporting this kind of case-mapping.

    i <--up/downcase--> I
    DOTLESS-i --upcase-> I
    I-WITH-DOT-ABOVE --downcase-> i

Do you want to debug the serious bug?
If you send me a precise test case, I could try to debug it.

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

* Re: re-search bug?
  2005-02-03 19:14   ` Richard Stallman
@ 2005-02-04  1:14     ` Kenichi Handa
  2005-02-04 14:03       ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Kenichi Handa @ 2005-02-04  1:14 UTC (permalink / raw)
  Cc: yamaoka, ding, emacs-devel

In article <E1CwmQS-0003Eo-S0@fencepost.gnu.org>, Richard Stallman <rms@gnu.org> writes:

>     It seems that the current code in casefiddle.c has a serious
>     bug in supporting this kind of case-mapping.

>     i <--up/downcase--> I
>     DOTLESS-i --upcase-> I
>     I-WITH-DOT-ABOVE --downcase-> i

> Do you want to debug the serious bug?

I can't work on it at the moment because I'll soon go abroad
and be off-line for a week.

Anyway, there's a possibility that the bug is not in
casefiddle.c but in case-fold searching and regexp matching
functions.  I'm not sure.

> If you send me a precise test case, I could try to debug it.

Please evaluate the attached code.  Then try these:

(test-regexp) => 1   ; correct
(test-search) => nil ; correct
(setup-case-table)
(test-regexp) => nil ; incorrect
(test-search) => nil ; incorrect
(recover-case-table)
(test-regexp) => 1   ; correct
(test-search) => nil ; correct

---
Ken'ichi HANDA
handa@m17n.org

(require 'case-table)

(defvar original-case-table (copy-case-table (standard-case-table)))
(defvar dotted-I (make-char 'latin-iso8859-9 ?\335))
(defvar dotless-i (make-char 'latin-iso8859-9 ?\375))

(defun setup-case-table ()
  (let ((tbl (standard-case-table)))
    (set-downcase-syntax dotted-I ?i tbl)
    (set-upcase-syntax ?I dotless-i tbl)))

(defun recover-case-table ()
  (set-standard-case-table (copy-case-table original-case-table)))

(defun test-regexp ()
  (with-temp-buffer
    (let ((case-fold-search t))
      (insert "i.")
      (re-search-backward "i\\." nil t))))

(defun test-search ()
  (with-temp-buffer
    (let ((case-fold-search t))
      (insert dotless-i)
      (search-backward "i" nil t))))

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

* Re: re-search bug?
  2005-02-04  1:14     ` Kenichi Handa
@ 2005-02-04 14:03       ` Stefan Monnier
  2005-02-05 17:39         ` Richard Stallman
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2005-02-04 14:03 UTC (permalink / raw)
  Cc: rms, yamaoka, ding, emacs-devel

>> i <--up/downcase--> I
>> DOTLESS-i --upcase-> I
>> I-WITH-DOT-ABOVE --downcase-> i

>> Do you want to debug the serious bug?

> I can't work on it at the moment because I'll soon go abroad
> and be off-line for a week.

> Anyway, there's a possibility that the bug is not in
> casefiddle.c but in case-fold searching and regexp matching
> functions.  I'm not sure.

That's what I would expect.  I think even the definition of "case fold
search" is not as obvious as it seems.  Does it mean (equal (upcase X)
(upcase Y)) or (equal (downcase X) (downcase Y)) or something yet different?

Thanks for the test case,


        Stefan



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

* Re: re-search bug?
  2005-02-04 14:03       ` Stefan Monnier
@ 2005-02-05 17:39         ` Richard Stallman
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Stallman @ 2005-02-05 17:39 UTC (permalink / raw)
  Cc: yamaoka, emacs-devel, ding, handa

    That's what I would expect.  I think even the definition of "case fold
    search" is not as obvious as it seems.  Does it mean (equal (upcase X)
    (upcase Y)) or (equal (downcase X) (downcase Y)) or something yet different?

Neither of those.  It is supposed to find matches whenever the
characters are connected by any sequence of case conversions.  This
uses the canon table and the equiv table.  In search_buffer and its
subroutines, TRT refers to the canon table, and INVERSE_TRT refers to
the equiv table.  So the table passed to regex searching is the canon
table.

Definitions of these two tables:

CANONICALIZE maps each character to a canonical equivalent;
 any two characters that are related by case-conversion have the same
 canonical equivalent character...
EQUIVALENCES is a map that cyclicly permutes each equivalence class
 (of characters with the same canonical equivalent)...

A good first step would be to look at the canon and equiv table
contents, in the case that fails, and see if they correspond correctly
to the upcase and downcase tables.

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

end of thread, other threads:[~2005-02-05 17:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-03  1:12 re-search bug? Katsumi Yamaoka
2005-02-03  2:23 ` Kenichi Handa
2005-02-03  3:13   ` Katsumi Yamaoka
2005-02-03 19:14   ` Richard Stallman
2005-02-04  1:14     ` Kenichi Handa
2005-02-04 14:03       ` Stefan Monnier
2005-02-05 17:39         ` Richard Stallman

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).