According to the official docs, Emacs
is an extensible, customizable,
free/libre text editor - and more. Much more!
At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing.
Reference: Emacs website.
apt
is the package manager available for Ubuntu Linux (Debian based OS). To
install Emacs using this package manager is pretty straigh forward:
sudo apt install emacs
# uninstall with
# sudo apt remove emacs
You can find the Emacs versions in this link.
# download emacs version 29.4
export EMACS_VERSION="29.4"
wget https://ftp.gnu.org/pub/gnu/emacs/emacs-${EMACS_VERSION}.tar.gz
# extract the content
tar xvzf emacs-${EMACS_VERSION}.tar.gz
cd emacs-${EMACS_VERSION}/
./configure
make
sudo make install
- Reference: link.
# download emacs version 28.2
export EMACS_VERSION="28.2"
wget https://ftp.gnu.org/pub/gnu/emacs/emacs-${EMACS_VERSION}.tar.gz
# extract the content
tar xvzf emacs-${EMACS_VERSION}.tar.gz
cd emacs-${EMACS_VERSION}/
./configure
sudo make uninstall
In order to have a more reliable packages configuration, instead of using
package.el
, I decided to use straight.el
: “next-generation, purely
functional package manager for the Emacs hacker”.
One can find the project repository in this link.
Also, there is this cool video from System Crafter regarding this package manager: YouTube link.
In my experience I noticed that the Emacs $PATH is different based on how you
launch it. This is something I still want to research more to understand.
But, as a rule of thumb, to avoid major problems, always launch your Emacs program from a terminal:
emacs&
How I noticed this?
My LSP in general was very bad. Most of things did not work properly, although I
had the necessary stuff installed. Then, I went to the troubleshooting page in
LSP docs and tested my $PATH using M-: (getenv "PATH")
.
Later I compared with the value of echo $PATH
from a terminal window, and for
my surprise they were different. Emacs $PATH was lacking several configurations.
One can leverage the composibility powers of Emacs to create their own custom ELisp configuration and decide to load it in the start up process of Emacs. In order to do it, you can use this function:
(load-file "~/Desktop/codes/custom-emacs/my-cool-script.el")
According to this post, the best way to learn Emacs consists in two things:
- Read blog posts about how other people use Emacs.
- Learning how to read the manual.
Notice that this order is actually controversial.
For newcomers, it is usually easier to start using a pre-built configuration instead of creating one by yourself.
Consider taking a look at those distributions to start your Emacs journey:
- https://prelude.emacsredux.com/en/latest/
- https://www.spacemacs.org/
- https://github.com/rdallasgray/graphene
- https://github.com/doomemacs/doomemacs
Later in this README.org
I cite other cool articles and references. Here I’ll
just store the non-exhaustive links mentioned by Ramin in his article.
- Mickey Peterson - Mastering Emacs
- Sacha Chua - Blog
- David Willson - System Crafters
- Mike Zamansky - Blog
- The Irreal Blog
- Protesilaos Stavrou - Blog
- Karthik Chikmagalur - Blog
C-h i
- open the Info-mode app, which lists a “menu” of all installed manuals.C-h r
- read manual, jumps straight to the Emacs manual table of contents.q
- quit, hides the manual and goes back to where you were before reading the manual.C-h v
- display documentation of variable.C-h f
- display documentation of function.
Those are the points I think are worth knowing, at least in the beginning.
- org-drill reference for running the drill session. This part of the docs is
very good since it explains what each number means and how to run the session
passing the scope to read our drills.
- Before publishing an org-drill deck we should use
org-drill-strip-all-data
to remove personal scheduling data. - This is currently my favorite tool along with
org-mode
.
- Before publishing an org-drill deck we should use
- Emacs and BibTeX
- (Book) Lisp Hackers
- MatthewZMD/.emacs.d
- redguardtoo/mastering-emacs-in-one-year-guide
- Planet Emacslife
- LSP Mode - Language Server Protocol support for Emacs
- daviwil - Emacs From Scratch
- (Book) Writing GNU Emacs Extensions
- Nicolas P. Rougier - Get Things Done with Emacs
- Creating a CV/Resume in Org-Mode using LaTeX Templates
- Fugue - A CEO’s guite to Emacs
- Fugue - Two Years With Emacs as a CEO (and now CTO)
- A Nickel’s Worth - Effective .emacs
- Core Dumped - A vision of multi-threaded Emacs
- Emacs for Professionals
- Stevey’s Blog Rants - Emergency Elisp
- Paul Graham - How to Make Wealth
- Paul Graham - Taste for Makers
- Paul Graham - Beating the Averages
- Paul Graham - Revenge of the Nerds
- C/C++ Development Environment for Emacs
First, you need to run M-x list-packages
, then hit capital “u” (U
), and
finally “x” to execute the update.
There are packages created automatically to do this update for us automatically
(auto-package-update
, for example), but in my case I don’t want to use it,
since I want to have more control over this process.
I found this trick watching this video from System Crafters:
Each kind of editor is an Emacs mode, a chunk of Lisp code that combines Emacs’s primitive types and operations in some new way. Each mode is therefore an extension of Emacs, which means that when you strip away all those modes — when you remove the extensions and you’re left with just the core of Emacs — you don’t have any editors at all; you have the raw materials for making editors. You have an editor-builder.
What can you build with an editor-builder? Editors, of course, but what’s an editor? An editor is a program for viewing and altering a representation of data of some kind. By “representation” I mean a set of rules for showing the data’s structure and content, and for indicating naturally how interactions with the data are supposed to proceed. When editing a text file, the rules are pretty simple: each printable byte gets displayed in sequence, with newline characters causing line breaks; and a cursor indicates where in the byte sequence the next user-invoked operation will occur. When editing a directory, the metaphor is a little less straightforward—data in the directory file must first be translated into a human-readable form—but the resulting interactions still seem natural.
— (Book) Writing GNU Emacs Extensions
Since Emacs could be configured using Elisp it is totally useful to learn this programming language in order to create new functionalities or even get more familiar with this tool.
In order to learn this I’m currently using this reference: (Book) Introduction to programming in Emacs Lisp.
After finishing this first book, I plan to read Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp.
There is also this reference for GNU Emacs extensions (written in 1997 btw): Writing GNU Emacs Extensions.
If you’d like to jump into exercises, check this Exercism track.
In this section I’m going to add some links for useful resources that can help you in this journey.
- Emacs Lisp code style guide
- My submissions in the Exercism Emacs Lisp track: link
About the project structure (along with some comments):