summaryrefslogtreecommitdiff
path: root/src/abbrev.c
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-09-24 03:47:07 +0000
committerRichard M. Stallman <rms@gnu.org>1994-09-24 03:47:07 +0000
commit821a4ff05d93f2c8e68adcbb63adaa534525e5e1 (patch)
tree3257343b2b66eaa2cb3e53d2217092c4173d23f2 /src/abbrev.c
parent7215ecc5c3505594f2fdf9c6e749f2cd892dffc0 (diff)
downloademacs-821a4ff05d93f2c8e68adcbb63adaa534525e5e1.tar.gz
(Fexpand_abbrev): Instead of Fcapitalize_region,
just upcase the first initial.
Diffstat (limited to 'src/abbrev.c')
-rw-r--r--src/abbrev.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/abbrev.c b/src/abbrev.c
index 8338a0da558..148f8172297 100644
--- a/src/abbrev.c
+++ b/src/abbrev.c
@@ -24,6 +24,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#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 @@ Returns t if expansion took place.")
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;