emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: [:upper:] inconsistency


From: Stefan Monnier
Subject: Re: [:upper:] inconsistency
Date: Mon, 08 Jan 2007 11:50:05 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.91 (gnu/linux)

>> +        ;; Even if there's no uppercase char, we want to detect the use of
>> +        ;; [:upper:] char-class.

> Similarly, it would make sense for [:lower:] to disable case-folding.

Indeed.  And my previous patch was confused.  I believe the one below
should work.


        Stefan


--- orig/lisp/isearch.el
+++ mod/lisp/isearch.el
@@ -2297,7 +2297,17 @@
              (setq found t))
          (setq quote-flag nil)))
       (setq i (1+ i)))
-    (not found)))
+    (not (or found
+             ;; Even if there's no uppercase char, we want to detect the use
+             ;; of [:upper:] or [:lower:] char-class, which indicates
+             ;; clearly that the user cares about case distinction.
+             (and regexp-flag (string-match "\\[:\\(upp\\|low\\)er:]" string)
+                  (condition-case err
+                      (progn
+                        (string-match (substring string 0 (match-beginning 0)) 
"")
+                        nil)
+                    (invalid-regexp
+                     (equal "Unmatched [ or [^" (cadr err)))))))))
 
 ;; Portability functions to support various Emacs versions.
 




reply via email to

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