aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenichi Handa2004-01-23 00:14:48 +0000
committerKenichi Handa2004-01-23 00:14:48 +0000
commitfe905025d02b1bea377447bd1282f7fcd32f918e (patch)
tree3133edc80d4c4fa65b0d685a2a3b2376e5c593a1
parentfe722d76d3fd8f68b5dd3baf578ec6356a00c147 (diff)
downloademacs-fe905025d02b1bea377447bd1282f7fcd32f918e.tar.gz
emacs-fe905025d02b1bea377447bd1282f7fcd32f918e.zip
(Fmd5): If OBJECT is a buffer different from the current
one, set buffer to OBJECT temporarily.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fns.c17
2 files changed, 19 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3f6f23e1395..a15f25fbde8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-01-23 Kenichi Handa <handa@m17n.org>
2
3 * fns.c (Fmd5): If OBJECT is a buffer different from the current
4 one, set buffer to OBJECT temporarily.
5
12004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> 62004-01-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * keyboard.c (kbd_buffer_gcpro): Remove. 8 * keyboard.c (kbd_buffer_gcpro): Remove.
diff --git a/src/fns.c b/src/fns.c
index ff40c706edd..6383e09302b 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5454,12 +5454,18 @@ guesswork fails. Normally, an error is signaled in such case. */)
5454 } 5454 }
5455 else 5455 else
5456 { 5456 {
5457 struct buffer *prev = current_buffer;
5458
5459 record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
5460
5457 CHECK_BUFFER (object); 5461 CHECK_BUFFER (object);
5458 5462
5459 bp = XBUFFER (object); 5463 bp = XBUFFER (object);
5464 if (bp != current_buffer)
5465 set_buffer_internal (bp);
5460 5466
5461 if (NILP (start)) 5467 if (NILP (start))
5462 b = BUF_BEGV (bp); 5468 b = BEGV;
5463 else 5469 else
5464 { 5470 {
5465 CHECK_NUMBER_COERCE_MARKER (start); 5471 CHECK_NUMBER_COERCE_MARKER (start);
@@ -5467,7 +5473,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
5467 } 5473 }
5468 5474
5469 if (NILP (end)) 5475 if (NILP (end))
5470 e = BUF_ZV (bp); 5476 e = ZV;
5471 else 5477 else
5472 { 5478 {
5473 CHECK_NUMBER_COERCE_MARKER (end); 5479 CHECK_NUMBER_COERCE_MARKER (end);
@@ -5477,7 +5483,7 @@ guesswork fails. Normally, an error is signaled in such case. */)
5477 if (b > e) 5483 if (b > e)
5478 temp = b, b = e, e = temp; 5484 temp = b, b = e, e = temp;
5479 5485
5480 if (!(BUF_BEGV (bp) <= b && e <= BUF_ZV (bp))) 5486 if (!(BEGV <= b && e <= ZV))
5481 args_out_of_range (start, end); 5487 args_out_of_range (start, end);
5482 5488
5483 if (NILP (coding_system)) 5489 if (NILP (coding_system))
@@ -5544,6 +5550,11 @@ guesswork fails. Normally, an error is signaled in such case. */)
5544 } 5550 }
5545 5551
5546 object = make_buffer_string (b, e, 0); 5552 object = make_buffer_string (b, e, 0);
5553 if (prev != current_buffer)
5554 set_buffer_internal (prev);
5555 /* Discard the unwind protect for recovering the current
5556 buffer. */
5557 specpdl_ptr--;
5547 5558
5548 if (STRING_MULTIBYTE (object)) 5559 if (STRING_MULTIBYTE (object))
5549 object = code_convert_string1 (object, coding_system, Qnil, 1); 5560 object = code_convert_string1 (object, coding_system, Qnil, 1);