emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master b1a64db 1/2: Reduce consing caused by vertical moti


From: Dmitry Antipov
Subject: [Emacs-diffs] master b1a64db 1/2: Reduce consing caused by vertical motion commands
Date: Wed, 6 Jul 2016 03:12:57 +0000 (UTC)

branch: master
commit b1a64dba04146b1424eacd3bc363e5f0edeac2b2
Author: Dmitry Antipov <address@hidden>
Commit: Dmitry Antipov <address@hidden>

    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 540b69f..22143ab 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);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]