summaryrefslogtreecommitdiff
path: root/src/gfilenotify.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-01-22 00:18:40 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-01-22 00:25:35 -0800
commit0a49f158f1598fb92989f3cbdc238a7e5f1bd8a3 (patch)
tree34ff3896930886b9a072423fdb310d482bec283a /src/gfilenotify.c
parentade0652cc2a7103cd910accda8165ff8ee7c719f (diff)
downloademacs-0a49f158f1598fb92989f3cbdc238a7e5f1bd8a3.tar.gz
Improve uses of CHECK_LIST etc.
* src/eval.c (FletX): Report an error for invalid constructs like ‘(let* (a . 0))’, so that ‘let*’ is more consistent with ‘let’. (lambda_arity): Use plain CHECK_CONS. * src/fns.c (CHECK_LIST_END): Move from here to lisp.h. (Fcopy_alist): Remove unnecessary CHECK_LIST call, since concat does that for us. (Fnthcdr, Fmember, Fmemql, Fdelete, Fnreverse): Use CHECK_LIST_END, not CHECK_LIST_CONS. This hoists a runtime check out of the loop. (Fmemq): Simplify and use CHECK_LIST_END instead of CHECK_LIST. (Fassq, Fassoc, Frassq, Frassoc): Simplify and use CHECK_LIST_END instead of CAR. (assq_no_quit, assoc_no_quit): Simplify and assume proper list. (Fnconc): Use plain CHECK_CONS, and do-while instead of while loop. * src/fontset.c (Fnew_fontset): * src/frame.c (Fmodify_frame_parameters): Use CHECK_LIST_END at end, rather than CHECK_LIST at start, for a more-complete check. * src/gfilenotify.c (Fgfile_add_watch): Omit unnecessary CHECK_LIST, since Fmember does that for us. * src/lisp.h (lisp_h_CHECK_LIST_CONS, CHECK_LIST_CONS): Remove; no longer used. (CHECK_LIST_END): New inline function.
Diffstat (limited to 'src/gfilenotify.c')
-rw-r--r--src/gfilenotify.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gfilenotify.c b/src/gfilenotify.c
index 6ec5c642825..285a253733d 100644
--- a/src/gfilenotify.c
+++ b/src/gfilenotify.c
@@ -178,20 +178,18 @@ will be reported only in case of the `moved' event. */)
if (NILP (Ffile_exists_p (file)))
report_file_error ("File does not exist", file);
- CHECK_LIST (flags);
-
if (!FUNCTIONP (callback))
wrong_type_argument (Qinvalid_function, callback);
- /* Create GFile name. */
- gfile = g_file_new_for_path (SSDATA (ENCODE_FILE (file)));
-
/* Assemble flags. */
if (!NILP (Fmember (Qwatch_mounts, flags)))
gflags |= G_FILE_MONITOR_WATCH_MOUNTS;
if (!NILP (Fmember (Qsend_moved, flags)))
gflags |= G_FILE_MONITOR_SEND_MOVED;
+ /* Create GFile name. */
+ gfile = g_file_new_for_path (SSDATA (ENCODE_FILE (file)));
+
/* Enable watch. */
monitor = g_file_monitor (gfile, gflags, NULL, &gerror);
g_object_unref (gfile);