+ del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1);
+
+ insert_from_string (expansion, 0, 0, XSTRING (expansion)->size,
+ STRING_BYTES (XSTRING (expansion)), 1);
+ SET_PT (PT + whitecnt);
+
+ if (uccount && !lccount)
+ {
+ /* Abbrev was all caps */
+ /* If expansion is multiple words, normally capitalize each word */
+ /* This used to be if (!... && ... >= ...) Fcapitalize; else Fupcase
+ but Megatest 68000 compiler can't handle that */
+ if (!abbrev_all_caps)
+ if (scan_words (PT, -1) > scan_words (wordstart, 1))
+ {
+ Fupcase_initials_region (make_number (wordstart),
+ make_number (PT));
+ goto caped;
+ }
+ /* If expansion is one word, or if user says so, upcase it all. */
+ Fupcase_region (make_number (wordstart), make_number (PT));
+ caped: ;
+ }
+ else if (uccount)
+ {
+ /* Abbrev included some caps. Cap first initial of expansion */
+ int pos = wordstart_byte;
+
+ /* Find the initial. */
+ while (pos < PT_BYTE
+ && SYNTAX (*BUF_BYTE_ADDRESS (current_buffer, pos)) != Sword)
+ pos++;
+
+ /* Change just that. */
+ pos = BYTE_TO_CHAR (pos);
+ Fupcase_initials_region (make_number (pos), make_number (pos + 1));
+ }