From 2cc23f170f920cbfc9df4c28bce6ca9d82c4e6cd Mon Sep 17 00:00:00 2001 From: Daniel Colascione Date: Mon, 2 Mar 2015 19:08:06 -0800 Subject: Finalizer documentation, minor improvements * doc/lispref/objects.texi (Finalizer Type): New section (Type Predicates): Mention finalizers in `type-of' documentation. * doc/lispref/elisp.texi (Top): Link to finalizer type. * src/data.c (Ftype_of): Make `type-of' work with finalizers. (syms_of_data): Register Qfinalizer. * src/print.c (print_object): Print whether a finalizer has been called. * test/automated/finalizer-tests.el (finalizer-object-type): Test that `type-of' works correctly for finalizers. --- src/ChangeLog | 8 ++++++++ src/data.c | 5 ++++- src/print.c | 5 ++++- 3 files changed, 16 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ChangeLog b/src/ChangeLog index 2f04d0b040a..930a33b277a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2015-03-03 Daniel Colascione + + * print.c (print_object): Print whether a finalizer has + been called. + + * data.c (Ftype_of): Make `type-of' work with finalizers. + (syms_of_data): Register Qfinalizer. + 2015-03-02 Daniel Colascione * print.c (print_object): Print finalizers. diff --git a/src/data.c b/src/data.c index 47706584f5e..c96841aebbf 100644 --- a/src/data.c +++ b/src/data.c @@ -223,7 +223,9 @@ for example, (type-of 1) returns `integer'. */) case Lisp_Misc_Overlay: return Qoverlay; case Lisp_Misc_Float: - return Qfloat; + return Qfloat; + case Lisp_Misc_Finalizer: + return Qfinalizer; } emacs_abort (); @@ -3547,6 +3549,7 @@ syms_of_data (void) DEFSYM (Qcons, "cons"); DEFSYM (Qmarker, "marker"); DEFSYM (Qoverlay, "overlay"); + DEFSYM (Qfinalizer, "finalizer"); DEFSYM (Qfloat, "float"); DEFSYM (Qwindow_configuration, "window-configuration"); DEFSYM (Qprocess, "process"); diff --git a/src/print.c b/src/print.c index d391fd5f7a3..838d03666d4 100644 --- a/src/print.c +++ b/src/print.c @@ -2046,7 +2046,10 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) break; case Lisp_Misc_Finalizer: - strout ("#", -1, -1, printcharfun); + strout ("#function)) + strout (" used", -1, -1, printcharfun); + strout (">", -1, -1, printcharfun); break; /* Remaining cases shouldn't happen in normal usage, but let's -- cgit v1.2.1