all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Sungbin Jo <pcr910303@icloud.com>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Add xwidget webkit support for macOS Cocoa
Date: Sat, 25 May 2019 10:47:20 -0700	[thread overview]
Message-ID: <e204162b-b7e4-b380-aaf7-c36ade9b2a69@cs.ucla.edu> (raw)
In-Reply-To: <20190525132727.94982-1-pcr910303@icloud.com>

Thanks for doing all that work! Although I have no expertise in macOS I have a 
few minor comments about the patch from the perspective of someone who builds 
and ports Emacs, and who wants to help navigate this patch through the Emacs 
build bureaucracy. First, when I tried to use "git am" to apply the patch, I got 
these diagnostics about white-space problems that should be looked at:

Applying: Add xwidget webkit support for macOS Cocoa
.git/rebase-apply/patch:594: space before tab in indent.
              for detail information about `NSApplicationDefinedMask'. -->
warning: 1 line adds whitespace errors.
nextstep/templates/Info.plist.in:682: space before tab in indent.
+            for detail information about `NSApplicationDefinedMask'. -->

Next, when I tried to build by doing "./configure --enable-gcc-warnings 
--with-xwidgets" on Fedora 30, I got the following diagnostics that should get 
fixed:


xwidget.c:258:1: warning: no previous prototype for ‘store_xwidget_event_string’ 
[-Wmissing-prototypes]
   258 | store_xwidget_event_string (struct xwidget *xw, const char *eventname,
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~
xwidget.c:272:1: warning: no previous prototype for 
‘store_xwidget_response_callback_event’ [-Wmissing-prototypes]
   272 | store_xwidget_response_callback_event (struct xwidget *xw,
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
xwidget.c:292:1: warning: no previous prototype for 
‘store_xwidget_js_callback_event’ [-Wmissing-prototypes]
   292 | store_xwidget_js_callback_event (struct xwidget *xw,
       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


> +    WEBKIT_CFLAGS="-D_REENTRANT -I/System/Library/Frameworks/WebKit.framework/Headers"

Why is that -D_REENTRANT needed? I thought _REENTRANT was obsolete on macOS.


> -  Does Emacs support Xwidgets (requires gtk3)?            ${HAVE_XWIDGETS}
> +  Does Emacs support Xwidgets?                            ${HAVE_XWIDGETS}
> +    (requires gtk3 or macOS Cocoa)

Probably better to omit that second line; that part of the output is getting too 
long anyway.


> -      syms_of_xwidget ();
>         syms_of_xsettings ();
>   #ifdef HAVE_X_SM
>         syms_of_xsmfns ();
> @@ -1855,6 +1854,10 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
>   #endif /* HAVE_W32NOTIFY */
>   #endif /* WINDOWSNT */
>   
> +#ifdef HAVE_XWIDGETS
> +      syms_of_xwidget ();
> +#endif /* HAVE_XWIDGETS */
> +

Why move the call to syms_of_xwidget? And why surround it with "#ifdef", since 
syms_of_xwidget is a no-op if HAVE_XWIDGETS is not defined? It's better to avoid 
#if when that's convenient.


> +#include <stdio.h> /* FIXME: Emacs error? message? instead of printf.  */

Yes, we don't want printfs there.


> +#if defined (USE_GTK)
>   #include <webkit2/webkit2.h>
>   #include <JavaScriptCore/JavaScript.h>
> +#elif defined (NS_IMPL_COCOA)
> +#include "nsxwidget.h"
> +#endif

Indent preprocessor directives consistently. No parens needed in "defined X". 
"#ifdef X" is easier to read than "#if defined X".


> +#if defined (USE_GTK)
>   #if WEBKIT_CHECK_VERSION (2, 21, 1) && GNUC_PREREQ (4, 2, 0)
>   # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
>   #endif
> +#endif

Use just one "#if" rather than nested ones.

I didn't look in detail at the .m or .el changes, but this is good enough for now.



  reply	other threads:[~2019-05-25 17:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-25 13:27 [PATCH] Add xwidget webkit support for macOS Cocoa Sungbin Jo
2019-05-25 17:47 ` Paul Eggert [this message]
2019-05-26  2:57   ` 조성빈
2019-05-26  6:02     ` Paul Eggert
2019-05-28 15:07       ` [PATCH v2] " 조성빈
2019-06-02  6:14         ` 조성빈
2019-06-02 14:39           ` Eli Zaretskii
2019-06-03 16:11         ` Alan Third
2019-06-03 17:25           ` Stefan Monnier
2019-06-03 23:36             ` Paul Eggert
2019-06-03 23:51               ` Sungbin Jo
2019-06-04  2:40                 ` Stefan Monnier
2019-06-04  8:33                   ` Andreas Schwab
2019-06-05  3:06                   ` Sungbin Jo
2019-06-05  3:18                   ` [PATCH v3] " Sungbin Jo
2019-06-05 13:55                     ` Stefan Monnier
2019-06-05 14:34                     ` Eli Zaretskii
2019-06-23 22:38                     ` Alan Third
2019-06-04 16:22                 ` [PATCH v2] " Alan Third

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e204162b-b7e4-b380-aaf7-c36ade9b2a69@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=pcr910303@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.