changeset 6679:490b7e2db978

(Freplace_match): Don't capitalize unless all matched words are capitalized.
author Karl Heuer <kwzh@gnu.org>
date Tue, 05 Apr 1994 04:51:58 +0000
parents e29adbacde1d
children 1cf70b5f6d6d
files src/search.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Tue Apr 05 03:50:46 1994 +0000
+++ b/src/search.c	Tue Apr 05 04:51:58 1994 +0000
@@ -1174,7 +1174,7 @@
   register int pos, last;
   int some_multiletter_word;
   int some_lowercase;
-  int some_uppercase_initial;
+  int some_lowercase_initial;
   register int c, prevc;
   int inslen;
 
@@ -1204,7 +1204,7 @@
 	 is more than one letter long. */
       some_multiletter_word = 0;
       some_lowercase = 0;
-      some_uppercase_initial = 0;
+      some_lowercase_initial = 0;
 
       for (pos = search_regs.start[0]; pos < last; pos++)
 	{
@@ -1215,14 +1215,14 @@
 
 	      some_lowercase = 1;
 	      if (SYNTAX (prevc) != Sword)
-		;
+		some_lowercase_initial = 1;
 	      else
 		some_multiletter_word = 1;
 	    }
 	  else if (!NOCASEP (c))
 	    {
 	      if (SYNTAX (prevc) != Sword)
-		some_uppercase_initial = 1;
+		;
 	      else
 		some_multiletter_word = 1;
 	    }
@@ -1234,8 +1234,8 @@
 	 and has at least one multiletter word.  */
       if (! some_lowercase && some_multiletter_word)
 	case_action = all_caps;
-      /* Capitalize each word, if the old text has a capitalized word.  */
-      else if (some_uppercase_initial)
+      /* Capitalize each word, if the old text has all capitalized words.  */
+      else if (!some_lowercase_initial && some_multiletter_word)
 	case_action = cap_initial;
       else
 	case_action = nochange;