Xenoemacs organizes the emacs
files into a template that comes preconfigured with fully featured development environments for the languages used
in the XENOBYTE projects plus a few, general purpose utilities. To manage all these packages, Xenoemacs uses a very simple
script that scans the package list in /emacs.d/xenoemacs-packages.el and automatically searches, downloads, installs and updates them.
To include a new addon, simply add whatever custom commands the package requires to its respective configuration file in
/.emacs.d/custom/, and the main ~/.emacs file will load it on startup. This file
contains the settings for debugging, file backups and user data, while the /.emacs.d/custom/ directory encapsulates
the loading and configuration of the dependencies.
Xenoemacs is guaranteed to be updated for the latest stable version of EMACS and our dotfiles.
The Xenoemacs configuration is merely a reorganization of the vanilla EMACS setup. It first loads the main ~/.emacs file
and goes through its contents, downloading and installing the packages specified in ~/.emacs.d/xenoemacs-packages.el
and finally configuring them by loading the ~/.emacs.d/custom/ files. To remove or add custom config files simply
add them to the .emacs list but beware that package loading order matters.
This guide assumes the user is running a freshly installed arch or manjaro distro as a starting point, but it works with any other UNIX distro and even Windows (not all EMACS packages are guaranteed to work in Windows, though).
Last revised: 12/05/2022
1. Install dependencies
To add grammar checking and autocorrect support for different languages install its respective aspell package, xenoemacs is configured to work with English, Spanish and Portuguese.
pacman -S aspell aspell-en aspell-es aspell-pt clang llvm gcc lua nodejs python-virtualenv cmake ctags python-pygments wget xwinfo xorg-xwininfo xorg-xprop xclip jansson nasm
Note that the default font isn't included, it must be manually downloaded from the dotfiles repo and installed, alternatively you can simply specify a different font while configuring the custom/interface-conf.el file.
2. Install EMACS from source
Make sure toggle configure their build with native JSON support (requires libjansson) (available as of EMACS 27)
sudo make install
3. Install gnu-global from source
tar xvf global-ver.tar.gz
sudo make install
cp gtags.conf ~/.globalrc
echo export GTAGSLABEL=pygments >> ~/.profile
4. Install BEAR from source
git clone https://github.com/rizsotto/Bear
sudo make install
5. Install tern and JS lsp server and make a symbolic link to where EMACS requires
sudo npm i -g tern
sudo npm i -g indium
sudo ln -s ~/node_modules/bin/tern /usr/local/bin/
sudo npm i -g typescript-language-server; sudo npm i -g typescript
6. Install boxes
Boxes can be directly integrated with EMACS by selection of a region and calling shell-command-on-region (C-u M-| [ | boxes -d [box style]])
git clone https://github.com/ascii-boxes/boxes
sudo cp out/boxes /usr/bin
7. Clone the Xenoemacs repo and move the files to their corresponding locations
Make sure to edit ~/.zshrc to fit your system configuration.
git clone https://git.xenobyte.xyz/XENOBYTE/xenoemacs/
mv xenoemacs/.emacs ~/
mv -R xenoemacs/.emacs.d ~/
rm -R xenoemacs
8. Configure your Xenoemacs installation
EMACS requires some manual configuration to properly work, the changes are mostly references to dependencies scattered
throughout the system, simply read the context of the string and make sure the requested files exist.
Main configuration file.
;; User details
(setq user-full-name "USERNAME")
(setq user-mail-address "EMAIL")
Contains the total package list.
// Manage extension list (extensions are automatically downloaded and updated)
Package loading and configuration, ordered by syntax / purpose.
9. Start EMACS for the first time
The first time EMACS boots, it will iterate through the xenoemacs-packages list and will unpack the necessary files to ~/.emacs.d/elpa.
After EMACS is installed and running for the first time without errors, proceed to the configuration section.
Make sure the Xenoemacs pacakge list is properly downloaded and configured, meaning that EMACS can start without errors (this can be checked by reading the
compilation / message buffers!).
10. Configuring ~/.emacs.d/custom/asm-conf.el
The assembly package depends on nasm and a local copy of the official INTEL ASM MANUAL. Download it to the ~/.emacs.d folder and rename to "x86-lookup.pdf". Lastly, install pdftotext.
wget -c https://software.intel.com/content/dam/develop/public/us/en/documents/325462-sdm-vol-1-2abcd-3abcd.pdf
mv 325462-sdm-vol-1-2abcd-3abcd.pdf ~/.emacs.d/x86-lookup.pdf
pip install pdftotext
11. Configuring ~/.emacs.d/custom/c-conf.el
Make sure the source paths are valid.
(semantic-add-system-include "/usr/include/boost" 'c++-mode)
(semantic-add-system-include "~/Qt/5.15.1/gcc_64/include/" 'c++-mode)
(semantic-add-system-include "/usr/include/c++/10.2.0" 'c++-mode)
12. Configuring ~/.emacs.d/custom/company-conf.el
This file shouldn't require anything modifications. If you want to add
a new backend, make sure to properly test it since the loading order matters.
13. Configuring ~/.emacs.d/custom/flycheck-conf.el
Remap the spell checking and language cycling hotkeys.
(global-set-key (kbd "<f6>") 'cycle-ispell-languages)
(global-set-key (kbd "<f9>") 'ispell-word)
(global-set-key (kbd "C-S-<f8>") 'flyspell-mode)
(global-set-key (kbd "<f7>") 'flyspell-buffer)
(global-set-key (kbd "C-<f8>") 'flyspell-check-previous-highlighted-word)
14. Configuring ~/.emacs.d/custom/general-conf.el
This file loads and configures all general purpose packages and their
respective keybindings, edit to your liking.
;; Install icons and enable general icon support
15. Configuring ~/.emacs.d/custom/helm-conf.el OR ive-conf.el
Whichever your prefer, comment out the other one ~/.emacs.
;; Only enable helm or ivy
;; (require 'ivy-conf)
16. Configuring ~/.emacs.d/custom/interface-conf.el
Interface settings (font, theme, cursor, toolbars, etc.) and native package configuration.
17. Configuring ~/.emacs.d/custom/lua-conf.el
No changes needed.
18. Configuring ~/.emacs.d/custom/python-conf.el
Use pip to install autopep8, pylint and a python-lsp server (all by default because why not).
pip install autopep8
pip install pylint
pip install 'python-lsp-server[all]'
19. Configuring ~/.emacs.d/custom/web-conf.el
HTML & PHP editing should work out of the box. Javacsript setups have recently moved from tern
to lsp + indium and then from company-lsp to company-capf (included in the core company package). Regardless of which JS configuration you choose (make sure to comment out their other one) you require npm to install the package dependencies. EMACS uses the exec-path-from-shell package to locate npm's global install directory.
If EMACS fails to find a dependency that your terminal doesn't, uncomment the line with the hard coded path to the local npm binaries.
npm install -g tern indium semver node-fetch source-map p-queue chrome-remote-interface
echo 'export npm_config_prefix="$HOME/.node_modules"' > ~/.profile
echo 'export NODE_PATH="$HOME/.node_modules/bin"' > ~/.profile
20. Configuring ~/.emacs.d/custom/yasnippet-conf.el
Extract the snippets into the ~/.emacs.d/snippets directory.
git clone https://github.com/AndreaCrotti/yasnippet-snippets/
mv yasnippet-snippets/snippets ~/.emacs.d
rm -r yasnippet-snippets/
F.A.Q. & Troubleshooting
A package fails to download / install.
Make sure the package is properly named, use M-x + list-packages to get a list of all the available packages and C-s + the package name to validate. If this doesn't work then I suggest manually cloning the repo into the ~/.emacs.d/elpa folder. EMACS packages are constantly changing, make sure the package giving you trouble is even available in the repos.
Loading a package crashes EMACS during startup. (.emacs is ignored / default EMACS)
This usually means that the package is missing / can't find a SYSTEM dependency. If the package depends on third-party binaries (e.g. tern, indium) double-check the installation path and delete the contents of the ~/.emacs.d/elpa folder so Xenoemacs can refresh the configuration. This is only required if EMACS fails to boot!
The EMACS cursor looks different when running EMACS as a deamon and attaching a client than when running a server per client.
The emacsclient command doesn't start a new frame, it simply inherits the server's. Because EMACS was started as a clientless daemon, it didn't start a
frame in the first place. A potential workaround is to attach the cursor configuration to an non-init hook or call it after the emacsclient is initialized.
What is the project's license? Do I have to pay or credit you in any way?
The project is MIT licensed and free.