Hi Eli, Thanks for reviewing the patch. On 7/17/11 11:13 PM, Eli Zaretskii wrote: > Why did you need to change filemode.c? Does it have anything to do > with Cygwin on w32? S_ISCTG and such aren't being defined under Cygwin, causing compilation errors. There's probably a better way to deal with the underlying problem. > What is this (and related) stuff about? Why do you need to use HTML > wrt the clipboard? Windows uses HTML as a data interchange format --- supporting it as a clipboard format allows formatting to be preserved in pastes into other programs. This code could easily be structured as a separate package, however, and I'll end up doing that. See http://msdn.microsoft.com/en-us/library/ms649015%28v=vs.85%29.aspx >> -/* Equivalent of strerror for W32 error codes. */ >> -char * >> -w32_strerror (int error_no) >> -{ >> - static char buf[500]; > > I don't like the idea of moving this to w32fns.c, because it doesn't > belong there. Can you come up with an alternative idea? The fundamental problem is that we now have two Windows platforms: WINDOWSNT and (CYGWIN && HAVE_NTGUI). The common code has to live somewhere; with my patch, we only build w32.o in the NTEMACS case because w32.c contains mostly compatibility wrappers; the non-compatibility portions I moved to w32fns.c, which we compile in both cases. Cygwin-NT-specific code goes in the new file cygw32.c. Another option would be to further refactor the Win32 code into distinct and explicit WINDOWSNT and HAVE_NTGUI files and introduce common headers for common functionality. This approach would involve even more code movement, however, which is why I initially avoided it. >> +#define t(...) \ >> + ({ \ >> + fprintf (stderr, "T:%s:%u: ", \ >> + __FUNCTION__, __LINE__); \ >> + fprintf (stderr, __VA_ARGS__); \ >> + fputc ('\n', stderr); \ >> + }) >> + > > What is this stuff about? Debug scaffolding --- in this case, generally useful, I think, at least as a replacement for the numerous bespoke tracing macros scattered everywhere in the code. > >> -/* Equivalent of strerror for W32 error codes. */ >> -char * >> -w32_strerror (int error_no) >> -{ >> - static char buf[500]; > > I don't like the idea of moving this to w32fns.c, because it doesn't > belong there. Can you come up with an alternative idea? > >> +#if EMACSDEBUG >> +const char* >> +w32_name_of_message (UINT msg) > > Why is this needed? Debug scaffolding. >> + >> + /* DebPrint (("w32_msg_pump: %s time:%u\n", */ >> + /* w32_name_of_message (msg.message), msg.time)); */ >> + > > Can this be removed? These DebPrint messages are a PITA when > debugging, so if it isn't absolutely necessary, let's not add new > ones. Sure. I'd actually prefer, though, to leave the existing tracing, but move it all to a common macro so that the debug spam is easier to disable and enable as needed. > > This is based on reviewing only a part of the patch, I will have more > later. The patch is very large and complicated, and the lack of a > ChangeLog that describes the changes, particularly those which move > code between different files, does not help... Of course. It's a work in progress --- a first stab, really. Once I clean up the code a bit, I'll put it into a form that's easier to consume.