changeset 9054:ddb22c22a80d

(Fexpand_abbrev): Instead of Fcapitalize_region, just upcase the first initial.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Sep 1994 03:47:07 +0000
parents 4887fc1a2dda
children 2e089bdec449
files src/abbrev.c
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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;