Gnus development mailing list
 help / color / mirror / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: yamaoka@jpl.org, ding@gnus.org, emacs-devel@gnu.org
Subject: Re: re-search bug?
Date: Fri, 4 Feb 2005 10:14:52 +0900 (JST)	[thread overview]
Message-ID: <200502040114.KAA29556@etlken.m17n.org> (raw)
In-Reply-To: <E1CwmQS-0003Eo-S0@fencepost.gnu.org> (message from Richard Stallman on Thu, 03 Feb 2005 14:14:00 -0500)

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

  reply	other threads:[~2005-02-04  1:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-03  1:12 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 [this message]
2005-02-04 14:03       ` Stefan Monnier
2005-02-05 17:39         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200502040114.KAA29556@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=yamaoka@jpl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).