diff options
| author | Richard M. Stallman | 1997-08-07 08:59:08 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-07 08:59:08 +0000 |
| commit | 2cad2e34fa62554599848cef2a5fda8efa0350b0 (patch) | |
| tree | f5f0fbb62f30d867f083c0a87f9181e2dd212273 /src | |
| parent | a9171faac4d84a536cc03b0232a297160a57dc88 (diff) | |
| download | emacs-2cad2e34fa62554599848cef2a5fda8efa0350b0.tar.gz emacs-2cad2e34fa62554599848cef2a5fda8efa0350b0.zip | |
(Fwiden, Fnarrow_to_region, save_restriction_restore):
Don't set clip_changed if the new values are the same as the old.
Diffstat (limited to 'src')
| -rw-r--r-- | src/editfns.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/editfns.c b/src/editfns.c index e49f53ff6b3..c8a6506e493 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1895,9 +1895,10 @@ DEFUN ("widen", Fwiden, Swiden, 0, 0, "", | |||
| 1895 | This allows the buffer's full text to be seen and edited.") | 1895 | This allows the buffer's full text to be seen and edited.") |
| 1896 | () | 1896 | () |
| 1897 | { | 1897 | { |
| 1898 | if (BEG != BEGV || Z != ZV) | ||
| 1899 | current_buffer->clip_changed = 1; | ||
| 1898 | BEGV = BEG; | 1900 | BEGV = BEG; |
| 1899 | SET_BUF_ZV (current_buffer, Z); | 1901 | SET_BUF_ZV (current_buffer, Z); |
| 1900 | current_buffer->clip_changed = 1; | ||
| 1901 | /* Changing the buffer bounds invalidates any recorded current column. */ | 1902 | /* Changing the buffer bounds invalidates any recorded current column. */ |
| 1902 | invalidate_current_column (); | 1903 | invalidate_current_column (); |
| 1903 | return Qnil; | 1904 | return Qnil; |
| @@ -1927,13 +1928,15 @@ or markers) bounding the text that should remain visible.") | |||
| 1927 | if (!(BEG <= XINT (start) && XINT (start) <= XINT (end) && XINT (end) <= Z)) | 1928 | if (!(BEG <= XINT (start) && XINT (start) <= XINT (end) && XINT (end) <= Z)) |
| 1928 | args_out_of_range (start, end); | 1929 | args_out_of_range (start, end); |
| 1929 | 1930 | ||
| 1931 | if (BEGV != XFASTINT (start) || ZV != XFASTINT (end)) | ||
| 1932 | current_buffer->clip_changed = 1; | ||
| 1933 | |||
| 1930 | BEGV = XFASTINT (start); | 1934 | BEGV = XFASTINT (start); |
| 1931 | SET_BUF_ZV (current_buffer, XFASTINT (end)); | 1935 | SET_BUF_ZV (current_buffer, XFASTINT (end)); |
| 1932 | if (PT < XFASTINT (start)) | 1936 | if (PT < XFASTINT (start)) |
| 1933 | SET_PT (XFASTINT (start)); | 1937 | SET_PT (XFASTINT (start)); |
| 1934 | if (PT > XFASTINT (end)) | 1938 | if (PT > XFASTINT (end)) |
| 1935 | SET_PT (XFASTINT (end)); | 1939 | SET_PT (XFASTINT (end)); |
| 1936 | current_buffer->clip_changed = 1; | ||
| 1937 | /* Changing the buffer bounds invalidates any recorded current column. */ | 1940 | /* Changing the buffer bounds invalidates any recorded current column. */ |
| 1938 | invalidate_current_column (); | 1941 | invalidate_current_column (); |
| 1939 | return Qnil; | 1942 | return Qnil; |
| @@ -1959,6 +1962,7 @@ save_restriction_restore (data) | |||
| 1959 | register struct buffer *buf; | 1962 | register struct buffer *buf; |
| 1960 | register int newhead, newtail; | 1963 | register int newhead, newtail; |
| 1961 | register Lisp_Object tem; | 1964 | register Lisp_Object tem; |
| 1965 | int obegv, ozv; | ||
| 1962 | 1966 | ||
| 1963 | buf = XBUFFER (XCONS (data)->car); | 1967 | buf = XBUFFER (XCONS (data)->car); |
| 1964 | 1968 | ||
| @@ -1973,9 +1977,15 @@ save_restriction_restore (data) | |||
| 1973 | newhead = 0; | 1977 | newhead = 0; |
| 1974 | newtail = 0; | 1978 | newtail = 0; |
| 1975 | } | 1979 | } |
| 1980 | |||
| 1981 | obegv = BUF_BEGV (buf); | ||
| 1982 | ozv = BUF_ZV (buf); | ||
| 1983 | |||
| 1976 | BUF_BEGV (buf) = BUF_BEG (buf) + newhead; | 1984 | BUF_BEGV (buf) = BUF_BEG (buf) + newhead; |
| 1977 | SET_BUF_ZV (buf, BUF_Z (buf) - newtail); | 1985 | SET_BUF_ZV (buf, BUF_Z (buf) - newtail); |
| 1978 | current_buffer->clip_changed = 1; | 1986 | |
| 1987 | if (obegv != BUF_BEGV (buf) || ozv != BUF_ZV (buf)) | ||
| 1988 | current_buffer->clip_changed = 1; | ||
| 1979 | 1989 | ||
| 1980 | /* If point is outside the new visible range, move it inside. */ | 1990 | /* If point is outside the new visible range, move it inside. */ |
| 1981 | SET_BUF_PT (buf, | 1991 | SET_BUF_PT (buf, |