2834 |
struct Lisp_Marker *end = XMARKER (XCDR (data)); |
struct Lisp_Marker *end = XMARKER (XCDR (data)); |
2835 |
struct buffer *buf = beg->buffer; /* END should have the same buffer. */ |
struct buffer *buf = beg->buffer; /* END should have the same buffer. */ |
2836 |
|
|
2837 |
if (beg->charpos != BUF_BEGV(buf) || end->charpos != BUF_ZV(buf)) |
if (buf /* Verify marker still points to a buffer. */ |
2838 |
|
&& (beg->charpos != BUF_BEGV (buf) || end->charpos != BUF_ZV (buf))) |
2839 |
/* The restriction has changed from the saved one, so restore |
/* The restriction has changed from the saved one, so restore |
2840 |
the saved restriction. */ |
the saved restriction. */ |
2841 |
{ |
{ |
2848 |
/* The point is outside the new visible range, move it inside. */ |
/* The point is outside the new visible range, move it inside. */ |
2849 |
SET_BUF_PT_BOTH (buf, |
SET_BUF_PT_BOTH (buf, |
2850 |
clip_to_bounds (beg->charpos, pt, end->charpos), |
clip_to_bounds (beg->charpos, pt, end->charpos), |
2851 |
clip_to_bounds (beg->bytepos, BUF_PT_BYTE(buf), |
clip_to_bounds (beg->bytepos, BUF_PT_BYTE (buf), |
2852 |
end->bytepos)); |
end->bytepos)); |
2853 |
|
|
2854 |
buf->clip_changed = 1; /* Remember that the narrowing changed. */ |
buf->clip_changed = 1; /* Remember that the narrowing changed. */ |
2859 |
{ |
{ |
2860 |
struct buffer *buf = XBUFFER (data); |
struct buffer *buf = XBUFFER (data); |
2861 |
|
|
2862 |
if (BUF_BEGV(buf) != BUF_BEG(buf) || BUF_ZV(buf) != BUF_Z(buf)) |
if (buf /* Verify marker still points to a buffer. */ |
2863 |
|
&& (BUF_BEGV (buf) != BUF_BEG (buf) || BUF_ZV (buf) != BUF_Z (buf))) |
2864 |
/* The buffer has been narrowed, get rid of the narrowing. */ |
/* The buffer has been narrowed, get rid of the narrowing. */ |
2865 |
{ |
{ |
2866 |
SET_BUF_BEGV_BOTH (buf, BUF_BEG(buf), BUF_BEG_BYTE(buf)); |
SET_BUF_BEGV_BOTH (buf, BUF_BEG (buf), BUF_BEG_BYTE (buf)); |
2867 |
SET_BUF_ZV_BOTH (buf, BUF_Z(buf), BUF_Z_BYTE(buf)); |
SET_BUF_ZV_BOTH (buf, BUF_Z (buf), BUF_Z_BYTE (buf)); |
2868 |
|
|
2869 |
buf->clip_changed = 1; /* Remember that the narrowing changed. */ |
buf->clip_changed = 1; /* Remember that the narrowing changed. */ |
2870 |
} |
} |