emacs-application-framework
EAF, an extensible framework that revolutionizes the graphical capabilities of Emacs
Top Related Projects
A blazingly fast LSP client for Emacs
Emacs client/library for the Language Server Protocol
Quick Overview
The Emacs Application Framework (EAF) is a powerful and extensible framework for building applications within the Emacs text editor. It provides a set of tools and APIs that allow developers to create custom applications and integrate them seamlessly into the Emacs ecosystem.
Pros
- Extensibility: EAF allows developers to create a wide range of applications, from web browsers and media players to code editors and task managers, all within the Emacs environment.
- Integration: EAF applications are tightly integrated with Emacs, allowing for seamless interaction and data exchange between the applications and the editor.
- Cross-platform: EAF is designed to be cross-platform, with support for Windows, macOS, and Linux.
- Active Development: The EAF project is actively maintained and developed, with regular updates and improvements.
Cons
- Learning Curve: Developing applications for EAF may require a certain level of familiarity with Emacs and its ecosystem, which can be a barrier for some developers.
- Dependency on Emacs: EAF is tightly coupled with Emacs, which means that users must have Emacs installed to use the applications built with EAF.
- Limited Adoption: While EAF is a powerful framework, it may not have the same level of adoption and community support as some other Emacs packages or external applications.
- Performance: Depending on the complexity of the application, EAF applications may not perform as well as native applications or those built with other frameworks.
Code Examples
Here are a few examples of how to use the EAF framework:
- Creating a Simple Browser:
from eaf.browser import Browser
browser = Browser()
browser.open_url("https://www.example.com")
This code creates a simple web browser application using the Browser
class provided by EAF.
- Integrating a Media Player:
from eaf.media_player import MediaPlayer
player = MediaPlayer()
player.open_file("/path/to/your/media/file.mp3")
player.play()
This code creates a media player application that can play audio and video files.
- Implementing a Code Editor:
from eaf.code_editor import CodeEditor
editor = CodeEditor()
editor.open_file("/path/to/your/code/file.py")
editor.set_language("python")
editor.save_file()
This code creates a code editor application that can open, edit, and save code files, with support for syntax highlighting and other programming-related features.
Getting Started
To get started with the Emacs Application Framework (EAF), follow these steps:
-
Install Emacs on your system. EAF is designed to work with Emacs, so you'll need to have it installed.
-
Clone the EAF repository from GitHub:
git clone https://github.com/emacs-eaf/emacs-application-framework.git
-
Add the EAF directory to your Emacs load path by adding the following line to your Emacs configuration file (e.g.,
~/.emacs.d/init.el
):(add-to-list 'load-path "~/path/to/emacs-application-framework")
-
Load the EAF package in your Emacs configuration:
(require 'eaf)
-
Start using the EAF applications by running the corresponding commands. For example, to start the web browser, use the
eaf-open-browser
command.
That's the basic setup to get started with the Emacs Application Framework. You can then explore the available applications, customize the framework, and even create your own applications using the provided APIs and tools.
Competitor Comparisons
A blazingly fast LSP client for Emacs
Pros of lsp-bridge
- Focused specifically on LSP integration, potentially offering more specialized and optimized LSP support
- Lighter weight and more targeted solution for developers primarily interested in LSP functionality
- Potentially faster performance due to its specialized nature and use of Rust for core functionality
Cons of lsp-bridge
- More limited in scope compared to the broader application framework offered by emacs-application-framework
- May require additional setup or plugins for features beyond LSP that are included in emacs-application-framework
- Less flexibility for non-LSP related tasks and applications
Code Comparison
lsp-bridge:
(use-package lsp-bridge
:config
(global-lsp-bridge-mode))
emacs-application-framework:
(use-package eaf
:load-path "~/.emacs.d/site-lisp/emacs-application-framework"
:custom
(eaf-browser-continue-where-left-off t)
:config
(eaf-setq eaf-browser-enable-adblocker "true"))
The code snippets show the basic setup for each project. lsp-bridge focuses on enabling LSP functionality globally, while emacs-application-framework provides a more comprehensive framework with various applications and customization options.
Emacs client/library for the Language Server Protocol
Pros of lsp-mode
- Broader language support with a wide range of Language Server Protocol (LSP) servers
- Seamless integration with existing Emacs workflows and packages
- Lightweight and focused on providing IDE-like features within Emacs
Cons of lsp-mode
- Limited to text-based interactions and editing
- Requires separate configuration for each language server
- May have performance issues with large projects or complex language servers
Code Comparison
lsp-mode:
(use-package lsp-mode
:hook ((python-mode . lsp)
(rust-mode . lsp))
:commands lsp)
emacs-application-framework:
(use-package eaf
:load-path "~/.emacs.d/site-lisp/emacs-application-framework"
:custom
(eaf-browser-continue-where-left-off t)
(eaf-browser-enable-adblocker t))
The lsp-mode configuration focuses on enabling LSP for specific programming modes, while the emacs-application-framework setup is more about configuring browser-like applications within Emacs.
lsp-mode is better suited for developers looking to enhance their coding experience with IDE-like features, while emacs-application-framework offers a broader range of applications and multimedia support within Emacs. The choice between them depends on whether you prioritize advanced coding features or a more comprehensive suite of applications within your Emacs environment.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
English | ç®ä½ä¸æ
A free/libre and open-source extensible framework that revolutionizes the graphical capabilities of Emacs.
The key to ultimately Live in Emacs
Vision
Emacs, the extensible text editor, is more than 45 years old. It is older than virtually all operating systems people use today, almost as old as the first UNIX system. During the decades of development, the world's brightest hackers have contributed their intelligence and creativity. Together they've constructed the most comprehensive and richest ecosystem that you can find in any software to date.
If you are a hacker who works with numerous languages and text, who's keyboard-driven and desires maximum freedom, extensibility, and introspectivity over your tool, maybe to the extent of living in it, Emacs will be your best bet.
Unfortunately, this 45 years of age is also one of the greatest disadvantages of Emacs. Comparing with modern software, Emacs lacks performance. Specifically Emacs Lisp lacks performance. It doesn't have proper multithreading and its graphical capabilities are seriously limited. It is far from what you'd expect from any GUI application today (such as IDEA or VSCode). You may think that Emacs, as a text-centric editor, doesn't need them, but have you ever run into a situation that, you sit comfortably typing commands and doing your Emacs sorcery, but can't help but ponder:
What if Emacs had a real browser?
What if this PDF or video file could be viewed efficiently without leaving Emacs?
Emacs, although infinitely extensible in text, is very limited in graphics. It shouldn't have to be this way. However, Emacs Lisp is the integral part of the Emacs culture, it carries decades of history with itself, it is what makes Emacs special. It is irreplaceable.
The vision of the Emacs Application Framework (EAF) project is, while fully retaining the rich history, culture, and ecosystem of Emacs and Emacs Lisp, to open up completely new doors to the ecosystems of Python, Qt6, and even JavaScript. EAF extends Emacs to the world of modern graphics, but still preserving the extensibility and customizability of Emacs. It will be the key to ultimately Live in Emacs.
Features
EAF is very extensible. We ship a lot of applications, feel free to choose anything you find interesting to install:
Browser | PDF Viewer |
---|---|
Music Player | File Manager |
---|---|
- Browser: A modern, customizable and extensible browser in Emacs
- PDF Viewer: Fastest PDF Viewer in Emacs
- Music Player: Music player that supports playlist and audio visualization
- Video Player: Video Player in Emacs
- Image Viewer: Dynanmic image viewer
- RSS Reader: RSS Reader in Emacs
- Terminal: Full-featured terminal in Emacs
- Camera: Use camera in Emacs
- Markdown Previewer: Real-time Markdown previewer
- Org Previewer: Real-time Org-mode previewer
- Git Client: Fully multi-threaded git client for Emacs
- File Manager: Fully multi-threaded replacement for dired-mode
... plus many more!
EAF in EmacsConf
EmacsConf 2020: Extend Emacs with EAF | EmacsConf 2021: EAF: A 2021 Update |
---|---|
Install
EAF supports Linux (X11 and Wayland), Windows, macOS and FreeBSD. The installation method is very simple.
1. Download EAF
git clone --depth=1 -b master https://github.com/emacs-eaf/emacs-application-framework.git ~/.emacs.d/site-lisp/emacs-application-framework/
2. Install/Update EAF applications and dependencies
You can use M-x eaf-install-and-update
or manually run the install-eaf.py
script in the EAF directory:
cd emacs-application-framework
chmod +x ./install-eaf.py
./install-eaf.py
There are many useful flags available for install-eaf.py
, check it yourself using --help
.
There are four types of support for the Wayland environment:
- XWayland: EAF can run directly under XWayland
- Gnome3 Wayland Native: You need to execute the command
cp -r emacs-application-framework/gnome-shell/eaf-wayland@emacs-eaf.org ~/.local/share/gnome-shell/extensions
and activate theeaf-wayland@emacs-eaf.org
plugin ingnome-extensions
- Sway Wayland Native: jq needs to be installed
- Hyprland Wayland Native
Unity environment support: requires xdotool
to be installed.
3. Load EAF Core
From here on, you can add the full path to the EAF installation directory to your Emacs load-path
, then add the following to init.el
:
(add-to-list 'load-path "~/.emacs.d/site-lisp/emacs-application-framework/")
(require 'eaf)
-
Alternatively, if you use use-package, you can use the following sample configuration for your convenience.
(use-package eaf :load-path "~/.emacs.d/site-lisp/emacs-application-framework" :custom ; See https://github.com/emacs-eaf/emacs-application-framework/wiki/Customization (eaf-browser-continue-where-left-off t) (eaf-browser-enable-adblocker t) (browse-url-browser-function 'eaf-open-browser) :config (defalias 'browse-web #'eaf-open-browser) (eaf-bind-key scroll_up "C-n" eaf-pdf-viewer-keybinding) (eaf-bind-key scroll_down "C-p" eaf-pdf-viewer-keybinding) (eaf-bind-key take_photo "p" eaf-camera-keybinding) (eaf-bind-key nil "M-q" eaf-browser-keybinding)) ;; unbind, see more in the Wiki
4. Load EAF Apps
You can use below code to load applications browser
and pdf-viewer
that you installed. Please check Applications for the full list:
(require 'eaf-browser)
(require 'eaf-pdf-viewer)
5. Hooray!
Congratulations, you just installed EAF! You can try M-x eaf-open-demo
(that is if you have demo
installed, of course) to see if everything works properly, and enjoy the new possibilities of Emacs.
Below are launch commands of EAF Applications:
Application Name | Launch |
---|---|
Browser | M-x eaf-open-browser Search or Goto URL |
M-x eaf-open-browser-with-history Search or Goto URL or Goto History | |
HTML Email Renderer | M-x eaf-open-mail-as-html in gnus , mu4e , notmuch HTMl Mail |
PDF Viewer | M-x eaf-open PDF File |
Video Player | M-x eaf-open Video File |
Image Viewer | M-x eaf-open Image File |
Markdown Previewer | M-x eaf-open Markdown File, select markdown-previewer |
Org Previewer | M-x eaf-open Org File, select org-previewer |
Camera | M-x eaf-open-camera |
Terminal | M-x eaf-open-pyqterminal |
File Manager | M-x eaf-open-in-file-manager |
RSS Reader | M-x eaf-open-rss-reader |
Git Client | M-x eaf-open-git |
Map Route Planning | M-x eaf-open-map |
File Sender | M-x eaf-file-sender-qrcode or eaf-file-sender-qrcode-in-dired |
File Browser | M-x eaf-file-browser-qrcode |
Airshare | M-x eaf-open-airshare |
Markmap | M-x eaf-open Markdown or Org file, select markmap |
Mindmap | M-x eaf-create-mindmap or M-x eaf-open-mindmap |
MS Office Viewer | M-x eaf-open-office |
Jupyter | M-x eaf-open-jupyter |
Music Player | M-x eaf-open-music-player |
System Monitor | M-x eaf-open-system-monitor |
Demo | M-x eaf-open-demo to verify basic functionality |
Vue Demo | M-x eaf-open-vue-demo to verify vue.js functionality |
- EAF Browser and PDF Viewer support Emacs built-in bookmark operation, with
M-x bookmark-set
(defaulted toC-x r m
) andM-x bookmark-bmenu-list
(defaulted toC-x r l
).
Upgrade
Also, you should regularly git pull
and run install-eaf.py
(M-x eaf-install-and-update
) to update EAF, its applications, and relating dependencies.
Report bug
For any installation and configuration assistance, please read the Wiki and FAQ.
If you encounter a problem with EAF, and it occurred after pulling the latest commit, please check the Mandatory Procedures to Keep Your EAF Up-To-Date page first.
For any other problems, please use emacs -q
and load a minimal setup with only EAF to verify that the bug is reproducible. If emacs -q
works fine, probably something is wrong with your Emacs config.
If the problem persists, please report it here with the *eaf*
buffer content. It contains many clues that can help us locate the problem faster.
If you get a segfault error, please use the following way to collect crash information:
- Install gdb and turn on option
(setq eaf-enable-debug t)
- Use the command
eaf-stop-process
to stop the current process - Restart eaf, send issue with
*eaf*
buffer content when next crash
EAF in the community
A list of other community packages that use EAF to enhance their graphical experiences!
If we missed your package, please make a PR to add it to the list.
- obr-viz: visualizing org-brain relationships using EAF
- netease-cloud-music: A netease music client for emacs.
- 2048pyqt6: A 2048 game that can run in emacs.
- pyqterminal: A terminal written in PyQt6.
Contributor
Join Us
Do you want to make Emacs a real "operating system"?
Do you want to live in Emacs more comfortably?
Do you want to revolutionize the capabilities of Emacs?
Top Related Projects
A blazingly fast LSP client for Emacs
Emacs client/library for the Language Server Protocol
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot