From b1a64dba04146b1424eacd3bc363e5f0edeac2b2 Mon Sep 17 00:00:00 2001 From: Dmitry Antipov Date: Wed, 6 Jul 2016 06:03:12 +0300 Subject: [PATCH] Reduce consing caused by vertical motion commands * src/frame.c (Fframe_parameter): Avoid call to Fframe_parameters for the parameters frequently requested by calls to 'next-line' and 'previous-line'. --- src/frame.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/frame.c b/src/frame.c index 540b69f9c3d..22143ab26bf 100644 --- a/src/frame.c +++ b/src/frame.c @@ -2607,6 +2607,22 @@ If FRAME is nil, describe the currently selected frame. */) /* Avoid consing in frequent cases. */ if (EQ (parameter, Qname)) value = f->name; +#ifdef HAVE_WINDOW_SYSTEM + /* These are used by vertical motion commands. */ + else if (EQ (parameter, Qvertical_scroll_bars)) + value = (f->vertical_scroll_bar_type == vertical_scroll_bar_none + ? Qnil + : (f->vertical_scroll_bar_type == vertical_scroll_bar_left + ? Qleft : Qright)); + else if (EQ (parameter, Qhorizontal_scroll_bars)) + value = f->horizontal_scroll_bars ? Qt : Qnil; + else if (EQ (parameter, Qline_spacing) && f->extra_line_spacing == 0) + /* If this is non-zero, we can't determine whether the user specified + an integer or float value without looking through 'param_alist'. */ + value = make_number (0); + else if (EQ (parameter, Qfont) && FRAME_X_P (f)) + value = FRAME_FONT (f)->props[FONT_NAME_INDEX]; +#endif /* HAVE_WINDOW_SYSTEM */ #ifdef HAVE_X_WINDOWS else if (EQ (parameter, Qdisplay) && FRAME_X_P (f)) value = XCAR (FRAME_DISPLAY_INFO (f)->name_list_element); -- 2.39.5