summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2016-12-12 18:03:40 +0200
committerEli Zaretskii <eliz@gnu.org>2016-12-12 18:03:40 +0200
commita416e1d6c111527205f3583c8d201bf95af6fa20 (patch)
tree60e58859632f072952f84dee959eb0a88f3c097a /src/buffer.h
parent00d4ba2794243763b818c013669e36c1d2c7de62 (diff)
downloademacs-a416e1d6c111527205f3583c8d201bf95af6fa20.tar.gz
Fix point motion in cloned buffers
* src/thread.c (post_acquire_global_lock): Call set_buffer_internal_2 instead of tricking set_buffer_internal_1 into resetting the current buffer even if it didn't change. This avoids bug#25165, caused by failing to record the modified values of point and mark, because current_buffer was set to NULL. Also, don't bother re-setting the buffer if there was no thread switch, as that just wastes cycles. * src/buffer.c (set_buffer_internal_2): New function, with most of the body of set_buffer_internal_1, but without the test for B being identical to the current buffer. (set_buffer_internal_1): Call set_buffer_internal_2 if B is not identical to the current buffer. * src/buffer.h (set_buffer_internal_2): Add prototype. * test/src/thread-tests.el (thread-sticky-point): New test.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index 21ad5e3bc0f..854b5b5dd32 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -1082,6 +1082,7 @@ extern void recenter_overlay_lists (struct buffer *, ptrdiff_t);
extern ptrdiff_t overlay_strings (ptrdiff_t, struct window *, unsigned char **);
extern void validate_region (Lisp_Object *, Lisp_Object *);
extern void set_buffer_internal_1 (struct buffer *);
+extern void set_buffer_internal_2 (struct buffer *);
extern void set_buffer_temp (struct buffer *);
extern Lisp_Object buffer_local_value (Lisp_Object, Lisp_Object);
extern void record_buffer (Lisp_Object);