Mercurial > hg > xemacs-beta
changeset 5798:b94d6e89ea5b
Correct a couple of small things with my last change.
src/ChangeLog addition:
2014-06-18 Aidan Kehoe <kehoea@parhasard.net>
Correct a couple of things in my last change.
* extents.h:
Make #'delete-extent available.
* window.c:
* window.c (delete_saved_point): New.
* window.c (Fdelete_window): Delete the saved point extents on
deletion of the window, since otherwise they will only be
garbage-collected when the buffer is.
* window.c (Fset_window_buffer): Correct a thinko here, use a
saved point when it *hasn't* been detached.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Wed, 18 Jun 2014 09:26:54 +0100 |
parents | a1808d52a34a |
children | df691b681244 |
files | src/ChangeLog src/extents.h src/window.c |
diffstat | 3 files changed, 28 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Tue Jun 17 20:55:45 2014 +0100 +++ b/src/ChangeLog Wed Jun 18 09:26:54 2014 +0100 @@ -1,3 +1,16 @@ +2014-06-18 Aidan Kehoe <kehoea@parhasard.net> + + Correct a couple of things in my last change. + * extents.h: + Make #'delete-extent available. + * window.c: + * window.c (delete_saved_point): New. + * window.c (Fdelete_window): Delete the saved point extents on + deletion of the window, since otherwise they will only be + garbage-collected when the buffer is. + * window.c (Fset_window_buffer): Correct a thinko here, use a + saved point when it *hasn't* been detached. + 2014-06-17 Aidan Kehoe <kehoea@parhasard.net> * extents.h:
--- a/src/extents.h Tue Jun 17 20:55:45 2014 +0100 +++ b/src/extents.h Wed Jun 18 09:26:54 2014 +0100 @@ -133,6 +133,7 @@ EXFUN (Fput_text_property, 5); EXFUN (Fextent_detached_p, 1); +EXFUN (Fdelete_extent, 1); EXFUN (Fdetach_extent, 1); EXFUN (Fextent_end_position, 1); EXFUN (Fextent_object, 1);
--- a/src/window.c Tue Jun 17 20:55:45 2014 +0100 +++ b/src/window.c Wed Jun 18 09:26:54 2014 +0100 @@ -2206,6 +2206,14 @@ return 0; } +static int +delete_saved_point (Lisp_Object UNUSED (buffer), Lisp_Object saved_point, + void *UNUSED (closure)) +{ + Fdelete_extent (saved_point); + return 0; +} + DEFUN ("delete-window", Fdelete_window, 0, 2, "", /* Remove WINDOW from the display. Default is selected window. If window is the only one on its frame, the frame is deleted as well. @@ -2319,6 +2327,11 @@ w->buffer = Qnil; } + /* Delete the saved point extents, since they will still be referenced + from the buffer and thus won't be garbage-collected until the buffer + is. */ + elisp_maphash_unsafe (delete_saved_point, w->saved_point_cache, NULL); + /* close up the hole in the sibling list */ if (!NILP (w->next)) XWINDOW (w->next)->prev = w->prev; @@ -3725,7 +3738,7 @@ { Lisp_Object saved_point = Fgethash (buffer, w->saved_point_cache, Qnil); Lisp_Object newpoint = - (EXTENTP (saved_point) && !NILP (Fextent_detached_p (saved_point))) + (EXTENTP (saved_point) && NILP (Fextent_detached_p (saved_point))) ? Fextent_start_position (saved_point) : make_fixnum (BUF_PT (XBUFFER (buffer))); Lisp_Object marker;