diff options
Diffstat (limited to 'src/gfilenotify.c')
-rw-r--r-- | src/gfilenotify.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gfilenotify.c b/src/gfilenotify.c index e7039d938fe..9f828375a78 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c @@ -258,7 +258,7 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */) } DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0, - doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. + doc: /* Check a watch specified by its WATCH-DESCRIPTOR. WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. @@ -278,6 +278,25 @@ invalid. */) } } +DEFUN ("gfile-monitor-name", Fgfile_monitor_name, Sgfile_monitor_name, 1, 1, 0, + doc: /* Return the internal monitor name for WATCH-DESCRIPTOR. + +The result is a symbol, either `GInotifyFileMonitor', +`GKqueueFileMonitor', `GFamFileMonitor', or `GPollFileMonitor'. + +WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. +If WATCH-DESCRIPTOR is not valid, nil is returned. */) + (Lisp_Object watch_descriptor) +{ + if (NILP (Fgfile_valid_p (watch_descriptor))) + return Qnil; + else + { + GFileMonitor *monitor = XINTPTR (watch_descriptor); + return intern (G_OBJECT_TYPE_NAME (monitor)); + } +} + void globals_of_gfilenotify (void) @@ -294,6 +313,7 @@ syms_of_gfilenotify (void) defsubr (&Sgfile_add_watch); defsubr (&Sgfile_rm_watch); defsubr (&Sgfile_valid_p); + defsubr (&Sgfile_monitor_name); /* Filter objects. */ DEFSYM (Qchange, "change"); |