# HG changeset patch
# User Richard M. Stallman <rms@gnu.org>
# Date 780378427 0
# Node ID ddb22c22a80dcbde92bb5280063a68958b17c9fd
# Parent  4887fc1a2dda54e2fc2418fa4c199418bc6fdf69
(Fexpand_abbrev): Instead of Fcapitalize_region,
just upcase the first initial.

diff -r 4887fc1a2dda -r ddb22c22a80d src/abbrev.c
--- a/src/abbrev.c	Sat Sep 24 02:03:32 1994 +0000
+++ b/src/abbrev.c	Sat Sep 24 03:47:07 1994 +0000
@@ -24,6 +24,7 @@
 #include "commands.h"
 #include "buffer.h"
 #include "window.h"
+#include "syntax.h"
 
 /* An abbrev table is an obarray.
  Each defined abbrev is represented by a symbol in that obarray
@@ -318,16 +319,15 @@
   else if (uccount)
     {
       /* Abbrev included some caps.  Cap first initial of expansion */
-      int old_zv = ZV;
-      int old_pt = point;
+      int pos = wordstart;
 
-      /* Don't let Fcapitalize_word operate on text after point.  */
-      ZV = point;
-      SET_PT (wordstart);
-      Fcapitalize_word (make_number (1));
+      /* Find the initial.  */
+      while (pos < point
+	     && SYNTAX (*BUF_CHAR_ADDRESS (current_buffer, pos)) != Sword)
+	pos++;
 
-      SET_PT (old_pt);
-      ZV = old_zv;
+      /* Change just that.  */
+      Fupcase_initials_region (make_number (pos), make_number (pos + 1));
     }
 
   hook = XSYMBOL (sym)->function;