diff options
Diffstat (limited to 'src/xdisp.c')
| -rw-r--r-- | src/xdisp.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 2a979c5cb9e..aa1d4433914 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3072,10 +3072,24 @@ dsafe__call (bool inhibit_quit, Lisp_Object (f) (ptrdiff_t, Lisp_Object *), | |||
| 3072 | return val; | 3072 | return val; |
| 3073 | } | 3073 | } |
| 3074 | 3074 | ||
| 3075 | static Lisp_Object | ||
| 3076 | funcall_with_backtraces (ptrdiff_t nargs, Lisp_Object *args) | ||
| 3077 | { | ||
| 3078 | /* If an error is signaled during a Lisp hook in redisplay, write a | ||
| 3079 | backtrace into the buffer *Redisplay-trace*. */ | ||
| 3080 | push_handler_bind (list_of_error, Qdebug_early__muted, 0); | ||
| 3081 | Lisp_Object res = Ffuncall (nargs, args); | ||
| 3082 | pop_handler (); | ||
| 3083 | return res; | ||
| 3084 | } | ||
| 3085 | |||
| 3075 | #define SAFE_CALLMANY(inhibit_quit, f, array) \ | 3086 | #define SAFE_CALLMANY(inhibit_quit, f, array) \ |
| 3076 | dsafe__call ((inhibit_quit), f, ARRAYELTS (array), array) | 3087 | dsafe__call ((inhibit_quit), f, ARRAYELTS (array), array) |
| 3077 | #define dsafe_calln(inhibit_quit, ...) \ | 3088 | #define dsafe_calln(inhibit_quit, ...) \ |
| 3078 | SAFE_CALLMANY ((inhibit_quit), Ffuncall, ((Lisp_Object []) {__VA_ARGS__})) | 3089 | SAFE_CALLMANY ((inhibit_quit), \ |
| 3090 | backtrace_on_redisplay_error \ | ||
| 3091 | ? funcall_with_backtraces : Ffuncall, \ | ||
| 3092 | ((Lisp_Object []) {__VA_ARGS__})) | ||
| 3079 | 3093 | ||
| 3080 | static Lisp_Object | 3094 | static Lisp_Object |
| 3081 | dsafe_call1 (Lisp_Object f, Lisp_Object arg) | 3095 | dsafe_call1 (Lisp_Object f, Lisp_Object arg) |
| @@ -37748,6 +37762,8 @@ cursor shapes. */); | |||
| 37748 | DEFSYM (Qthin_space, "thin-space"); | 37762 | DEFSYM (Qthin_space, "thin-space"); |
| 37749 | DEFSYM (Qzero_width, "zero-width"); | 37763 | DEFSYM (Qzero_width, "zero-width"); |
| 37750 | 37764 | ||
| 37765 | DEFSYM (Qdebug_early__muted, "debug-early--muted"); | ||
| 37766 | |||
| 37751 | DEFVAR_LISP ("pre-redisplay-function", Vpre_redisplay_function, | 37767 | DEFVAR_LISP ("pre-redisplay-function", Vpre_redisplay_function, |
| 37752 | doc: /* Function run just before redisplay. | 37768 | doc: /* Function run just before redisplay. |
| 37753 | It is called with one argument, which is the set of windows that are to | 37769 | It is called with one argument, which is the set of windows that are to |