# Extend Emacs to Modern GUI Applications with EAF
Matthew Zeng
[[!template id=vid src="https://mirror.csclub.uwaterloo.ca/emacsconf/2020/emacsconf-2020--34-extend-emacs-to-modern-gui-applications-with-eaf--matthew-zeng.webm"]]
[Download compressed .webm video (28.4M)](https://media.emacsconf.org/2020/emacsconf-2020--34-extend-emacs-to-modern-gui-applications-with-eaf--matthew-zeng-vp9-q56-original-audio.webm)
Emacs Application Framework (EAF) is a customizable and extensible GUI
application framework that extends Emacs graphical capabilities using
PyQt5. This talk will cover the architecture design of the EAF
project, and demonstrate some of its most useful applications: modern
browser, PDF viewer, video player, etc.
- Actual start and end time (EST): Start 2020-11-29T16:05; Stop 2020-11-29T16:28
# Questions
## Q9: Do you think that this tecnology could to be on core of Emacs any time? or fork of Emacs?
Not yet and I don't know if it ever will, since EAF uses many other
dependencies that one needs to install themselves (see README); and I
don't think all of them is GPL (though using open source licenses).
## Q8: I use PDF-Tools currently for my PDFs inside Emacs, would you consider this a better alternative to that and if so why? Although I am definitely trying it because the browser looks incredible, possibly the best implementation of an Emacs browser I have seen, I would love to hear your opinion on the PDFs compared to something like PDF-Tools.
PDF-Tools is great, it would be an awesome option if you can't run EAF
on your machine. However EAF PDF Viewer is just **a lot faster and
smoother** as it uses PyMuPDF as its backend.
- Oh, thats great actually, I have noticed it being a little choppy at
times, I am excited to try EAF in general because it looks awesome
and if its faster than pdf-tools I will probably also switch to it
for my PDFs. Thanks a lot for the talk, one of my favourites in this
EmacsConf, it gave me a lot of great tools to try inside Emacs!!
- Thank you!!!
Also because PDF-Tools is much older than EAF, it had more attention
and more people working on it, so there are definitely more features
than the current EAF.
## Q7: Can you use the PDF viewer as a viewer for LaTeX files, with reverse search support with e.g. AucTeX?
You could do that with some simple Elisp functions, and EAF PDF Viewer
now updates itself automatically whenever there is a change to the
file.
Reverse search is currently not available, we need more people to help
us work on it! :-)
## Q6: What JavaScript engine is the web browser in EAF using? Also, what web browser engine is it using?
QtWebEngine,. (from the Qt Wiki: )
- Qt WebEngine uses code from the Chromium project. However, it is not
containing all of Chrome/Chromium;
- Auxiliary services that talk to Google platforms are stripped out
(nice).
- The codebase is modularized to allow use of system libraries like
OpenSSL.
- Binary files are stripped out.
## Q5: Does the web rendering happen in a subprocess, or can loading a big page cause Emacs to lag?
Not at all! And that's one of the biggest advantage of the EAF
project, it utilizes all the powerful Python features, like
multithreading.
## Q4: Do you have control over the JavaScript that runs on these pages? Also is there a blocklist feature? (True ad blocking might be impossible, I understand)
As my talk just (or will be shortly) mentioned, you can disable
JavaScript altogether. So far there isn't a blocklist implemented, but
I don't see a reason not to be able to implement this feature in the
near future. EAF itself uses JavaScript (free code) to implement some
browser features (like the Vimium binding), so turning off JavaScript
will make the feature stop working as well.
## Q3: (Feel free to ignore this one if it is off-topic) How big is free software movement in China? Is there any organisation like FSF there?
Very recent years there are A LOT of open source movement in China,
however not free software strictly speaking;
There are a lot of open source clubs in the chinese unversities now
that people actually starting to get interested about open source in
general, that's a huge improvement than decades ago I'd say. There are
still many places to improve.
Although not Free Software Foundation, literally this year the first
ever open source foundation is established in China, called OpenAtom
Foundation: (in chinese).
## Q2: Is there anyway to implement EAF without the reparenting behavior from X11?
That's one of the challenges right now to get EAF working on other
platforms. We're always looking for people to help out.
- Are there any ideas on this at all? I can try to help out but don't
know what's even been tried (and perhaps has already been ruled out).
- So EAF is currently using `QWindow::setParent`, not Xreparent, so
it in theory should be able to support at least Windows (IIRC it
provided API for setParent function to interact with).
- However `QWindow::setParent` doesn't work on native Wayland, you
can get more context in here:
.
## Q1: Have you experimented with using Hy (aka Hylang, a Lisp that compiles to/runs in Python) for EAF, to avoid having to write "real Python"?
Not yet! Will have a look into it later :-)
# Notes
- One of the admins of the [Emacs China
forum](https://emacs-china.org/).
-