aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-03-31 10:53:56 +0300
committerEli Zaretskii2018-03-31 10:53:56 +0300
commit8f746914214f19fe7eaad15e03923aca8667b87f (patch)
tree113c1fef7552e45ff1f116e18d48275bf646894d /src
parent6a2b940cb17f22008e0868b1d0caee409a31c719 (diff)
parent20fa40ddd3e49b73cf2127a147d3b4ee03a3b5ba (diff)
downloademacs-8f746914214f19fe7eaad15e03923aca8667b87f.tar.gz
emacs-8f746914214f19fe7eaad15e03923aca8667b87f.zip
Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs
Diffstat (limited to 'src')
-rw-r--r--src/alloc.c9
-rw-r--r--src/editfns.c7
-rw-r--r--src/fileio.c2
-rw-r--r--src/insdel.c4
-rw-r--r--src/lisp.h4
-rw-r--r--src/marker.c13
6 files changed, 20 insertions, 19 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 369592d70ee..9fdcc7306a8 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -3878,15 +3878,6 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
3878 return obj; 3878 return obj;
3879} 3879}
3880 3880
3881/* Put MARKER back on the free list after using it temporarily. */
3882
3883void
3884free_marker (Lisp_Object marker)
3885{
3886 unchain_marker (XMARKER (marker));
3887 free_misc (marker);
3888}
3889
3890 3881
3891/* Return a newly created vector or string with specified arguments as 3882/* Return a newly created vector or string with specified arguments as
3892 elements. If all the arguments are characters that can fit 3883 elements. If all the arguments are characters that can fit
diff --git a/src/editfns.c b/src/editfns.c
index 727f2d0080c..608304c09ad 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -3899,10 +3899,9 @@ save_restriction_restore (Lisp_Object data)
3899 3899
3900 buf->clip_changed = 1; /* Remember that the narrowing changed. */ 3900 buf->clip_changed = 1; /* Remember that the narrowing changed. */
3901 } 3901 }
3902 /* This isn’t needed anymore, so don’t wait for GC. 3902 /* Detach the markers, and free the cons instead of waiting for GC. */
3903 Do not call free_marker on XCAR (data) or XCDR (data), 3903 detach_marker (XCAR (data));
3904 though, since record_marker_adjustments may have put 3904 detach_marker (XCDR (data));
3905 them on the buffer’s undo list (Bug#30931). */
3906 free_cons (XCONS (data)); 3905 free_cons (XCONS (data));
3907 } 3906 }
3908 else 3907 else
diff --git a/src/fileio.c b/src/fileio.c
index 52ca8b6297e..2f8358f01b5 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -224,6 +224,7 @@ report_file_error (char const *string, Lisp_Object name)
224 report_file_errno (string, name, errno); 224 report_file_errno (string, name, errno);
225} 225}
226 226
227#ifdef USE_FILE_NOTIFY
227/* Like report_file_error, but reports a file-notify-error instead. */ 228/* Like report_file_error, but reports a file-notify-error instead. */
228 229
229void 230void
@@ -238,6 +239,7 @@ report_file_notify_error (const char *string, Lisp_Object name)
238 239
239 xsignal (Qfile_notify_error, Fcons (build_string (string), errdata)); 240 xsignal (Qfile_notify_error, Fcons (build_string (string), errdata));
240} 241}
242#endif
241 243
242void 244void
243close_file_unwind (int fd) 245close_file_unwind (int fd)
diff --git a/src/insdel.c b/src/insdel.c
index 02e3f41bc9f..173c2438347 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -2149,9 +2149,9 @@ signal_before_change (ptrdiff_t start_int, ptrdiff_t end_int,
2149 } 2149 }
2150 2150
2151 if (! NILP (start_marker)) 2151 if (! NILP (start_marker))
2152 free_marker (start_marker); 2152 detach_marker (start_marker);
2153 if (! NILP (end_marker)) 2153 if (! NILP (end_marker))
2154 free_marker (end_marker); 2154 detach_marker (end_marker);
2155 RESTORE_VALUE; 2155 RESTORE_VALUE;
2156 2156
2157 unbind_to (count, Qnil); 2157 unbind_to (count, Qnil);
diff --git a/src/lisp.h b/src/lisp.h
index b931d23bf38..c931d9c8f05 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3812,7 +3812,6 @@ extern Lisp_Object make_save_funcptr_ptr_obj (void (*) (void), void *,
3812extern Lisp_Object make_save_memory (Lisp_Object *, ptrdiff_t); 3812extern Lisp_Object make_save_memory (Lisp_Object *, ptrdiff_t);
3813extern void free_save_value (Lisp_Object); 3813extern void free_save_value (Lisp_Object);
3814extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object); 3814extern Lisp_Object build_overlay (Lisp_Object, Lisp_Object, Lisp_Object);
3815extern void free_marker (Lisp_Object);
3816extern void free_cons (struct Lisp_Cons *); 3815extern void free_cons (struct Lisp_Cons *);
3817extern void init_alloc_once (void); 3816extern void init_alloc_once (void);
3818extern void init_alloc (void); 3817extern void init_alloc (void);
@@ -4105,7 +4104,8 @@ extern ptrdiff_t marker_byte_position (Lisp_Object);
4105extern void clear_charpos_cache (struct buffer *); 4104extern void clear_charpos_cache (struct buffer *);
4106extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t); 4105extern ptrdiff_t buf_charpos_to_bytepos (struct buffer *, ptrdiff_t);
4107extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t); 4106extern ptrdiff_t buf_bytepos_to_charpos (struct buffer *, ptrdiff_t);
4108extern void unchain_marker (struct Lisp_Marker *marker); 4107extern void detach_marker (Lisp_Object);
4108extern void unchain_marker (struct Lisp_Marker *);
4109extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object); 4109extern Lisp_Object set_marker_restricted (Lisp_Object, Lisp_Object, Lisp_Object);
4110extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, ptrdiff_t, ptrdiff_t); 4110extern Lisp_Object set_marker_both (Lisp_Object, Lisp_Object, ptrdiff_t, ptrdiff_t);
4111extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object, 4111extern Lisp_Object set_marker_restricted_both (Lisp_Object, Lisp_Object,
diff --git a/src/marker.c b/src/marker.c
index 2a45ae636ed..2d5b05cc2b8 100644
--- a/src/marker.c
+++ b/src/marker.c
@@ -560,7 +560,7 @@ POSITION is nil, makes marker point nowhere so it no longer slows down
560editing in any buffer. Returns MARKER. */) 560editing in any buffer. Returns MARKER. */)
561 (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer) 561 (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer)
562{ 562{
563 return set_marker_internal (marker, position, buffer, 0); 563 return set_marker_internal (marker, position, buffer, false);
564} 564}
565 565
566/* Like the above, but won't let the position be outside the visible part. */ 566/* Like the above, but won't let the position be outside the visible part. */
@@ -569,7 +569,7 @@ Lisp_Object
569set_marker_restricted (Lisp_Object marker, Lisp_Object position, 569set_marker_restricted (Lisp_Object marker, Lisp_Object position,
570 Lisp_Object buffer) 570 Lisp_Object buffer)
571{ 571{
572 return set_marker_internal (marker, position, buffer, 1); 572 return set_marker_internal (marker, position, buffer, true);
573} 573}
574 574
575/* Set the position of MARKER, specifying both the 575/* Set the position of MARKER, specifying both the
@@ -616,6 +616,15 @@ set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer,
616 return marker; 616 return marker;
617} 617}
618 618
619/* Detach a marker so that it no longer points anywhere and no longer
620 slows down editing. Do not free the marker, though, as a change
621 function could have inserted it into an undo list (Bug#30931). */
622void
623detach_marker (Lisp_Object marker)
624{
625 Fset_marker (marker, Qnil, Qnil);
626}
627
619/* Remove MARKER from the chain of whatever buffer it is in, 628/* Remove MARKER from the chain of whatever buffer it is in,
620 leaving it points to nowhere. This is called during garbage 629 leaving it points to nowhere. This is called during garbage
621 collection, so we must be careful to ignore and preserve 630 collection, so we must be careful to ignore and preserve