diff options
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/src/editfns.c b/src/editfns.c index cc6b4cff895..50bde90788d 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -838,9 +838,8 @@ This function does not move point. */) | |||
| 838 | Lisp_Object | 838 | Lisp_Object |
| 839 | save_excursion_save (void) | 839 | save_excursion_save (void) |
| 840 | { | 840 | { |
| 841 | return make_save_value | 841 | return make_save_obj_obj_obj_obj |
| 842 | (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, | 842 | (Fpoint_marker (), |
| 843 | Fpoint_marker (), | ||
| 844 | /* Do not copy the mark if it points to nowhere. */ | 843 | /* Do not copy the mark if it points to nowhere. */ |
| 845 | (XMARKER (BVAR (current_buffer, mark))->buffer | 844 | (XMARKER (BVAR (current_buffer, mark))->buffer |
| 846 | ? Fcopy_marker (BVAR (current_buffer, mark), Qnil) | 845 | ? Fcopy_marker (BVAR (current_buffer, mark), Qnil) |
| @@ -853,7 +852,7 @@ save_excursion_save (void) | |||
| 853 | 852 | ||
| 854 | /* Restore saved buffer before leaving `save-excursion' special form. */ | 853 | /* Restore saved buffer before leaving `save-excursion' special form. */ |
| 855 | 854 | ||
| 856 | Lisp_Object | 855 | void |
| 857 | save_excursion_restore (Lisp_Object info) | 856 | save_excursion_restore (Lisp_Object info) |
| 858 | { | 857 | { |
| 859 | Lisp_Object tem, tem1, omark, nmark; | 858 | Lisp_Object tem, tem1, omark, nmark; |
| @@ -927,7 +926,6 @@ save_excursion_restore (Lisp_Object info) | |||
| 927 | out: | 926 | out: |
| 928 | 927 | ||
| 929 | free_misc (info); | 928 | free_misc (info); |
| 930 | return Qnil; | ||
| 931 | } | 929 | } |
| 932 | 930 | ||
| 933 | DEFUN ("save-excursion", Fsave_excursion, Ssave_excursion, 0, UNEVALLED, 0, | 931 | DEFUN ("save-excursion", Fsave_excursion, Ssave_excursion, 0, UNEVALLED, 0, |
| @@ -2809,18 +2807,16 @@ determines whether case is significant or ignored. */) | |||
| 2809 | return make_number (0); | 2807 | return make_number (0); |
| 2810 | } | 2808 | } |
| 2811 | 2809 | ||
| 2812 | static Lisp_Object | 2810 | static void |
| 2813 | subst_char_in_region_unwind (Lisp_Object arg) | 2811 | subst_char_in_region_unwind (Lisp_Object arg) |
| 2814 | { | 2812 | { |
| 2815 | bset_undo_list (current_buffer, arg); | 2813 | bset_undo_list (current_buffer, arg); |
| 2816 | return arg; | ||
| 2817 | } | 2814 | } |
| 2818 | 2815 | ||
| 2819 | static Lisp_Object | 2816 | static void |
| 2820 | subst_char_in_region_unwind_1 (Lisp_Object arg) | 2817 | subst_char_in_region_unwind_1 (Lisp_Object arg) |
| 2821 | { | 2818 | { |
| 2822 | bset_filename (current_buffer, arg); | 2819 | bset_filename (current_buffer, arg); |
| 2823 | return arg; | ||
| 2824 | } | 2820 | } |
| 2825 | 2821 | ||
| 2826 | DEFUN ("subst-char-in-region", Fsubst_char_in_region, | 2822 | DEFUN ("subst-char-in-region", Fsubst_char_in_region, |
| @@ -3331,7 +3327,7 @@ save_restriction_save (void) | |||
| 3331 | } | 3327 | } |
| 3332 | } | 3328 | } |
| 3333 | 3329 | ||
| 3334 | Lisp_Object | 3330 | void |
| 3335 | save_restriction_restore (Lisp_Object data) | 3331 | save_restriction_restore (Lisp_Object data) |
| 3336 | { | 3332 | { |
| 3337 | struct buffer *cur = NULL; | 3333 | struct buffer *cur = NULL; |
| @@ -3398,8 +3394,6 @@ save_restriction_restore (Lisp_Object data) | |||
| 3398 | 3394 | ||
| 3399 | if (cur) | 3395 | if (cur) |
| 3400 | set_buffer_internal (cur); | 3396 | set_buffer_internal (cur); |
| 3401 | |||
| 3402 | return Qnil; | ||
| 3403 | } | 3397 | } |
| 3404 | 3398 | ||
| 3405 | DEFUN ("save-restriction", Fsave_restriction, Ssave_restriction, 0, UNEVALLED, 0, | 3399 | DEFUN ("save-restriction", Fsave_restriction, Ssave_restriction, 0, UNEVALLED, 0, |
| @@ -3492,7 +3486,7 @@ usage: (message-box FORMAT-STRING &rest ARGS) */) | |||
| 3492 | { | 3486 | { |
| 3493 | Lisp_Object pane, menu; | 3487 | Lisp_Object pane, menu; |
| 3494 | struct gcpro gcpro1; | 3488 | struct gcpro gcpro1; |
| 3495 | pane = Fcons (Fcons (build_string ("OK"), Qt), Qnil); | 3489 | pane = list1 (Fcons (build_string ("OK"), Qt)); |
| 3496 | GCPRO1 (pane); | 3490 | GCPRO1 (pane); |
| 3497 | menu = Fcons (val, pane); | 3491 | menu = Fcons (val, pane); |
| 3498 | Fx_popup_dialog (Qt, menu, Qt); | 3492 | Fx_popup_dialog (Qt, menu, Qt); |
| @@ -3627,7 +3621,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3627 | ptrdiff_t bufsize = sizeof initial_buffer; | 3621 | ptrdiff_t bufsize = sizeof initial_buffer; |
| 3628 | ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; | 3622 | ptrdiff_t max_bufsize = STRING_BYTES_BOUND + 1; |
| 3629 | char *p; | 3623 | char *p; |
| 3630 | Lisp_Object buf_save_value IF_LINT (= {0}); | 3624 | ptrdiff_t buf_save_value_index IF_LINT (= 0); |
| 3631 | char *format, *end, *format_start; | 3625 | char *format, *end, *format_start; |
| 3632 | ptrdiff_t formatlen, nchars; | 3626 | ptrdiff_t formatlen, nchars; |
| 3633 | /* True if the format is multibyte. */ | 3627 | /* True if the format is multibyte. */ |
| @@ -4236,14 +4230,14 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 4236 | { | 4230 | { |
| 4237 | buf = xmalloc (bufsize); | 4231 | buf = xmalloc (bufsize); |
| 4238 | sa_must_free = 1; | 4232 | sa_must_free = 1; |
| 4239 | buf_save_value = make_save_pointer (buf); | 4233 | buf_save_value_index = SPECPDL_INDEX (); |
| 4240 | record_unwind_protect (safe_alloca_unwind, buf_save_value); | 4234 | record_unwind_protect_ptr (xfree, buf); |
| 4241 | memcpy (buf, initial_buffer, used); | 4235 | memcpy (buf, initial_buffer, used); |
| 4242 | } | 4236 | } |
| 4243 | else | 4237 | else |
| 4244 | { | 4238 | { |
| 4245 | buf = xrealloc (buf, bufsize); | 4239 | buf = xrealloc (buf, bufsize); |
| 4246 | set_save_pointer (buf_save_value, 0, buf); | 4240 | set_unwind_protect_ptr (buf_save_value_index, xfree, buf); |
| 4247 | } | 4241 | } |
| 4248 | 4242 | ||
| 4249 | p = buf + used; | 4243 | p = buf + used; |