diff options
| author | Alan Mackenzie | 2017-02-05 16:28:53 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2017-02-05 16:28:53 +0000 |
| commit | d5514332d4a6092673ce1f78fadcae0c57f7be64 (patch) | |
| tree | 1780337154904dcfad8ecfa76614b47c082160dd /src/gfilenotify.c | |
| parent | cecc25c68f5a1834c356e18259aa2af402a70ce1 (diff) | |
| parent | de3336051ef74e0c3069374ced5b5fc7bb9fba15 (diff) | |
| download | emacs-d5514332d4a6092673ce1f78fadcae0c57f7be64.tar.gz emacs-d5514332d4a6092673ce1f78fadcae0c57f7be64.zip | |
Merge branch 'master' into comment-cache
Diffstat (limited to 'src/gfilenotify.c')
| -rw-r--r-- | src/gfilenotify.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/gfilenotify.c b/src/gfilenotify.c index 30d0753f7e7..6ec5c642825 100644 --- a/src/gfilenotify.c +++ b/src/gfilenotify.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Filesystem notifications support with glib API. | 1 | /* Filesystem notifications support with glib API. |
| 2 | Copyright (C) 2013-2016 Free Software Foundation, Inc. | 2 | Copyright (C) 2013-2017 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -27,7 +27,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 27 | #include "keyboard.h" | 27 | #include "keyboard.h" |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | /* This is a list, elements are triples (DESCRIPTOR FILE FLAGS CALLBACK) */ | 30 | /* This is a list, elements are quadruples (DESCRIPTOR FILE FLAGS CALLBACK) */ |
| 31 | static Lisp_Object watch_list; | 31 | static Lisp_Object watch_list; |
| 32 | 32 | ||
| 33 | /* This is the callback function for arriving signals from | 33 | /* This is the callback function for arriving signals from |
| @@ -258,7 +258,7 @@ WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. */) | |||
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0, | 260 | DEFUN ("gfile-valid-p", Fgfile_valid_p, Sgfile_valid_p, 1, 1, 0, |
| 261 | doc: /* "Check a watch specified by its WATCH-DESCRIPTOR. | 261 | doc: /* Check a watch specified by its WATCH-DESCRIPTOR. |
| 262 | 262 | ||
| 263 | WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. | 263 | WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. |
| 264 | 264 | ||
| @@ -278,6 +278,25 @@ invalid. */) | |||
| 278 | } | 278 | } |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | DEFUN ("gfile-monitor-name", Fgfile_monitor_name, Sgfile_monitor_name, 1, 1, 0, | ||
| 282 | doc: /* Return the internal monitor name for WATCH-DESCRIPTOR. | ||
| 283 | |||
| 284 | The result is a symbol, either `GInotifyFileMonitor', | ||
| 285 | `GKqueueFileMonitor', `GFamFileMonitor', or `GPollFileMonitor'. | ||
| 286 | |||
| 287 | WATCH-DESCRIPTOR should be an object returned by `gfile-add-watch'. | ||
| 288 | If WATCH-DESCRIPTOR is not valid, nil is returned. */) | ||
| 289 | (Lisp_Object watch_descriptor) | ||
| 290 | { | ||
| 291 | if (NILP (Fgfile_valid_p (watch_descriptor))) | ||
| 292 | return Qnil; | ||
| 293 | else | ||
| 294 | { | ||
| 295 | GFileMonitor *monitor = XINTPTR (watch_descriptor); | ||
| 296 | return intern (G_OBJECT_TYPE_NAME (monitor)); | ||
| 297 | } | ||
| 298 | } | ||
| 299 | |||
| 281 | 300 | ||
| 282 | void | 301 | void |
| 283 | globals_of_gfilenotify (void) | 302 | globals_of_gfilenotify (void) |
| @@ -294,6 +313,7 @@ syms_of_gfilenotify (void) | |||
| 294 | defsubr (&Sgfile_add_watch); | 313 | defsubr (&Sgfile_add_watch); |
| 295 | defsubr (&Sgfile_rm_watch); | 314 | defsubr (&Sgfile_rm_watch); |
| 296 | defsubr (&Sgfile_valid_p); | 315 | defsubr (&Sgfile_valid_p); |
| 316 | defsubr (&Sgfile_monitor_name); | ||
| 297 | 317 | ||
| 298 | /* Filter objects. */ | 318 | /* Filter objects. */ |
| 299 | DEFSYM (Qchange, "change"); | 319 | DEFSYM (Qchange, "change"); |