emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH updated] Support for filesystem watching (inotify)


From: Ted Zlatanov
Subject: Re: [PATCH updated] Support for filesystem watching (inotify)
Date: Fri, 24 Jun 2011 05:19:20 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

On Fri, 24 Jun 2011 02:50:00 +0200 Rüdiger Sonderfeld <address@hidden> wrote: 

RS> +static Lisp_Object Qmodify, Qmove, Qattrib, Qdelete, Qfrom, Qto, 
Qall_modify;
...
RS> +  if (ev->mask & (IN_MODIFY|IN_CREATE) )
RS> +    events = Fcons (Fcons (Qmodify, name), events);
...
RS> +  if (EQ (symb, Qmodify))
RS> +    return IN_MODIFY | IN_CREATE;

You have several symbols like Qmodify, and I wanted to suggest that you
could use a name prefix like for example gnutls.c:

#+begin_src c
  Qgnutls_bootprop_verify_hostname_error = intern_c_string (":verify-error");
  staticpro (&Qgnutls_bootprop_verify_error);
#+end_src

and that you assign a numeric value directly to the symbol when it's
initialized instead of statically doing case statements in your code.
That way your code will be shorter and simpler because you'll work with
the integer values directly.  This could be a problem if the IN_*
constants overflow the Emacs integer size, but I don't think they will,
after checking inotify.h.  Only the special flags are large (2147483648
= IN_ONESHOT = 0x80000000) and you won't use those.

Ted




reply via email to

[Prev in Thread] Current Thread [Next in Thread]