* [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive]
@ 2007-07-15 16:50 Richard Stallman
0 siblings, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2007-07-15 16:50 UTC (permalink / raw)
To: emacs-devel
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 -------
^ permalink raw reply [flat|nested] 3+ messages in thread
* [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive]
@ 2007-07-23 4:28 Richard Stallman
2007-07-23 21:32 ` Stefan Monnier
0 siblings, 1 reply; 3+ messages in thread
From: Richard Stallman @ 2007-07-23 4:28 UTC (permalink / raw)
To: emacs-devel
[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 -------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive]
2007-07-23 4:28 [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive] Richard Stallman
@ 2007-07-23 21:32 ` Stefan Monnier
0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2007-07-23 21:32 UTC (permalink / raw)
To: rms; +Cc: emacs-devel
> [I sent this message a week ago but did not get a response.]
> Would someone please install this and ack?
Installed.
Stefan
> ------- 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 -------
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-07-23 21:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-23 4:28 [cjm@cjmweb.net: [PATCH] perform-replace is too case-sensitive] Richard Stallman
2007-07-23 21:32 ` Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2007-07-15 16:50 Richard Stallman
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.