all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] perform-replace is too case-sensitive
@ 2007-07-14 17:22 Christopher J. Madsen
  0 siblings, 0 replies; only message in thread
From: Christopher J. Madsen @ 2007-07-14 17:22 UTC (permalink / raw)
  To: bug-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

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


[-- Attachment #2: replace.patch --]
[-- Type: text/plain, Size: 910 bytes --]

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

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-14 17:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-14 17:22 [PATCH] perform-replace is too case-sensitive Christopher J. Madsen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.