diff options
| author | Paul Eggert | 2018-06-07 18:53:27 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-07 19:11:49 -0700 |
| commit | a0aa1d4ecc123d652285ef10ea62ed55c6c118d6 (patch) | |
| tree | c56177683a5a552e17eb8ce7ed27256507361b60 /src/lread.c | |
| parent | a0641286f6e58f4dca4221caa6dd559bfacea699 (diff) | |
| download | emacs-a0aa1d4ecc123d652285ef10ea62ed55c6c118d6.tar.gz emacs-a0aa1d4ecc123d652285ef10ea62ed55c6c118d6.zip | |
New function record_unwind_protect_excursion
This simplifies callers a bit, and will simplify future changes.
* src/eval.c (record_unwind_protect_excursion): New function.
* src/buffer.c (Fkill_buffer):
* src/bytecode.c (exec_byte_code):
* src/editfns.c (Fsave_excursion, Freplace_buffer_contents):
* src/lread.c (readevalloop, Feval_buffer):
* src/window.c (scroll_command):
Use it.
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lread.c b/src/lread.c index 239c66ccb85..d2c7eae20f9 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1976,11 +1976,11 @@ readevalloop (Lisp_Object readcharfun, | |||
| 1976 | if (!NILP (start)) | 1976 | if (!NILP (start)) |
| 1977 | { | 1977 | { |
| 1978 | /* Switch to the buffer we are reading from. */ | 1978 | /* Switch to the buffer we are reading from. */ |
| 1979 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 1979 | record_unwind_protect_excursion (); |
| 1980 | set_buffer_internal (b); | 1980 | set_buffer_internal (b); |
| 1981 | 1981 | ||
| 1982 | /* Save point in it. */ | 1982 | /* Save point in it. */ |
| 1983 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 1983 | record_unwind_protect_excursion (); |
| 1984 | /* Save ZV in it. */ | 1984 | /* Save ZV in it. */ |
| 1985 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); | 1985 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); |
| 1986 | /* Those get unbound after we read one expression. */ | 1986 | /* Those get unbound after we read one expression. */ |
| @@ -2137,7 +2137,7 @@ This function preserves the position of point. */) | |||
| 2137 | 2137 | ||
| 2138 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); | 2138 | specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list)); |
| 2139 | specbind (Qstandard_output, tem); | 2139 | specbind (Qstandard_output, tem); |
| 2140 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 2140 | record_unwind_protect_excursion (); |
| 2141 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); | 2141 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); |
| 2142 | specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil); | 2142 | specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil); |
| 2143 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); | 2143 | BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf))); |