[PATCH] add emacs built with xwidgets-support

DoneSubmitted by Arne Babenhauserheide.
Details
3 participants
  • Arne Babenhauserheide
  • Ludovic Courtès
  • Ricardo Wurmus
Owner
unassigned
Severity
normal
A
A
Arne Babenhauserheide wrote on 18 Jan 2019 23:29
(address . guix-patches@gnu.org)
87zhrx4mlu.fsf@web.de
* gnu/packages/emacs.scm (emacs-xwidgets): new variable
---
gnu/packages/emacs.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index a488289f1..8c3ea1728 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -59,6 +59,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages webkit)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix utils)
@@ -210,6 +211,21 @@ languages.")
     (native-inputs
      `(("pkg-config" ,pkg-config)))))
 
+(define-public emacs-xwidgets
+  (package (inherit emacs)
+           (name "emacs-xwidgets")
+           (synopsis "The extensible, customizable, self-documenting text
+editor (with xwidgets support)")
+           (build-system gnu-build-system)
+           (arguments (append
+                       (package-arguments emacs)
+                       `(#:configure-flags
+                         '("--with-xwidgets"))))
+           (inputs (append
+                    (package-inputs emacs)
+                    `(("webkitgtk" ,webkitgtk)
+                      ("libxcomposite" ,libxcomposite))))))
+
 (define-public emacs-no-x
   (package (inherit emacs)
     (name "emacs-no-x")
-- 
2.19.2
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE801qEjXQSQPNItXAE++NRSQDw+sFAlxCVY0ACgkQE++NRSQD
w+vcjw/+Muxr+C1ByPj4DRTrH95Mf7qh2lezf3kSFZ1yOgwatmDQOWZ4dkscHIvM
4N/UmExFQOReJmvUnK0UbwsurUDouaBgZvmSqM4MOzxRwDHMNqepek7q/O4bMHEr
oMBoizIzK0/UPXYg5U23jRBvh3FuKpXz2nV4IOxp4ZyZkX+rEPcSifdC1RHqqjj5
6NipsegVfMtlpMhcfuOFdt0cDPEog+ELKVol6rbZjw0GREoAujcZCpDqdYH7X+Mn
Hs5PhC5DRGmVQXl5VJCn92gjFFhQMimKsdrYTngb8NG11RnTQDP4YKdqa+6vvBj0
2SIIZu6QJNgzCSStYe7Uz/DihLrjXnnsyL2gHyFTAq2AWZ0JCStciSrO8T3mkhhe
lhskifvtAcIpzxsO4qX49xTyI2GIwM1BsjtO5e4q+my7oHxXefn3BPu3fjkNl4hC
TTfdjwubi1Wk/UBesHgSye/QttvM9C1kAIra3UrAE/P+qOTPZOBbC5PuM+qxyuAO
iEIGYRePJb59ezBG3qwQIlVRn3nt7DETGwOsE5C6m9WaIIz/WnmZzy7WnlrNvy9F
LpLQM9dOFDLYDfugVnn8miwMWe+GdOhwxLZS8N0u11UyPZW4C2wJ0LH9wiQL9Qwh
KoShESyYrSeMYjLih5lfLiNy6lvepfN+xfnGczMfjxolvCE8fk2IswQBAQgAHRYh
BN0ovebZh1yrzkqLHdzPDbMLwQVIBQJcQlWNAAoJENzPDbMLwQVIhqcD/2N9p4JW
OsOcUiWnu2KgyQbJEoFZlggGVv0W/phfM6oe5OOfVRqYO8Sv/pMl+rYLHqiVdVmY
qW0xYEJqAniOho4v+BByIACOHG79wULXBIRrg6llN019C/EgmySRbcoMJXKj1NRN
Z0Gz4+uGh3DoKfitjMBm0gToPyL1c3II3vCs
=zOJE
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 22 Jan 2019 22:48
(name . Arne Babenhauserheide)(address . arne_bab@web.de)(address . 34128@debbugs.gnu.org)
87lg3cjrdh.fsf@gnu.org
Hi Arne,

Arne Babenhauserheide <arne_bab@web.de> skribis:

Toggle quote (2 lines)
> * gnu/packages/emacs.scm (emacs-xwidgets): new variable

Thanks for the patch! I wonder why this hadn’t been done before;
Nicolas, Alex, Pierre, thoughts?

The patch LGTM, minor stylistic issues:

Toggle quote (15 lines)
> +(define-public emacs-xwidgets
> + (package (inherit emacs)
> + (name "emacs-xwidgets")
> + (synopsis "The extensible, customizable, self-documenting text
> +editor (with xwidgets support)")
> + (build-system gnu-build-system)
> + (arguments (append
> + (package-arguments emacs)
> + `(#:configure-flags
> + '("--with-xwidgets"))))
> + (inputs (append
> + (package-inputs emacs)
> + `(("webkitgtk" ,webkitgtk)
> + ("libxcomposite" ,libxcomposite))))))

Please indent rather along these lines (like in the rest of the file):

(define-public emacs-xwidgets
(package
(inherit emacs)
(name …) …))

Likewise, for consistency, use unquote-splicing rather than ‘append’:

(inputs `(("webkitgtk" ,webkitgtk)
;; …
,@(package-inputs emacs)))

Could you send an updated patch?

Thanks,
Ludo’.
A
A
Arne Babenhauserheide wrote on 23 Jan 2019 00:10
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 34128@debbugs.gnu.org)
877eew70ge.fsf@web.de
Hi Ludovic,

Toggle quote (2 lines)
> Thanks for the patch!

Thank you for your review!

Toggle quote (3 lines)
> I wonder why this hadn’t been done before;
> Nicolas, Alex, Pierre, thoughts?

There is an older bug with xwidgets support which had problems because
it depended on an old version of webkitgtk (I only found it after I sent
the patch). Maybe that stopped others from submitting.

Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (17 lines)
> The patch LGTM, minor stylistic issues:
> …
> Please indent rather along these lines (like in the rest of the file):
>
> (define-public emacs-xwidgets
> (package
> (inherit emacs)
> (name …) …))
>
> Likewise, for consistency, use unquote-splicing rather than ‘append’:
>
> (inputs `(("webkitgtk" ,webkitgtk)
> ;; …
> ,@(package-inputs emacs)))
>
> Could you send an updated patch?

Is inline here OK? If yes:

From ed2eca1ade73eb6b7c2e8b17541e3e182ade4608 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Fri, 18 Jan 2019 23:29:14 +0100
Subject: [PATCH] add emacs built with xwidgets-support

* gnu/packages/emacs.scm (emacs-xwidgets): new variable
---
gnu/packages/emacs.scm | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

Toggle diff (44 lines)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index a488289f1..7e8dcadf9 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -59,6 +59,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages tls)
+  #:use-module (gnu packages webkit)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
   #:use-module (guix utils)
@@ -210,6 +211,22 @@ languages.")
     (native-inputs
      `(("pkg-config" ,pkg-config)))))
 
+(define-public emacs-xwidgets
+  (package
+    (inherit emacs)
+    (name "emacs-xwidgets")
+    (synopsis "The extensible, customizable, self-documenting text
+editor (with xwidgets support)")
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags
+       '("--with-xwidgets")
+       ,@(package-arguments emacs)))
+    (inputs
+     `(("webkitgtk" ,webkitgtk)
+       ("libxcomposite" ,libxcomposite)
+       ,@(package-inputs emacs)))))
+
 (define-public emacs-no-x
   (package (inherit emacs)
     (name "emacs-no-x")
-- 
2.19.2

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE801qEjXQSQPNItXAE++NRSQDw+sFAlxHovIACgkQE++NRSQD
w+vTLw//a1P5koIGpdIB0kDNA4yuFCw2uhLU2WKDRmjfMg0mlyCP23UHS3j8kuLm
aWZeuGBMo9Nd9vhdpDb59UX4oeWyTAcDxvn244+NBZWy8A1REGmU9U4nt2d/3nhh
BjKK0ELrMGUOpTfMMYcv2ldpxyMhI2y3VMH8Z5XUmv1BCZoDPrxIzteopwF3Xq33
Kn14/GzzFkhO77p6AuJiukgXWDfcI98CMnp8QuGIxXThpBSqS2cicCeMPX69mahl
z7UgjeSbK1F5F71VAuaadVlAGS9KBFE+8ypSnhXFUxU/ekt2G7wmNHnP7Jg9conV
GI6JaWpQtcrZNmroTD+hvnBbH7fVkpQj9PWiIBEzV5uFVqGAAAH46R0oEgL+OD5D
c4Og8cHVdFFF4+i88x1HNF5Dps862fmSlpLj3vOOpon6bpv2A6QeT2+eeEBa6Bvr
qL9SzoLydiDasfXi60IN1P4QdkUMGNfU68ivu0R1OolysYa2UmCIfitKZ3MM9LER
5bhKeTlFcOu3BEE/4Jz29kDoCjZEGSGfmHbf6Q4rC/lISEZb/tBiBf28gzfqolYS
nzQNj6I1Nw+YSUkUdyx4eNziywlwWIF/adocjD0l6G39EmE1fhB7YZAKaUIPRUGq
8VmHBRDROGhuHV++sCJ9OQL+NLCMYvFkUQQtQ49ohkmlpOsaPLyIswQBAQgAHRYh
BN0ovebZh1yrzkqLHdzPDbMLwQVIBQJcR6LyAAoJENzPDbMLwQVIMlQEAIOGAX0/
GWl/GXrVF+ELIxWIY0CQ0fwtRZS2Mr4TG53+nWeW59EPaJjWukZnhX9kgrF+HL4F
ens9JW9YeQzD3D5oJljWmvPds0kkkfDOWBTkQyEKHfP+WahGrAtGm0lD6oumTXP7
bHLPNLJPa5QbAxWH1LpC6XOowb+sfbvz8QXM
=uA+/
-----END PGP SIGNATURE-----

R
R
Ricardo Wurmus wrote on 23 Jan 2019 09:19
(name . Arne Babenhauserheide)(address . arne_bab@web.de)
87munr7ply.fsf@elephly.net
Arne Babenhauserheide <arne_bab@web.de> writes:

Toggle quote (13 lines)
> Hi Ludovic,
>
>> Thanks for the patch!
>
> Thank you for your review!
>
>> I wonder why this hadn’t been done before;
>> Nicolas, Alex, Pierre, thoughts?
>
> There is an older bug with xwidgets support which had problems because
> it depended on an old version of webkitgtk (I only found it after I sent
> the patch). Maybe that stopped others from submitting.

I performed the migration of the Emacs xwidgets feature from the old to
the newer webkitgtk API, but that’s when I noticed that xwidgets are
hardly usable in its current state. I certainly wouldn’t use it as a
browser, for example, because there is virtually no integration with the
rest of Emacs.

It works fine for sending JavaScript snippets to the widgets and have it
respond, but it’s not very well integrated into Emacs. Disabling
JavaScript has the effect of disabling *all* JavaScript, which makes
scrolling impossible (as it is implemented by sending JavaScript to the
widget).

Turning it into a usable browser would require more fundamental changes,
and that’s when I stopped working on patches.

--
Ricardo
A
A
Arne Babenhauserheide wrote on 23 Jan 2019 10:37
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87d0onu330.fsf@web.de
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (6 lines)
> I performed the migration of the Emacs xwidgets feature from the old to
> the newer webkitgtk API, but that’s when I noticed that xwidgets are
> hardly usable in its current state. I certainly wouldn’t use it as a
> browser, for example, because there is virtually no integration with the
> rest of Emacs.

I see it as pretty good for many usecases already. I often just want to
look up something in a browser without switching away from Emacs, and
many websites nowadays don’t work with text browsers anymore.

The main thing that’s missing right now is a way to highlight all links
and select the one to follow — similar to next (or one of the other
projects listed on https://qutebrowser.org/).

Do you know why it flickers?

Toggle quote (6 lines)
> It works fine for sending JavaScript snippets to the widgets and have it
> respond, but it’s not very well integrated into Emacs. Disabling
> JavaScript has the effect of disabling *all* JavaScript, which makes
> scrolling impossible (as it is implemented by sending JavaScript to the
> widget).

That doesn’t really hurt me: For sites without javascript, eww mostly
works fine. So when running a webkit, I typically need javascript
anyway.

Also xwidgets as a feature enables much more than just a browser.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE801qEjXQSQPNItXAE++NRSQDw+sFAlxINeQACgkQE++NRSQD
w+tcAA/+Oq5TMjBfbI56eBPvWISyWEOlCJOkl2ysXy9VPuwI4nMXqwoVqUTaBnH3
Wp6Hesfdwl4tDOTZ6QN4GH5cobOyQxWEs+uvQrr9jVCfePNk/9SOONaopivLuKZN
vKF6EZi/uRohj3DH0pU/cJknCSncL8wGRrA7Zn8T/eX4zuaPWCBIpfClPeBZT/vx
X5wTrQlsiCwKNMZg8RFktJH7WmVaRMtgQ6/PZYjnU9Klmyc/q396WNgrfhxAQHTl
rRqqAOUb+Ihp2Sey41O7e+7MYdBQwA1+08a5uxKClgbfKFtXbflFoxXj625EpBNU
ygzR9+BDK9kf8SDsYlpiC+HUgQWWtZab6jIcag0g2l87zrYBZM1x0FY9mhoESrMI
+T7kKwV+uIvhfBQ1ikwkCjhiMG5qO8QVSY6yIJcu0ZCkf6yoKtCXVCOwoAyA++mf
2yMSD0lvd4Wdy/xzS0oG9yPw8g5E0h1ci6bMcSjURr1maPd63qqMSMbvZWTEgWq/
sLdtDPbwng9DxOboAHPSsXiYZFqpgwPrtUiathcvB8HCuciMIOLHtIoBOyVki48E
UTaHTjOauy7wksV/U4QwCNB509Y3Ag7psJz3jmcyB0taRQtIDBUVERKn5CpDrRkc
/4fMT4d4G+NkGAGtGk8kN1SJpraYv1QF2RTaPMvy9RQvhnU47q+IswQBAQgAHRYh
BN0ovebZh1yrzkqLHdzPDbMLwQVIBQJcSDXkAAoJENzPDbMLwQVIA8MD/2FpWJnW
peXBRDM74GsQ6BP0Q/A1QkFpvAGWBnmQny6stj4tLGXtlZfOAwGx3cdhqfGGdRJm
YNml9tgCSM5zoERro4DZGTpiVRj8Q2TXuN7dnYUb3yWfQKadzVXO6me7BNXFYskC
HjKsaQ31frp/a+6YmhmaWco7e6vW/ADrc4Zg
=Wtzm
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 23 Jan 2019 10:53
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87o987hf82.fsf@gnu.org
Heya,

Ricardo Wurmus <rekado@elephly.net> skribis:

Toggle quote (30 lines)
> Arne Babenhauserheide <arne_bab@web.de> writes:
>
>> Hi Ludovic,
>>
>>> Thanks for the patch!
>>
>> Thank you for your review!
>>
>>> I wonder why this hadn’t been done before;
>>> Nicolas, Alex, Pierre, thoughts?
>>
>> There is an older bug with xwidgets support which had problems because
>> it depended on an old version of webkitgtk (I only found it after I sent
>> the patch). Maybe that stopped others from submitting.
>
> I performed the migration of the Emacs xwidgets feature from the old to
> the newer webkitgtk API, but that’s when I noticed that xwidgets are
> hardly usable in its current state. I certainly wouldn’t use it as a
> browser, for example, because there is virtually no integration with the
> rest of Emacs.
>
> It works fine for sending JavaScript snippets to the widgets and have it
> respond, but it’s not very well integrated into Emacs. Disabling
> JavaScript has the effect of disabling *all* JavaScript, which makes
> scrolling impossible (as it is implemented by sending JavaScript to the
> widget).
>
> Turning it into a usable browser would require more fundamental changes,
> and that’s when I stopped working on patches.

Oh, I was more optimistic; thanks for explaining.

Knowing this, what do you think of adding it as a package? We also have
‘guile-emacs’ anyway…

Ludo’.
R
R
Ricardo Wurmus wrote on 23 Jan 2019 12:41
(name . Ludovic Courtès)(address . ludo@gnu.org)
87fttj7g8t.fsf@elephly.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (20 lines)
>> I performed the migration of the Emacs xwidgets feature from the old to
>> the newer webkitgtk API, but that’s when I noticed that xwidgets are
>> hardly usable in its current state. I certainly wouldn’t use it as a
>> browser, for example, because there is virtually no integration with the
>> rest of Emacs.
>>
>> It works fine for sending JavaScript snippets to the widgets and have it
>> respond, but it’s not very well integrated into Emacs. Disabling
>> JavaScript has the effect of disabling *all* JavaScript, which makes
>> scrolling impossible (as it is implemented by sending JavaScript to the
>> widget).
>>
>> Turning it into a usable browser would require more fundamental changes,
>> and that’s when I stopped working on patches.
>
> Oh, I was more optimistic; thanks for explaining.
>
> Knowing this, what do you think of adding it as a package? We also have
> ‘guile-emacs’ anyway…

I’m not at all opposed to adding it as a package. After all, it is a
potentially useful feature and providing a package makes it more likely
that people get to play with it and maybe extend the features by
contributing elisp and JavaScript.

--
Ricardo
L
L
Ludovic Courtès wrote on 23 Jan 2019 23:29
(name . Arne Babenhauserheide)(address . arne_bab@web.de)(address . 34128-done@debbugs.gnu.org)
87bm47dn3c.fsf@gnu.org
Hi Arne,

Arne Babenhauserheide <arne_bab@web.de> skribis:

Toggle quote (2 lines)
> Is inline here OK? If yes:

It is.

Toggle quote (7 lines)
> From ed2eca1ade73eb6b7c2e8b17541e3e182ade4608 Mon Sep 17 00:00:00 2001
> From: Arne Babenhauserheide <arne_bab@web.de>
> Date: Fri, 18 Jan 2019 23:29:14 +0100
> Subject: [PATCH] add emacs built with xwidgets-support
>
> * gnu/packages/emacs.scm (emacs-xwidgets): new variable

Applied, thank you!

I’ve tried it and I confirm that it flickers and that scrolling doesn’t
quite work as nicely as it could. ;-)

Ludo’.
Closed
A
A
Arne Babenhauserheide wrote on 24 Jan 2019 20:06
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 34128-done@debbugs.gnu.org)
87sgxh98ow.fsf@web.de
Ludovic Courtès <ludo@gnu.org> writes:
Toggle quote (6 lines)
>> Subject: [PATCH] add emacs built with xwidgets-support
>>
>> * gnu/packages/emacs.scm (emacs-xwidgets): new variable
>
> Applied, thank you!

Thank you!

Toggle quote (3 lines)
> I’ve tried it and I confirm that it flickers and that scrolling doesn’t
> quite work as nicely as it could. ;-)

Yes — and that it is now as easy as running

guix package -i emacs-xwidgets && emacs
M-x xwidget-webkit-browse-url

to test this is cool!

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE801qEjXQSQPNItXAE++NRSQDw+sFAlxKDL8ACgkQE++NRSQD
w+uPsxAAq82LBIwHYek3OdwrwkEEj/ob225hRsle+xilFTN5GR+25iVdtgscAKPB
tmZCtNPVi1nsUvMs5ykr9zftZzJ1Q9jR7cLEHF5wcBc1JmR6Om4zjuiH9AAne6+4
mQ11l94YAqwwXja3mZhqFSN+sN9PdIh+fR6Si8W85GNwVGcXhxpr0TGwYatoi2vf
HYIA60Z5gqZDHOE9X3WxB9jbi2VbIElB+MqNg2yvYJK9YbX/D9LU9RFSLJ+NkKoN
trp9f4xvN229eAaWtsAJWlxK7E/Qqc3W5jx7z3VFWLjBFzY8uRTIYVcKZEUAeANC
UXjcKcWtWmI+ltAzrblmj+GJDbvZZpGsz1pdZnBTSPIAtOVYCOUrEreyim4/XQMh
0AvWpeFERPiljCjZ6de+ycRQaC5Rxo5DH2k0seedh1/C9OkWYv2WwsARqKXM1ojF
ybXsXm7ownDbwX8O9NB3JtJZuq3upr+ga/0D9j1iEWQsPCmwrbSyEZ0Mq91Mg6Bw
KUJiareVCFaSG+VprAtcFwUPPyPqSjhyzt3EdLHiPwRVfcWznyPgUOpc6L5YgoYu
up1AA9Zt6/REIKW0fXf2VG7gRPWyoL6Oe+0AaH5KWjj1SiPIJJ9XDDOz0+6DIDGU
8QgrTHVeDdUapVqGI2alNp+eZy32MzsPrTv5Mj1leBeWCJcZE7KIswQBAQgAHRYh
BN0ovebZh1yrzkqLHdzPDbMLwQVIBQJcSgy/AAoJENzPDbMLwQVI5UQEAJY0ViKL
LcOVJv6mjua9xN2sqxQuOc/X4OpeQTp8TevFhqh/ku77A89rHxHpuEY48AYvYSwd
Vhh/oKib3F4ONzn4bmTYa3TTeXv3L2X2l+bu9T+ge7AGwNv2601VKedq5v+q0nmE
UxuDfwBh6ijMhqqsWfTNjxbdFNxfGYRA76jD
=m41e
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 34128@debbugs.gnu.org