Emacs: Difference between revisions
→Configuration: provide a clearer list of possible ways to configure emacs |
Added a workaround for a bug that hasn't been fixed upstream yet, when using xwidgets and pgtk. |
||
| Line 387: | Line 387: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==== Running xwidgets ==== | |||
Currently, the xwidgets feature is available for Emacs, but will have some issues with the PGTK build. Indeed, when create a webkit xwidget, the widget will initially show a blank page, for some seconds (usually 4/5 seconds), no matter whether you actually try to load a web page. | |||
A workaround to this is to way that delay, and then try to load the page. You can do so programmatically by waiting 5 seconds, or from within a webkit widget by waiting for 5 seconds, then pressing <code>g</code>, then <code>RET</code>. | |||
Otherwise, you can fix the issue by building Emacs with the following patch<syntaxhighlight lang="diff">--- a/src/xwidget.c | |||
+++ b/src/xwidget.c | |||
@@ -362,8 +362,12 @@ | |||
"download-started", | |||
G_CALLBACK (webkit_download_cb), xw); | |||
+#if !defined HAVE_PGTK | |||
+ /* when using pgtk, the about:blank workaround is not needed | |||
+ would in fact make the initial load fail. */ | |||
webkit_web_view_load_uri (WEBKIT_WEB_VIEW (xw->widget_osr), | |||
"about:blank"); | |||
+#endif | |||
/* webkitgtk uses GSubprocess which sets sigaction causing | |||
Emacs to not catch SIGCHLD with its usual handle setup in | |||
'catch_child_signal'. This resets the SIGCHLD sigaction. */</syntaxhighlight>Say you saved this file in <code>xwidget.patch</code>, then you can override emacs with<syntaxhighlight lang="nix">pkgs.emacs-pgtk.overrideAttrs (old: { | |||
patches = (old.patches or []) ++ [ ./xwidget.patch ]; | |||
}</syntaxhighlight>Beware, this will trigger a full Emacs compilation whenever you update it, because it will not match any cached binary. | |||
== Troubleshooting == | == Troubleshooting == | ||