all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: 조성빈 <pcr910303@icloud.com>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: [PATCH] Add xwidget webkit support for macOS Cocoa
Date: Sun, 26 May 2019 11:57:08 +0900	[thread overview]
Message-ID: <679B30F5-4AB8-4F70-AEA1-A428538E928B@icloud.com> (raw)
In-Reply-To: <e204162b-b7e4-b380-aaf7-c36ade9b2a69@cs.ucla.edu>



2019. 5. 26. 오전 2:47, Paul Eggert <eggert@cs.ucla.edu> 작성:

> 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'. -->

Definitely a mistake, will fix as soon as I get home :-)

> 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,
>      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Will add prototypes where appropriate...

>> +    WEBKIT_CFLAGS="-D_REENTRANT -I/System/Library/Frameworks/WebKit.framework/Headers"
> 
> Why is that -D_REENTRANT needed? I thought _REENTRANT was obsolete on macOS.

This was because this patch vas developed back from 2017 (by another person who signed the FSF agreements and also expressed his intents to contribute but didn’t...), and I was just maintaining it.
Didn’t bother to fix that... will fix that too.

>> -  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.

Agreed.

>> -      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.

I vaguely remember that it once emitted an error when compiling... will try again.

>> +#include <stdio.h> /* FIXME: Emacs error? message? instead of printf.  */
> 
> Yes, we don't want printfs there.

Can you give some candidates to use? 
I’m actually not that proficient in programming elisp functions in C... :-(

>> +#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".

Will fix.

>> +#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.

That one was because the macro WEBKIT_CHECK_VERSION is only defined in GTK webkit... Last time I looked, I remember being puzzled because C preprocessor didn’t do proper short circuiting?̊̈ I’ll try that again.

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




  reply	other threads:[~2019-05-26  2:57 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
2019-05-26  2:57   ` 조성빈 [this message]
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=679B30F5-4AB8-4F70-AEA1-A428538E928B@icloud.com \
    --to=pcr910303@icloud.com \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /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.