Article View: gnu.emacs.bug
Article #99682perform-replace nocasify
From: macrakis
Date: Wed, 04 Jul 1990 12:12
Date: Wed, 04 Jul 1990 12:12
22 lines
1391 bytes
1391 bytes
GNU Emacs 18.53.11 on NeXT 1.0.1
Currently, nocasify is set as follows in perform-replace:
(not (and case-fold-search case-replace
(string-equal from-string
(downcase from-string))))
However, there is no point in casifying if (upcase to-string) is the
same as to-string! This is actually a pretty common case (to-string
is empty, or consists only of punctuation, etc.). So I would suggest:
(or (not (and case-fold-search case-replace
(string-equal from-string
(downcase from-string))))
(string-equal to-string (upcase to-string)))
or (equivalent but perhaps less clear):
(not (and case-fold-search case-replace
(string-equal from-string
(downcase from-string))
(not (string-equal to-string (upcase to-string)))))
Technical Details
Message-ID:
<9007041311.AA06339@.dupuis.gr.osf.org.>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!seismo!ukma!dftsrv!mimsy!haven!purdue!tut.cis.ohio-state.edu!ri.osf.fr!macrakisShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,847a879e95fc8740,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-07-04 07:21:03 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!seismo!ukma!dftsrv!mimsy!haven!purdue!tut.cis.ohio-state.edu!ri.osf.fr!macrakis From: macrakis@ri.osf.fr Newsgroups: gnu.emacs.bug Subject: perform-replace nocasify Message-ID: <9007041311.AA06339@.dupuis.gr.osf.org.> Date: 4 Jul 90 12:12:07 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 22 Posted: Wed Jul 4 13:12:07 1990