changeset 8526:2b7b23059f1b

(Freplace_match): Treat caseless initial like a lowercase initial.
author Richard M. Stallman <rms@gnu.org>
date Thu, 11 Aug 1994 22:57:20 +0000
parents fcc070bca96d
children 5a5893b8bc1c
files src/search.c
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/search.c	Thu Aug 11 21:50:39 1994 +0000
+++ b/src/search.c	Thu Aug 11 22:57:20 1994 +0000
@@ -1182,7 +1182,7 @@
   int some_multiletter_word;
   int some_lowercase;
   int some_uppercase;
-  int some_lowercase_initial;
+  int some_nonuppercase_initial;
   register int c, prevc;
   int inslen;
 
@@ -1212,7 +1212,7 @@
 	 is more than one letter long. */
       some_multiletter_word = 0;
       some_lowercase = 0;
-      some_lowercase_initial = 0;
+      some_nonuppercase_initial = 0;
       some_uppercase = 0;
 
       for (pos = search_regs.start[0]; pos < last; pos++)
@@ -1224,7 +1224,7 @@
 
 	      some_lowercase = 1;
 	      if (SYNTAX (prevc) != Sword)
-		some_lowercase_initial = 1;
+		some_nonuppercase_initial = 1;
 	      else
 		some_multiletter_word = 1;
 	    }
@@ -1236,6 +1236,13 @@
 	      else
 		some_multiletter_word = 1;
 	    }
+	  else
+	    {
+	      /* If the initial is a caseless word constituent,
+		 treat that like a lowercase initial.  */
+	      if (SYNTAX (prevc) != Sword)
+		some_nonuppercase_initial = 1;
+	    }
 
 	  prevc = c;
 	}
@@ -1245,9 +1252,9 @@
       if (! some_lowercase && some_multiletter_word)
 	case_action = all_caps;
       /* Capitalize each word, if the old text has all capitalized words.  */
-      else if (!some_lowercase_initial && some_multiletter_word)
+      else if (!some_nonuppercase_initial && some_multiletter_word)
 	case_action = cap_initial;
-      else if (!some_lowercase_initial && some_uppercase)
+      else if (!some_nonuppercase_initial && some_uppercase)
 	/* Should x -> yz, operating on X, give Yz or YZ?
 	   We'll assume the latter.  */
 	case_action = all_caps;