What is Emacs Application Framework?
Emacs Application Framework is a development framework, where developers can develop any PyQt program, and integrate into Emacs.
This framework mainly implements three functions:
- Integrate PyQt program window into Emacs Frame using Xlib Reparent technology
- Listening to EAF buffer's keyboard event flow and controlling the keyboard input of PyQt program via DBus IPC
- Created a window compositer to make the PyQt program window adapt Emacs's Window/Buffer design
Using this framework, you can use PyQt to develop powerful graphics programs to extend Emacs.
Screenshots of EAF
|Image Viewer||Video Player|
|File Transfer||File Uploader|
|Air Share||Org Previewer|
Install python dependences:
Make sure python3 and pip has install in your operating system, then execute below command:
sudo pip install dbus-python PyMuPDF grip qrcode pyqt5 python-xlib
- Clone this repository and add below code in your ~/.emacs
|python-xlib||Stick app window into emacs frame|
|python-pyqt5||GUI library required for application development|
|dbus-python||DBus IPC for python and elisp|
|PyMuPDF||Render engine required for PDF Viewer|
|grip||Markdown render server for Markdown Previewer|
|qrcode||Render local file QR code|
Or run EAF with docker
If you prefer to run linux in a docker, you can read Run EAF with docker
Why this awesome framework doesn't works with MacOS?
There are mainly three obstacles:
- I can't make dbus/python-dbus works on MacOS High Sierra
- This framework need use X11 reparent to stick Qt5 window to emacs frame, but i don't know how to make X11 works on MacOS.
- Qt5 QGraphicsView/QGraphicsScene can't work MacOS, specify QGraphicsVideoItem can't work.
NOTE: EAF use DBus' session bus, it must running in general user. Please don't run EAF with root user, root user just can access DBus's system bus.
Type 'eaf-open-url' RET www.google.com
|Left Button||Open link in current tab|
|Ctrl + Left Button||Open link in new tab|
|M-f||Forward page in history|
|M-b||Backward page in history|
|M-q||Delete all cookies|
Type 'eaf-open' RET pdf-filepath
|PDF Viewer Key||Event|
|Space||Scroll up page|
|b||Scroll down page|
|,||Scroll to end|
|.||Scroll to home|
|t||Switch scale mode|
|p||Goto to percent|
Type 'eaf-open' RET video-filepath
|Video Player Key||Event|
|Space||Play or Pause|
Type 'eaf-open' RET image-filepath
|Image Viewer Key||Event|
|j||Load next image in current directory|
|k||Load previous image in current directory|
|Markdown previewer||Type 'eaf-open' RET markdown filepath|
|Org file previewer||Type 'eaf-open' RET org filepath|
|File Transfer||Type 'eaf-show-file-qrcode'|
|Or use `dired-show-file-qrcode' in dired mode|
|File Uploader||Type 'eaf-upload-file'|
|Air Share||Type 'eaf-air-share'|
If you can't access most awesome internet services like me, you perhaps need proxy settings like below:
(setq eaf-http-proxy-host "127.0.0.1") (setq eaf-http-proxy-port "1080")
Then EAF browser is free! ;)
If you use markdown previewer, you need access to a Personal access token, fill something in "Token description" and click button "Generate token" to get your personal token, then set token with code:
(setq eaf-grip-token "yourtokencode")
Otherwise, github will popup "times limit" error because so many peope use grip. ;)
If you have any problem with EAF, please use command "emacs -Q" to start Emacs without any customizations.
Then re-test your workflow. If "emacs -Q" works fine, it's must be something wrong with your emacs config file.
If the problem persists, please report bug here.
Do you want to make Emacs a real operating system?
Do you want to live in emacs more comfortably?
Want to create unparalleled plugins to extend emacs?
如果我的作品让你的生活充满快乐, 欢迎请我喝瓶啤酒, 哈哈哈哈