emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re-search bug?


From: Kenichi Handa
Subject: Re: re-search bug?
Date: Fri, 4 Feb 2005 10:14:52 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3.50 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, Richard Stallman <address@hidden> 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
address@hidden

(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 via email to

[Prev in Thread] Current Thread [Next in Thread]