aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1998-01-05 17:25:39 +0000
committerRichard M. Stallman1998-01-05 17:25:39 +0000
commitfc4126860550e4e8f95e8e6e4bb5e953b1bca84a (patch)
treed888fc44b79ce5576655895f5c85d4d215c2c9c9 /src
parent520afed181d4639b12155362aa6faa7e09531230 (diff)
downloademacs-fc4126860550e4e8f95e8e6e4bb5e953b1bca84a.tar.gz
emacs-fc4126860550e4e8f95e8e6e4bb5e953b1bca84a.zip
(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')
-rw-r--r--src/abbrev.c16
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.")
284 } 284 }
285 285
286 if (VECTORP (current_buffer->abbrev_table)) 286 if (VECTORP (current_buffer->abbrev_table))
287 sym = oblookup (current_buffer->abbrev_table, buffer, p - buffer); 287 sym = oblookup (current_buffer->abbrev_table, buffer,
288 wordend - wordstart, wordend_byte - wordstart_byte);
288 else 289 else
289 XSETFASTINT (sym, 0); 290 XSETFASTINT (sym, 0);
290 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 291 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value))
291 sym = oblookup (Vglobal_abbrev_table, buffer, p - buffer); 292 sym = oblookup (Vglobal_abbrev_table, buffer,
293 wordend - wordstart, wordend_byte - wordstart_byte);
292 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value)) 294 if (INTEGERP (sym) || NILP (XSYMBOL (sym)->value))
293 return value; 295 return value;
294 296
@@ -321,7 +323,8 @@ Returns the abbrev symbol, if expansion took place.")
321 323
322 del_range_both (wordstart, wordend, wordstart_byte, wordend_byte, 1); 324 del_range_both (wordstart, wordend, wordstart_byte, wordend_byte, 1);
323 325
324 insert_from_string (expansion, 0, XSTRING (expansion)->size, 1); 326 insert_from_string (expansion, 0, 0, XSTRING (expansion)->size,
327 XSTRING (expansion)->size_byte, 1);
325 SET_PT (PT + whitecnt); 328 SET_PT (PT + whitecnt);
326 329
327 if (uccount && !lccount) 330 if (uccount && !lccount)
@@ -387,10 +390,11 @@ is not undone.")
387 if (!STRINGP (val)) 390 if (!STRINGP (val))
388 error ("value of abbrev-symbol must be a string"); 391 error ("value of abbrev-symbol must be a string");
389 zv_before = ZV; 392 zv_before = ZV;
390 del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size, 1); 393 del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size_byte, 1);
391 /* Don't inherit properties here; just copy from old contents. */ 394 /* Don't inherit properties here; just copy from old contents. */
392 insert_from_string (Vlast_abbrev_text, 0, 395 insert_from_string (Vlast_abbrev_text, 0, 0,
393 XSTRING (Vlast_abbrev_text)->size, 0); 396 XSTRING (Vlast_abbrev_text)->size,
397 XSTRING (Vlast_abbrev_text)->size_byte, 0);
394 Vlast_abbrev_text = Qnil; 398 Vlast_abbrev_text = Qnil;
395 /* Total number of characters deleted. */ 399 /* Total number of characters deleted. */
396 adjust = ZV - zv_before; 400 adjust = ZV - zv_before;