1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-07 04:10:27 -08:00

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.
This commit is contained in:
Daniel Colascione 2015-03-02 19:08:06 -08:00
parent 8af3e1848c
commit 2cc23f170f
8 changed files with 63 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2015-03-03 Daniel Colascione <dancol@dancol.org>
* 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 <dancol@dancol.org>
* print.c (print_object): Print finalizers.

View file

@ -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");

View file

@ -2046,7 +2046,10 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag)
break;
case Lisp_Misc_Finalizer:
strout ("#<finalizer>", -1, -1, printcharfun);
strout ("#<finalizer", -1, -1, printcharfun);
if (NILP (XFINALIZER (obj)->function))
strout (" used", -1, -1, printcharfun);
strout (">", -1, -1, printcharfun);
break;
/* Remaining cases shouldn't happen in normal usage, but let's