Improve performance of &key parsing
[bpt/emacs.git] / src / terminal.c
index c55fd4e..d0a38b9 100644 (file)
@@ -1,5 +1,5 @@
 /* Functions related to terminal devices.
-   Copyright (C) 2005-2013 Free Software Foundation, Inc.
+   Copyright (C) 2005-2014 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -18,8 +18,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
-#define TERMHOOKS_INLINE EXTERN_INLINE
-
 #include <stdio.h>
 
 #include "lisp.h"
@@ -39,6 +37,8 @@ static int next_terminal_id;
 /* The initial terminal device, created by initial_term_init. */
 struct terminal *initial_terminal;
 
+static Lisp_Object Qterminal_live_p;
+
 static void delete_initial_terminal (struct terminal *);
 
 /* This setter is used only in this file, so it can be private.  */
@@ -500,7 +500,15 @@ selected frame's terminal).  */)
   return store_terminal_param (t, parameter, value);
 }
 
-\f
+/* Initial frame has no device-dependent output data, but has
+   face cache which should be freed when the frame is deleted.  */
+
+static void
+initial_free_frame_resources (struct frame *f)
+{
+  eassert (FRAME_INITIAL_P (f));
+  free_frame_faces (f);
+}
 
 /* Create the bootstrap display terminal for the initial frame.
    Returns a terminal of type output_initial.  */
@@ -516,6 +524,7 @@ init_initial_terminal (void)
   initial_terminal->name = xstrdup ("initial_terminal");
   initial_terminal->kboard = initial_kboard;
   initial_terminal->delete_terminal_hook = &delete_initial_terminal;
+  initial_terminal->delete_frame_hook = &initial_free_frame_resources;
   /* All other hooks are NULL. */
 
   return initial_terminal;
@@ -549,6 +558,8 @@ Each function is called with argument, the terminal.
 This may be called just before actually deleting the terminal,
 or some time later.  */);
   Vdelete_terminal_functions = Qnil;
+
+  DEFSYM (Qterminal_live_p, "terminal-live-p");
   DEFSYM (Qdelete_terminal_functions, "delete-terminal-functions");
   DEFSYM (Qrun_hook_with_args, "run-hook-with-args");