From 6d5eb5b0d2e50b0dd153a988cc52492cb77fc333 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 4 Dec 2011 10:46:07 -0500 Subject: [PATCH] Don't macro-inline non-performance-critical code. * src/eval.c (process_quit_flag): New function. * src/lisp.h (QUIT): Use it. --- src/ChangeLog | 30 ++++++++++++++++++------------ src/coding.c | 2 +- src/coding.h | 2 +- src/eval.c | 12 ++++++++++++ src/lisp.h | 11 ++--------- 5 files changed, 34 insertions(+), 23 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a707eaae9eb..98f0d46b4c5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-12-04 Stefan Monnier + + Don't macro-inline non-performance-critical code. + * eval.c (process_quit_flag): New function. + * lisp.h (QUIT): Use it. + 2011-12-04 Jan Djärv * nsfns.m (get_geometry_from_preferences): New function. @@ -9,8 +15,8 @@ (syms_of_emacs): Initialize it. * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set Qquit_flag to `kill-emacs' instead. - (quit_throw_to_read_char): Add parameter `from_signal'. All - callers changed. Call Fkill_emacs if requested and safe. + (quit_throw_to_read_char): Add parameter `from_signal'. + All callers changed. Call Fkill_emacs if requested and safe. * lisp.h (QUIT): Call Fkill_emacs if requested. 2011-12-03 Jan Djärv @@ -110,8 +116,8 @@ 2011-11-27 Jan Djärv - * gtkutil.c (xg_create_frame_widgets): Call - gtk_window_set_has_resize_grip (FALSE) if that function is + * gtkutil.c (xg_create_frame_widgets): + Call gtk_window_set_has_resize_grip (FALSE) if that function is present with Gtk+ 2.0. 2011-11-26 Paul Eggert @@ -318,8 +324,8 @@ * xdisp.c (display_line): Move the call to highlight_trailing_whitespace before the call to compute_line_metrics, since the latter needs to see the final - faces of all the glyphs to compute ROW's hash value. Fixes - assertion violations in row_equal_p. (Bug#10035) + faces of all the glyphs to compute ROW's hash value. + Fixes assertion violations in row_equal_p. (Bug#10035) 2011-11-14 Juanma Barranquero @@ -403,8 +409,8 @@ 2011-11-08 Chong Yidong * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix. - (Fwindow_body_height, Fwindow_body_width): Move from Lisp. Signal - an error if not a live window. + (Fwindow_body_height, Fwindow_body_width): Move from Lisp. + Signal an error if not a live window. (Fwindow_total_width, Fwindow_total_height): Move from Lisp. (Fwindow_total_size, Fwindow_body_size): Move to Lisp. @@ -536,8 +542,8 @@ (x_destroy_window): Move code to x_free_frame_resources. * xfns.c (unwind_create_frame): Fix comment. - (Fx_create_frame, x_create_tip_frame): Move - terminal->reference_count++ just before making the frame + (Fx_create_frame, x_create_tip_frame): + Move terminal->reference_count++ just before making the frame official. Move initialization of image_cache_refcount and dpyinfo_refcount before calling init_frame_faces (Bug#9943). @@ -607,8 +613,8 @@ * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment. Don't stop backward scan on the continuation glyph, even though its CHARPOS is positive. - (mouse_face_from_buffer_pos, note_mouse_highlight): Rename - cover_string to disp_string. + (mouse_face_from_buffer_pos, note_mouse_highlight): + Rename cover_string to disp_string. 2011-11-01 Martin Rudalics diff --git a/src/coding.c b/src/coding.c index 79908e9b29b..f3506da7358 100644 --- a/src/coding.c +++ b/src/coding.c @@ -9208,7 +9208,7 @@ frame's terminal device. */) = TERMINAL_TERMINAL_CODING (get_terminal (terminal, 1)); Lisp_Object coding_system = CODING_ID_NAME (terminal_coding->id); - /* For backward compatibility, return nil if it is `undecided'. */ + /* For backward compatibility, return nil if it is `undecided'. */ return (! EQ (coding_system, Qundecided) ? coding_system : Qnil); } diff --git a/src/coding.h b/src/coding.h index 2621928adc3..b694e6c6b6e 100644 --- a/src/coding.h +++ b/src/coding.h @@ -457,7 +457,7 @@ struct coding_system /* Number of error source data found in a decoding routine. */ int errors; - /* Store the positions of error source data. */ + /* Store the positions of error source data. */ EMACS_INT *error_positions; /* Finish status of code conversion. */ diff --git a/src/eval.c b/src/eval.c index 9b9beabc7c1..079c7ecb6c2 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1629,6 +1629,18 @@ static Lisp_Object find_handler_clause (Lisp_Object, Lisp_Object); static int maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data); +void +process_quit_flag (void) +{ + Lisp_Object flag = Vquit_flag; + Vquit_flag = Qnil; + if (EQ (flag, Qkill_emacs)) + Fkill_emacs (Qnil); + if (EQ (Vthrow_on_input, flag)) + Fthrow (Vthrow_on_input, Qt); + Fsignal (Qquit, Qnil); +} + DEFUN ("signal", Fsignal, Ssignal, 2, 2, 0, doc: /* Signal an error. Args are ERROR-SYMBOL and associated DATA. This function does not return. diff --git a/src/lisp.h b/src/lisp.h index 969923b7cfb..f43533e0b6e 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2143,18 +2143,11 @@ extern int pending_signals; #define ELSE_PENDING_SIGNALS #endif /* not SYNC_INPUT */ +extern void handle_quit_flag (void); #define QUIT \ do { \ if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ - { \ - Lisp_Object flag = Vquit_flag; \ - Vquit_flag = Qnil; \ - if (EQ (flag, Qkill_emacs)) \ - Fkill_emacs (Qnil); \ - if (EQ (Vthrow_on_input, flag)) \ - Fthrow (Vthrow_on_input, Qt); \ - Fsignal (Qquit, Qnil); \ - } \ + process_quit_flag (); \ ELSE_PENDING_SIGNALS \ } while (0) -- 2.39.2