diff options
| author | Eli Zaretskii | 2015-09-14 10:02:04 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-09-14 10:02:04 +0300 |
| commit | 12629d2857ba2a7c8a6b6a6b61f28a179d2c92a7 (patch) | |
| tree | f860393729cf5c4d7887a6deeabbf6977e58d7ff /src/w32notify.c | |
| parent | 7a3f3183cd8faff8901ead547711e1c90ea02efe (diff) | |
| download | emacs-12629d2857ba2a7c8a6b6a6b61f28a179d2c92a7.tar.gz emacs-12629d2857ba2a7c8a6b6a6b61f28a179d2c92a7.zip | |
Implement w32notify-valid-p
* src/w32notify.c (Fw32notify_valid_p): New function. (Bug#21432)
* lisp/filenotify.el (w32notify-valid-p): No longer an alias for
'identity'.
Diffstat (limited to 'src/w32notify.c')
| -rw-r--r-- | src/w32notify.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/w32notify.c b/src/w32notify.c index ab6cd12ab93..fa4ad01636b 100644 --- a/src/w32notify.c +++ b/src/w32notify.c | |||
| @@ -628,6 +628,29 @@ w32_get_watch_object (void *desc) | |||
| 628 | return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list); | 628 | return NILP (watch_list) ? Qnil : assoc_no_quit (descriptor, watch_list); |
| 629 | } | 629 | } |
| 630 | 630 | ||
| 631 | DEFUN ("w32notify-valid-p", Fw32notify_valid_p, Sw32notify_valid_p, 1, 1, 0, | ||
| 632 | doc: /* "Check a watch specified by its WATCH-DESCRIPTOR for validity. | ||
| 633 | |||
| 634 | WATCH-DESCRIPTOR should be an object returned by `w32notify-add-watch'. | ||
| 635 | |||
| 636 | A watch can become invalid if the directory it watches is deleted, or if | ||
| 637 | the watcher thread exits abnormally for any other reason. */) | ||
| 638 | (Lisp_Object watch_descriptor) | ||
| 639 | { | ||
| 640 | Lisp_Object watch_object = Fassoc (watch_descriptor, watch_list); | ||
| 641 | |||
| 642 | if (!NILP (watch_object)) | ||
| 643 | { | ||
| 644 | struct notification *dirwatch = | ||
| 645 | (struct notification *)XINTPTR (watch_descriptor); | ||
| 646 | if (w32_valid_pointer_p (dirwatch, sizeof(struct notification)) | ||
| 647 | && dirwatch->dir != NULL) | ||
| 648 | return Qt; | ||
| 649 | } | ||
| 650 | |||
| 651 | return Qnil; | ||
| 652 | } | ||
| 653 | |||
| 631 | void | 654 | void |
| 632 | globals_of_w32notify (void) | 655 | globals_of_w32notify (void) |
| 633 | { | 656 | { |
| @@ -648,6 +671,7 @@ syms_of_w32notify (void) | |||
| 648 | 671 | ||
| 649 | defsubr (&Sw32notify_add_watch); | 672 | defsubr (&Sw32notify_add_watch); |
| 650 | defsubr (&Sw32notify_rm_watch); | 673 | defsubr (&Sw32notify_rm_watch); |
| 674 | defsubr (&Sw32notify_valid_p); | ||
| 651 | 675 | ||
| 652 | staticpro (&watch_list); | 676 | staticpro (&watch_list); |
| 653 | 677 | ||