diff options
| author | Stefan Monnier | 2009-11-03 21:34:59 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-11-03 21:34:59 +0000 |
| commit | d528b1ce663f6e03ee671f8519647e0a4953b850 (patch) | |
| tree | abea5bbc6ecf550efd1ddfa1bfdf402fe7029fef /src | |
| parent | 524420d28903e8b8c35c9e942ad79f38a2e20dde (diff) | |
| download | emacs-d528b1ce663f6e03ee671f8519647e0a4953b850.tar.gz emacs-d528b1ce663f6e03ee671f8519647e0a4953b850.zip | |
(save_restriction_restore): Update the (pt/begv/vz)_markers
when applicable (bug#4851).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 29 | ||||
| -rw-r--r-- | src/editfns.c | 21 |
2 files changed, 34 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 52d3a7c93a1..393bb85c067 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-11-03 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-11-03 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * editfns.c (save_restriction_restore): Update the (pt/begv/vz)_markers | ||
| 4 | when applicable (bug#4851). | ||
| 5 | |||
| 3 | * lisp.h: Make USE_LSB_TAG work with USE_LISP_UNION_TYPE. | 6 | * lisp.h: Make USE_LSB_TAG work with USE_LISP_UNION_TYPE. |
| 4 | (P_): Support for prototypes is now required. | 7 | (P_): Support for prototypes is now required. |
| 5 | 8 | ||
| @@ -10,14 +13,14 @@ | |||
| 10 | 13 | ||
| 11 | 2009-10-30 Eli Zaretskii <eliz@gnu.org> | 14 | 2009-10-30 Eli Zaretskii <eliz@gnu.org> |
| 12 | 15 | ||
| 13 | * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Redefine to waste less pure | 16 | * s/msdos.h (SYSTEM_PURESIZE_EXTRA): Redefine to waste less pure space. |
| 14 | space. | ||
| 15 | 17 | ||
| 16 | 2009-10-30 Dan Nicolaescu <dann@ics.uci.edu> | 18 | 2009-10-30 Dan Nicolaescu <dann@ics.uci.edu> |
| 17 | 19 | ||
| 18 | * puresize.h (BASE_PURESIZE): Increase to 1470000. | 20 | * puresize.h (BASE_PURESIZE): Increase to 1470000. |
| 19 | 21 | ||
| 20 | * lread.c (Fload): Purecopy the file name when building Vpreloaded_file_list. | 22 | * lread.c (Fload): Purecopy the file name when building |
| 23 | Vpreloaded_file_list. | ||
| 21 | 24 | ||
| 22 | 2009-10-29 Jason Rumney <jasonr@wanchan.jasonrumney.net> | 25 | 2009-10-29 Jason Rumney <jasonr@wanchan.jasonrumney.net> |
| 23 | 26 | ||
| @@ -55,7 +58,7 @@ | |||
| 55 | 58 | ||
| 56 | * dired.c (Ffile_attributes): Simplify now that FIXNUM_OVERFLOW_P | 59 | * dired.c (Ffile_attributes): Simplify now that FIXNUM_OVERFLOW_P |
| 57 | can properly handle unsigned types. | 60 | can properly handle unsigned types. |
| 58 | (make_uid, make_gid): Removed. | 61 | (make_uid, make_gid): Remove. |
| 59 | 62 | ||
| 60 | * lisp.h (FIXNUM_OVERFLOW_P): Fix last change to handle unsigned | 63 | * lisp.h (FIXNUM_OVERFLOW_P): Fix last change to handle unsigned |
| 61 | types again. | 64 | types again. |
| @@ -108,10 +111,11 @@ | |||
| 108 | (handle_one_xevent): Set pending_event_wait.eventtype to 0 if we | 111 | (handle_one_xevent): Set pending_event_wait.eventtype to 0 if we |
| 109 | see pending_event_wait.eventtype. | 112 | see pending_event_wait.eventtype. |
| 110 | (handle_one_xevent): Don't change gravity when parent changes. | 113 | (handle_one_xevent): Don't change gravity when parent changes. |
| 111 | (x_new_font): Call change_frame_size with new rows/columns before we try | 114 | (x_new_font): Call change_frame_size with new rows/columns before we |
| 112 | to resize the frame. | 115 | try to resize the frame. |
| 113 | (x_wait_for_event): New function. | 116 | (x_wait_for_event): New function. |
| 114 | (x_set_window_size_1): Don't change gravity unless change_gravity is set. | 117 | (x_set_window_size_1): Don't change gravity unless change_gravity |
| 118 | is set. | ||
| 115 | Call XResizeWindow with FRAME_OUTER_WINDOW. If we are visible, | 119 | Call XResizeWindow with FRAME_OUTER_WINDOW. If we are visible, |
| 116 | don't change frame size, instead wait for the ConfigureNotify. | 120 | don't change frame size, instead wait for the ConfigureNotify. |
| 117 | (x_set_window_size): Call x_set_window_size_1 for USE_X_TOOLKIT also. | 121 | (x_set_window_size): Call x_set_window_size_1 for USE_X_TOOLKIT also. |
| @@ -126,7 +130,7 @@ | |||
| 126 | 130 | ||
| 127 | * gtkutil.c (xg_frame_set_char_size): Flush events and call | 131 | * gtkutil.c (xg_frame_set_char_size): Flush events and call |
| 128 | x_wait_for_event. | 132 | x_wait_for_event. |
| 129 | (flush_and_sync): Removed again. | 133 | (flush_and_sync): Remove again. |
| 130 | (xg_get_font_name): Suggest monospace if no previous font is known. | 134 | (xg_get_font_name): Suggest monospace if no previous font is known. |
| 131 | 135 | ||
| 132 | 2009-10-20 Stefan Monnier <monnier@iro.umontreal.ca> | 136 | 2009-10-20 Stefan Monnier <monnier@iro.umontreal.ca> |
| @@ -329,8 +333,7 @@ | |||
| 329 | (ns_findfonts, nsfont_list_family): Use long format in printf, and | 333 | (ns_findfonts, nsfont_list_family): Use long format in printf, and |
| 330 | cast argument. | 334 | cast argument. |
| 331 | (nsfont_open): Use ns_char_width() everywhere. | 335 | (nsfont_open): Use ns_char_width() everywhere. |
| 332 | (ns_uni_to_glyphs, NSGlyphStorage): Use NS[U]Integer where | 336 | (ns_uni_to_glyphs, NSGlyphStorage): Use NS[U]Integer where appropriate. |
| 333 | appropriate. | ||
| 334 | 337 | ||
| 335 | * nsgui.h (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat. | 338 | * nsgui.h (NSPoint, NSSize) [!__OBJC__]: Define and use CGFloat. |
| 336 | 339 | ||
| @@ -399,7 +402,7 @@ | |||
| 399 | 402 | ||
| 400 | 2009-10-02 Michael Albinus <michael.albinus@gmx.de> | 403 | 2009-10-02 Michael Albinus <michael.albinus@gmx.de> |
| 401 | 404 | ||
| 402 | * lisp.h (Qdelete_directory_internal): Removed, because it is not | 405 | * lisp.h (Qdelete_directory_internal): Remove, because it is not |
| 403 | used anymore outside fileio.c. | 406 | used anymore outside fileio.c. |
| 404 | 407 | ||
| 405 | * w32fns.c (Fsystem_move_file_to_trash): Use delete-directory. | 408 | * w32fns.c (Fsystem_move_file_to_trash): Use delete-directory. |
| @@ -474,8 +477,8 @@ | |||
| 474 | 2009-09-24 Juanma Barranquero <lekktu@gmail.com> | 477 | 2009-09-24 Juanma Barranquero <lekktu@gmail.com> |
| 475 | 478 | ||
| 476 | * frame.c (xrdb_get_resource): Return nil for empty string resources; | 479 | * frame.c (xrdb_get_resource): Return nil for empty string resources; |
| 477 | some parts of Emacs code (like font selection) don't grok them. See | 480 | some parts of Emacs code (like font selection) don't grok them. |
| 478 | http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00528.html | 481 | See http://lists.gnu.org/archive/html/emacs-devel/2009-09/msg00528.html |
| 479 | 482 | ||
| 480 | 2009-09-24 Andreas Schwab <schwab@redhat.com> | 483 | 2009-09-24 Andreas Schwab <schwab@redhat.com> |
| 481 | 484 | ||
diff --git a/src/editfns.c b/src/editfns.c index 8dfea1f595c..806e75dc0f1 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -3275,12 +3275,26 @@ Lisp_Object | |||
| 3275 | save_restriction_restore (data) | 3275 | save_restriction_restore (data) |
| 3276 | Lisp_Object data; | 3276 | Lisp_Object data; |
| 3277 | { | 3277 | { |
| 3278 | struct buffer *cur = NULL; | ||
| 3279 | struct buffer *buf = (CONSP (data) | ||
| 3280 | ? XMARKER (XCAR (data))->buffer | ||
| 3281 | : XBUFFER (data)); | ||
| 3282 | |||
| 3283 | if (buf && buf != current_buffer && !NILP (buf->pt_marker)) | ||
| 3284 | { /* If `buf' uses markers to keep track of PT, BEGV, and ZV (as | ||
| 3285 | is the case if it is or has an indirect buffer), then make | ||
| 3286 | sure it is current before we update BEGV, so | ||
| 3287 | set_buffer_internal takes care of managing those markers. */ | ||
| 3288 | cur = current_buffer; | ||
| 3289 | set_buffer_internal (buf); | ||
| 3290 | } | ||
| 3291 | |||
| 3278 | if (CONSP (data)) | 3292 | if (CONSP (data)) |
| 3279 | /* A pair of marks bounding a saved restriction. */ | 3293 | /* A pair of marks bounding a saved restriction. */ |
| 3280 | { | 3294 | { |
| 3281 | struct Lisp_Marker *beg = XMARKER (XCAR (data)); | 3295 | struct Lisp_Marker *beg = XMARKER (XCAR (data)); |
| 3282 | struct Lisp_Marker *end = XMARKER (XCDR (data)); | 3296 | struct Lisp_Marker *end = XMARKER (XCDR (data)); |
| 3283 | struct buffer *buf = beg->buffer; /* END should have the same buffer. */ | 3297 | eassert (buf == end->buffer); |
| 3284 | 3298 | ||
| 3285 | if (buf /* Verify marker still points to a buffer. */ | 3299 | if (buf /* Verify marker still points to a buffer. */ |
| 3286 | && (beg->charpos != BUF_BEGV (buf) || end->charpos != BUF_ZV (buf))) | 3300 | && (beg->charpos != BUF_BEGV (buf) || end->charpos != BUF_ZV (buf))) |
| @@ -3305,8 +3319,6 @@ save_restriction_restore (data) | |||
| 3305 | else | 3319 | else |
| 3306 | /* A buffer, which means that there was no old restriction. */ | 3320 | /* A buffer, which means that there was no old restriction. */ |
| 3307 | { | 3321 | { |
| 3308 | struct buffer *buf = XBUFFER (data); | ||
| 3309 | |||
| 3310 | if (buf /* Verify marker still points to a buffer. */ | 3322 | if (buf /* Verify marker still points to a buffer. */ |
| 3311 | && (BUF_BEGV (buf) != BUF_BEG (buf) || BUF_ZV (buf) != BUF_Z (buf))) | 3323 | && (BUF_BEGV (buf) != BUF_BEG (buf) || BUF_ZV (buf) != BUF_Z (buf))) |
| 3312 | /* The buffer has been narrowed, get rid of the narrowing. */ | 3324 | /* The buffer has been narrowed, get rid of the narrowing. */ |
| @@ -3318,6 +3330,9 @@ save_restriction_restore (data) | |||
| 3318 | } | 3330 | } |
| 3319 | } | 3331 | } |
| 3320 | 3332 | ||
| 3333 | if (cur) | ||
| 3334 | set_buffer_internal (cur); | ||
| 3335 | |||
| 3321 | return Qnil; | 3336 | return Qnil; |
| 3322 | } | 3337 | } |
| 3323 | 3338 | ||