emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/terminal.c,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/terminal.c,v
Date: Sat, 29 Mar 2008 01:46:12 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/03/29 01:46:11

Index: src/terminal.c
===================================================================
RCS file: /sources/emacs/emacs/src/terminal.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- src/terminal.c      11 Feb 2008 03:51:39 -0000      1.9
+++ src/terminal.c      29 Mar 2008 01:46:07 -0000      1.10
@@ -295,6 +295,10 @@
 #endif
 }
 
+Lisp_Object Qrun_hook_with_args;
+static Lisp_Object Qdelete_terminal_functions;
+static Lisp_Object Vdelete_terminal_functions;
+
 DEFUN ("delete-terminal", Fdelete_terminal, Sdelete_terminal, 0, 2, 0,
        doc: /* Delete TERMINAL by deleting all frames on it and closing the 
terminal.
 TERMINAL may be a terminal id, a frame, or nil (meaning the selected
@@ -320,6 +324,16 @@
        error ("Attempt to delete the sole active display terminal");
     }
 
+  if (NILP (Vrun_hooks))
+    ;
+  else if (EQ (force, Qnoelisp))
+    pending_funcalls
+      = Fcons (list3 (Qrun_hook_with_args,
+                     Qdelete_terminal_functions, terminal),
+              pending_funcalls);
+  else
+    safe_call2 (Qrun_hook_with_args, Qdelete_terminal_functions, terminal);
+
   if (t->delete_terminal_hook)
     (*t->delete_terminal_hook) (t);
   else
@@ -552,6 +566,17 @@
 The function should accept no arguments.  */);
   Vring_bell_function = Qnil;
 
+  DEFVAR_LISP ("delete-terminal-functions", &Vdelete_terminal_functions,
+    doc: /* Special hook run when a terminal is deleted.
+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;
+  Qdelete_terminal_functions = intern ("delete-terminal-functions");
+  staticpro (&Qdelete_terminal_functions);
+  Qrun_hook_with_args = intern ("run-hook-with-args");
+  staticpro (&Qrun_hook_with_args);
+
   defsubr (&Sdelete_terminal);
   defsubr (&Sframe_terminal);
   defsubr (&Sterminal_live_p);




reply via email to

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