comparison src/abbrev.c @ 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 5297e155e1d2
children 3e7833a8e16f
comparison
equal deleted inserted replaced
9053:4887fc1a2dda 9054:ddb22c22a80d
22 #include <stdio.h> 22 #include <stdio.h>
23 #include "lisp.h" 23 #include "lisp.h"
24 #include "commands.h" 24 #include "commands.h"
25 #include "buffer.h" 25 #include "buffer.h"
26 #include "window.h" 26 #include "window.h"
27 #include "syntax.h"
27 28
28 /* An abbrev table is an obarray. 29 /* An abbrev table is an obarray.
29 Each defined abbrev is represented by a symbol in that obarray 30 Each defined abbrev is represented by a symbol in that obarray
30 whose print name is the abbreviation. 31 whose print name is the abbreviation.
31 The symbol's value is a string which is the expansion. 32 The symbol's value is a string which is the expansion.
316 caped: ; 317 caped: ;
317 } 318 }
318 else if (uccount) 319 else if (uccount)
319 { 320 {
320 /* Abbrev included some caps. Cap first initial of expansion */ 321 /* Abbrev included some caps. Cap first initial of expansion */
321 int old_zv = ZV; 322 int pos = wordstart;
322 int old_pt = point; 323
323 324 /* Find the initial. */
324 /* Don't let Fcapitalize_word operate on text after point. */ 325 while (pos < point
325 ZV = point; 326 && SYNTAX (*BUF_CHAR_ADDRESS (current_buffer, pos)) != Sword)
326 SET_PT (wordstart); 327 pos++;
327 Fcapitalize_word (make_number (1)); 328
328 329 /* Change just that. */
329 SET_PT (old_pt); 330 Fupcase_initials_region (make_number (pos), make_number (pos + 1));
330 ZV = old_zv;
331 } 331 }
332 332
333 hook = XSYMBOL (sym)->function; 333 hook = XSYMBOL (sym)->function;
334 if (!NILP (hook)) 334 if (!NILP (hook))
335 call0 (hook); 335 call0 (hook);