emacs-devel
[Top][All Lists]
Advanced

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

address@hidden: [PATCH] perform-replace is too case-sensitive]


From: Richard Stallman
Subject: address@hidden: [PATCH] perform-replace is too case-sensitive]
Date: Mon, 23 Jul 2007 00:28:00 -0400

[I sent this message a week ago but did not get a response.]

Would someone please install this and ack?

------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
        autolearn=failed version=3.1.0
Date: Sat, 14 Jul 2007 12:22:04 -0500
From: "Christopher J. Madsen" <address@hidden>
MIME-Version: 1.0
To: address@hidden
Content-Type: multipart/mixed; boundary="------------040608040002060406040300"
Subject: [PATCH] perform-replace is too case-sensitive

This is a multi-part message in MIME format.
- --------------040608040002060406040300
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

perform-replace examines the search string for upper-case characters,
and forces a case-sensitive search if it finds any.  But it doesn't
consider that a regexp may contain upper-case characters without being
case-sensitive (e.g., a\S-).

Isearch has a function (isearch-no-upper-case-p) that was designed to
address this issue.  I've attached a patch to make perform-replace use
isearch-no-upper-case-p instead of its naive comparison.


In GNU Emacs 22.1.1 (i686-pc-linux-gnu, GTK+ Version 2.10.11)
 of 2007-06-07 on bit
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
configured using `configure  '--prefix=/usr' '--host=i686-pc-linux-gnu'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib'
'--program-suffix=-emacs-22' '--infodir=/usr/share/info/emacs-22'
'--without-carbon' '--with-sound' '--with-x' '--with-xpm'
'--with-toolkit-scroll-bars' '--with-jpeg' '--with-tiff' '--with-gif'
'--with-png' '--with-x-toolkit=gtk' '--build=i686-pc-linux-gnu'
'build_alias=i686-pc-linux-gnu' 'host_alias=i686-pc-linux-gnu'
'CFLAGS=-march=athlon-xp -pipe -O2''

Important settings:
  value of $LC_ALL: en_US
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t


- --------------040608040002060406040300
Content-Type: text/plain;
 name="replace.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="replace.patch"

- --- ./lisp/replace.el 2007-06-07 18:59:12.298007424 -0500
+++ ./lisp/replace.el   2007-07-14 11:57:46.046830123 -0500
@@ -1409,11 +1409,10 @@ (defun perform-replace (from-string repl
   (and query-flag minibuffer-auto-raise
        (raise-frame (window-frame (minibuffer-window))))
   (let ((nocasify (not (and case-fold-search case-replace
- -                         (string-equal from-string
- -                                       (downcase from-string)))))
+                            (isearch-no-upper-case-p from-string 
regexp-flag))))
        (case-fold-search (and case-fold-search
- -                            (string-equal from-string
- -                                          (downcase from-string))))
+                               (isearch-no-upper-case-p from-string
+                                                        regexp-flag)))
        (literal (or (not regexp-flag) (eq regexp-flag 'literal)))
        (search-function (if regexp-flag 're-search-forward 'search-forward))
        (search-string from-string)

- --------------040608040002060406040300
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
bug-gnu-emacs mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

- --------------040608040002060406040300--
------- End of forwarded message -------





reply via email to

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