diff options
| author | Daniel Colascione | 2015-03-02 19:08:06 -0800 |
|---|---|---|
| committer | Daniel Colascione | 2015-03-02 19:08:06 -0800 |
| commit | 2cc23f170f920cbfc9df4c28bce6ca9d82c4e6cd (patch) | |
| tree | ba2ba78402bf75eed26d3f20abeac5c02eb74694 /src | |
| parent | 8af3e1848cbdc570b6c173480c2988a552f3f74d (diff) | |
| download | emacs-2cc23f170f920cbfc9df4c28bce6ca9d82c4e6cd.tar.gz emacs-2cc23f170f920cbfc9df4c28bce6ca9d82c4e6cd.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/data.c | 5 | ||||
| -rw-r--r-- | src/print.c | 5 |
3 files changed, 16 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2f04d0b040a..930a33b277a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2015-03-03 Daniel Colascione <dancol@dancol.org> | ||
| 2 | |||
| 3 | * print.c (print_object): Print whether a finalizer has | ||
| 4 | been called. | ||
| 5 | |||
| 6 | * data.c (Ftype_of): Make `type-of' work with finalizers. | ||
| 7 | (syms_of_data): Register Qfinalizer. | ||
| 8 | |||
| 1 | 2015-03-02 Daniel Colascione <dancol@dancol.org> | 9 | 2015-03-02 Daniel Colascione <dancol@dancol.org> |
| 2 | 10 | ||
| 3 | * print.c (print_object): Print finalizers. | 11 | * 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'. */) | |||
| 223 | case Lisp_Misc_Overlay: | 223 | case Lisp_Misc_Overlay: |
| 224 | return Qoverlay; | 224 | return Qoverlay; |
| 225 | case Lisp_Misc_Float: | 225 | case Lisp_Misc_Float: |
| 226 | return Qfloat; | 226 | return Qfloat; |
| 227 | case Lisp_Misc_Finalizer: | ||
| 228 | return Qfinalizer; | ||
| 227 | } | 229 | } |
| 228 | emacs_abort (); | 230 | emacs_abort (); |
| 229 | 231 | ||
| @@ -3547,6 +3549,7 @@ syms_of_data (void) | |||
| 3547 | DEFSYM (Qcons, "cons"); | 3549 | DEFSYM (Qcons, "cons"); |
| 3548 | DEFSYM (Qmarker, "marker"); | 3550 | DEFSYM (Qmarker, "marker"); |
| 3549 | DEFSYM (Qoverlay, "overlay"); | 3551 | DEFSYM (Qoverlay, "overlay"); |
| 3552 | DEFSYM (Qfinalizer, "finalizer"); | ||
| 3550 | DEFSYM (Qfloat, "float"); | 3553 | DEFSYM (Qfloat, "float"); |
| 3551 | DEFSYM (Qwindow_configuration, "window-configuration"); | 3554 | DEFSYM (Qwindow_configuration, "window-configuration"); |
| 3552 | DEFSYM (Qprocess, "process"); | 3555 | 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) | |||
| 2046 | break; | 2046 | break; |
| 2047 | 2047 | ||
| 2048 | case Lisp_Misc_Finalizer: | 2048 | case Lisp_Misc_Finalizer: |
| 2049 | strout ("#<finalizer>", -1, -1, printcharfun); | 2049 | strout ("#<finalizer", -1, -1, printcharfun); |
| 2050 | if (NILP (XFINALIZER (obj)->function)) | ||
| 2051 | strout (" used", -1, -1, printcharfun); | ||
| 2052 | strout (">", -1, -1, printcharfun); | ||
| 2050 | break; | 2053 | break; |
| 2051 | 2054 | ||
| 2052 | /* Remaining cases shouldn't happen in normal usage, but let's | 2055 | /* Remaining cases shouldn't happen in normal usage, but let's |