diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-09-24 03:47:07 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-09-24 03:47:07 +0000 |
commit | 7169beb1473e47b1e434901b0983091c8e43a4fe (patch) | |
tree | 54d6bb0f141a9e63d1c55e6cf6d59ac5ecfe643e /src/abbrev.c | |
parent | 8cef1f785360141dbf660e9c8be9d5c1bb36d802 (diff) | |
download | emacs-7169beb1473e47b1e434901b0983091c8e43a4fe.tar.gz |
(Fexpand_abbrev): Instead of Fcapitalize_region,
just upcase the first initial.
Diffstat (limited to 'src/abbrev.c')
-rw-r--r-- | src/abbrev.c | 16 |
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; |