diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-01-05 17:25:39 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-01-05 17:25:39 +0000 |
commit | fc4126860550e4e8f95e8e6e4bb5e953b1bca84a (patch) | |
tree | d888fc44b79ce5576655895f5c85d4d215c2c9c9 /src/abbrev.c | |
parent | 520afed181d4639b12155362aa6faa7e09531230 (diff) | |
download | emacs-fc4126860550e4e8f95e8e6e4bb5e953b1bca84a.tar.gz |
(Fexpand_abbrev): Pass both kinds of size to oblookup.
(Fexpand_abbrev): Pass new args to insert_from_string.
(Funexpand_abbrev): Likewise. Use size_byte.
Diffstat (limited to 'src/abbrev.c')
-rw-r--r-- | src/abbrev.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/abbrev.c b/src/abbrev.c index a124101627e..bab76bcd11f 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -284,11 +284,13 @@ Returns the abbrev symbol, if expansion took place.") } if (VECTORP (current_buffer->abbrev_table)) - sym = oblookup (current_buffer->abbrev_table, buffer, p - buffer); + sym = oblookup (current_buffer->abbrev_table, buffer, + wordend - wordstart, wordend_byte - wordstart_byte); else XSETFASTINT (sym, 0); if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) - sym = oblookup (Vglobal_abbrev_table, buffer, p - buffer); + sym = oblookup (Vglobal_abbrev_table, buffer, + wordend - wordstart, wordend_byte - wordstart_byte); if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) return value; @@ -321,7 +323,8 @@ Returns the abbrev symbol, if expansion took place.") del_range_both (wordstart, wordend, wordstart_byte, wordend_byte, 1); - insert_from_string (expansion, 0, XSTRING (expansion)->size, 1); + insert_from_string (expansion, 0, 0, XSTRING (expansion)->size, + XSTRING (expansion)->size_byte, 1); SET_PT (PT + whitecnt); if (uccount && !lccount) @@ -387,10 +390,11 @@ is not undone.") if (!STRINGP (val)) error ("value of abbrev-symbol must be a string"); zv_before = ZV; - del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size, 1); + del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size_byte, 1); /* Don't inherit properties here; just copy from old contents. */ - insert_from_string (Vlast_abbrev_text, 0, - XSTRING (Vlast_abbrev_text)->size, 0); + insert_from_string (Vlast_abbrev_text, 0, 0, + XSTRING (Vlast_abbrev_text)->size, + XSTRING (Vlast_abbrev_text)->size_byte, 0); Vlast_abbrev_text = Qnil; /* Total number of characters deleted. */ adjust = ZV - zv_before; |