# HG changeset patch # User Stefan Monnier # Date 1257284099 0 # Node ID 8f7be56920c02b53de2938ca98b04950a825d467 # Parent 0d3a156a54583549fdcc670dab5ac03000761a63 (save_restriction_restore): Update the (pt/begv/vz)_markers when applicable (bug#4851). diff -r 0d3a156a5458 -r 8f7be56920c0 src/ChangeLog --- a/src/ChangeLog Tue Nov 03 21:12:15 2009 +0000 +++ b/src/ChangeLog Tue Nov 03 21:34:59 2009 +0000 @@ -1,5 +1,8 @@ 2009-11-03 Stefan Monnier + * editfns.c (save_restriction_restore): Update the (pt/begv/vz)_markers + when applicable (bug#4851). + * lisp.h: Make USE_LSB_TAG work with USE_LISP_UNION_TYPE. (P_): Support for prototypes is now required. @@ -10,14 +13,14 @@ 2009-10-30 Eli Zaretskii - * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Redefine to waste less pure - space. + * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Redefine to waste less pure space. 2009-10-30 Dan Nicolaescu * puresize.h (BASE_PURESIZE): Increase to 1470000. - * lread.c (Fload): Purecopy the file name when building Vpreloaded_file_list. + * lread.c (Fload): Purecopy the file name when building + Vpreloaded_file_list. 2009-10-29 Jason Rumney @@ -55,7 +58,7 @@ * dired.c (Ffile_attributes): Simplify now that FIXNUM_OVERFLOW_P can properly handle unsigned types. - (make_uid, make_gid): Removed. + (make_uid, make_gid): Remove. * lisp.h (FIXNUM_OVERFLOW_P): Fix last change to handle unsigned types again. @@ -108,10 +111,11 @@ (handle_one_xevent): Set pending_event_wait.eventtype to 0 if we see pending_event_wait.eventtype. (handle_one_xevent): Don't change gravity when parent changes. - (x_new_font): Call change_frame_size with new rows/columns before we try - to resize the frame. + (x_new_font): Call change_frame_size with new rows/columns before we + try to resize the frame. (x_wait_for_event): New function. - (x_set_window_size_1): Don't change gravity unless change_gravity is set. + (x_set_window_size_1): Don't change gravity unless change_gravity + is set. Call XResizeWindow with FRAME_OUTER_WINDOW. If we are visible, don't change frame size, instead wait for the ConfigureNotify. (x_set_window_size): Call x_set_window_size_1 for USE_X_TOOLKIT also. @@ -126,7 +130,7 @@ * gtkutil.c (xg_frame_set_char_size): Flush events and call x_wait_for_event. - (flush_and_sync): Removed again. + (flush_and_sync): Remove again. (xg_get_font_name): Suggest monospace if no previous font is known. 2009-10-20 Stefan Monnier @@ -329,8 +333,7 @@ (ns_findfonts, nsfont_list_family): Use long format in printf, and cast argument. (nsfont_open): Use ns_char_width() everywhere. - (ns_uni_to_glyphs, NSGlyphStorage): Use NS[U]Integer where - appropriate. + (ns_uni_to_glyphs, NSGlyphStorage): Use NS[U]Integer where appropriate. * nsgui.h (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat. @@ -399,7 +402,7 @@ 2009-10-02 Michael Albinus - * lisp.h (Qdelete_directory_internal): Removed, because it is not + * lisp.h (Qdelete_directory_internal): Remove, because it is not used anymore outside fileio.c. * w32fns.c (Fsystem_move_file_to_trash): Use delete-directory. @@ -474,8 +477,8 @@ 2009-09-24 Juanma Barranquero * frame.c (xrdb_get_resource): Return nil for empty string resources; - some parts of Emacs code (like font selection) don't grok them. See - http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00528.html + some parts of Emacs code (like font selection) don't grok them. + See http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00528.html 2009-09-24 Andreas Schwab diff -r 0d3a156a5458 -r 8f7be56920c0 src/editfns.c --- a/src/editfns.c Tue Nov 03 21:12:15 2009 +0000 +++ b/src/editfns.c Tue Nov 03 21:34:59 2009 +0000 @@ -3275,12 +3275,26 @@ save_restriction_restore (data) Lisp_Object data; { + struct buffer *cur = NULL; + struct buffer *buf = (CONSP (data) + ? XMARKER (XCAR (data))->buffer + : XBUFFER (data)); + + if (buf && buf != current_buffer && !NILP (buf->pt_marker)) + { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as + is the case if it is or has an indirect buffer), then make + sure it is current before we update BEGV, so + set_buffer_internal takes care of managing those markers. */ + cur = current_buffer; + set_buffer_internal (buf); + } + if (CONSP (data)) /* A pair of marks bounding a saved restriction. */ { struct Lisp_Marker *beg = XMARKER (XCAR (data)); struct Lisp_Marker *end = XMARKER (XCDR (data)); - struct buffer *buf = beg->buffer; /* END should have the same buffer. */ + eassert (buf == end->buffer); if (buf /* Verify marker still points to a buffer. */ && (beg->charpos != BUF_BEGV (buf) || end->charpos != BUF_ZV (buf))) @@ -3305,8 +3319,6 @@ else /* A buffer, which means that there was no old restriction. */ { - struct buffer *buf = XBUFFER (data); - if (buf /* Verify marker still points to a buffer. */ && (BUF_BEGV (buf) != BUF_BEG (buf) || BUF_ZV (buf) != BUF_Z (buf))) /* The buffer has been narrowed, get rid of the narrowing. */ @@ -3318,6 +3330,9 @@ } } + if (cur) + set_buffer_internal (cur); + return Qnil; }