akirakyle / emacs-webkit

An Emacs Dynamic Module for WebKit, aka a fully fledged browser inside emacs
GNU General Public License v3.0
419 stars 24 forks source link

xwidget #39

Closed mikereape closed 1 year ago

mikereape commented 2 years ago

Hi I'm a wee bit confused. I'm using spacemacs with a github.com/konstare/emacs-gcc-pgtk build of emacs 29.0.50. I don't use an xserver because I'm running Ubuntu 21.10 with wayland. For most of the basic webkit commands (e.g., webkit itself) it keeps trying to use xwidget versions and then my Emacs tells me it wasn't build with xwidgets support. What's got me confused is that in your readme it says you tried that in the past and wanted to get away from it. I definitely don't want to be using the old xwidgets stuff (or an xserver for that matter).

Do you have any idea what's going on please? Even of you could just give me a clue how to see if I've got it installed correctly would be a huge help. I am not definitely not super-knowledgeable about browsers. For that matter, I'm not the greatest Emacs hacker in the world either though I am a 35 year Emacs addict.

I'm just doing the usual old school add to load-path/require thing for gettnig started purposes although I see that in webkit.el webkit autoloads.

Thanks very much in advance

akirakyle commented 2 years ago

I think I'd need more details to be helpful (i.e. what command(s) did you try to run, what were the messages you got?).

The situation has changed in the year or so since I initially made this and now the emacs builtin xwidget-webkit feature actually does support running on pgtk on pure wayland so that's also an option. (Actually I'd like to repackage some of the enhancements I've made here to work with xwidget-webkit since I don't have the bandwidth to really maintain this project and it really is based on a bit of a hack).

Based on the emacs build you're running it looks like you shouldn't have xwidget enabled, so my initial guess might be that you actually don't have the dynamic module correctly built.

mikereape commented 2 years ago

Hi again

So you were right about dynamic modules not compiled in. My bad. Humblest apologies for wasting your time. My memory failed me. I thought it was in by default circa 27.2. So I did a rebuild and can confirm that dynamic module support was compiled in because akermu/emacs-libvterm works.

But that doesn't address the problem I had before. So if I set a keybinding for "webkit" (the command) appropriately I get this:

xwidget-webkit URL:

and then if I type in, e.g., google.com

I get this:

Your Emacs was not compiled with xwidget support

There's a couple of other minor wrinkles though. In your readme you had:

(require 'webkit) 
(global-set-key (kbd "s-b") 'webkit) ;; Bind to whatever global key binding you want if you want

which according to my understanding isn't going to work because I get a wrong type argument: commandp error because supposedly global-set-key expects an interactive function(?)

In your readme you suggest a require but my understanding (or not) is that webkit is autoloaded so spacemacs at least balks.

Also I explictly in the build tell it not to include xwidgets because I just wanted to eliminate that as a possible cause.

I can really appreciate your "limited bandwidth" but I'd really like to get this working because I've been waiting for like a year plus for Ubuntu to come along with wayland by default, etc. In fact, I built my Emacs without the X toolkit and I access it from a Windows 11 notebook which has no X server installed which is very cool.

I'd be quite happy to upload my Docker file and a build.sh if anyone is interested. It's a slightly modified version of konstare/emacs-gcc-pgtk.

Like you I spend all my time in Emacs and a brower so I like really want this.

I'd be extremely grateful for any suggestions.

Thanks very much in advance

mikereape commented 2 years ago

PS I would encourage you to update, etc. and keep up the good work!

Mike

akirakyle commented 2 years ago

Sorry I should have been more explicit. Emacs dynamic modules require the corresponding *.so file to be in the emacs load path, which must first be built. There's a simple Makefile in this repo which will do that if you have gcc, pkg-config, gtk3, glib-networking, and webkitgtk already installed. Run make in this repo's directory to build the webkit-module.so which the error you're getting is complaining about not finding.

mikereape commented 2 years ago

Hi very sorry for long delay getting back. This can be closed. Your last comment was very helpful as I was missing glib-networking and pkg-config. However I'm about to ask another question in a new issue so as not to confuse things. This can be closed. Thanks very much for your input. Best, Mike