all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: emacs-devel@gnu.org
Subject: [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive]
Date: Mon, 23 Jul 2007 00:28:00 -0400	[thread overview]
Message-ID: <E1ICpWa-0002qU-2t@fencepost.gnu.org> (raw)

[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" <cjm@cjmweb.net>
MIME-Version: 1.0
To: bug-gnu-emacs@gnu.org
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
bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

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

             reply	other threads:[~2007-07-23  4:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-23  4:28 Richard Stallman [this message]
2007-07-23 21:32 ` [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive] Stefan Monnier
  -- strict thread matches above, loose matches on Subject: below --
2007-07-15 16:50 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=E1ICpWa-0002qU-2t@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.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.
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.