# Where parallels cross

Interesting bits of life

# Mastering Emacs is a slow process: an archeological tour of my (archived) beginnings

If you are reading this, I guess you may be on your way to Emacs enlightenment.

Here I want to give you an (archaeological) taste of how I started with it. I hope that this will give you also a sense of how long it took me to get comfortable with this amazing tool 1. Ideally, new users that read this will feel comfortable even if, after some months of struggling, they have not yet tamed Emacs: as all the best things in life, learning Emacs takes time and dedication.

I started using Emacs towards the end of 2013, the beginning of my Ph.D. There must be a strong connection between academia's need to publish elegant scientific work (i.e., LaTex) and the adoption of Emacs 2.

Anyway, I know that I started roughly then because the oldest Org Archive entry I could find is the following:

* DONE Buy Christmas return ticket <2013-11-09 Sat>
:PROPERTIES:
:ARCHIVE_TIME: 2016-03-25 Fri 14:41
:ARCHIVE_OLPATH: Daily Stuff
:ARCHIVE_TODO: DONE
:END:


Something interesting is that my first archived note tells us what I was using before Org Mode for my calendar: when by Benjamin Crowell 3. You can guess that from the directory in which I was storing my main Org file.

This reminded me how powerful is to archive your tasks for later memory.

I guess by that point I already familiarized with the basic Emacs editing commands: cancelling an action C-g, undoing an edit C-/, killing C-w and yanking text C-y (i.e., copy/pasting), visit files C-x C-f, and load modes specific to programming languages via the init file (I was writing Bash, Java, Haskell, C#, OCaml, Python and Scala during my studies).

I guess Erc, Emacs' IRC mode, entered my life a year after, when I took note of a chat important for my research:

* DONE have chat with IRC ocaml <2014-10-22 Wed>
:PROPERTIES:
:ARCHIVE_TIME: 2016-03-25 Fri 14:40
:ARCHIVE_OLPATH: Ph.D.
:ARCHIVE_TODO: DONE
:END:
@@@ You have joined channel #ocaml                                      [18:39]
@@@ Topic for #ocaml: Discussions about the OCaml programming language |
http://www.ocaml.org and http://caml.inria.fr |
http://ocaml.org/releases/4.02.0.html | Public channel logs at
http://irclog.whitequark.org/ocaml


Notice how I must have still been unaware of Org source blocks and quotations at that time because I was just pasting the raw chat under the heading as a way to log things.

The outcome of a Ph.D. is, mainly, the final thesis, so I started writing my research down in a Org file early on. Emacs' gscholar-bibtex helped a lot with managing references for my LaTex bibliography:

* add gscholar extension to emacs to get bibtex info directly in emacs <2015-11-03 Tue>
:PROPERTIES:
:ARCHIVE_TIME: 2016-03-25 Fri 14:39
:ARCHIVE_OLPATH: On the fly
:END:
use M-x gscholar-bibtex



Today, if you need a bibliography, you should surely look also into org-ref.

I guess 2016 was the turning point for my customization of Emacs. I started using org-contacts for keeping track of birthdays and I finally found the need for Org Archive (all the entries I found were archived on that year).

Immediately after that came the installation of magit and wdired:

* DONE [#B] check out magit and wdired mode for emacs <2016-01-24 Sun>
CLOSED: [2016-02-20 Sat 22:52]
:PROPERTIES:
:ARCHIVE_TIME: 2016-03-25 Fri 14:39
:ARCHIVE_OLPATH: On the fly
:ARCHIVE_TODO: DONE
:END:
- [X] magit
https://www.emacswiki.org/emacs/Magit

| Keys | Effect in Magit mode |
|------+----------------------|
| s    | stage new file       |
| c c  | commit               |
| b b  | change branch        |
| P p  | push changes         |
| F f  | pull changes         |

- [X] dired

after C-f a directory, the dired buffer will open.
Here the commands:

| Keys    | Effect in Dired mode                          |
|---------+-----------------------------------------------|
| m       | marks an entry                                |
| t       | marks all entries that                        |
|         | are not marked, and unmarks those that are    |
| u       | unmarks an entry                              |
| U       | unmarks all entry                             |
| x       | executes command                              |
| C       | copies entry                                  |
| d       | set for deletion                              |
| D       | asks for deletion                             |
| !       | calls shell command on entry                  |
| g       | updates buffer                                |
| * - /   | marks all directories                         |
| A       | search for text                               |
| M - ,   | to see next found results for the text search |
| R       | renames entry                                 |
| S       | changes sorting order of directory            |
| C-x C-q | make buffer editable                          |
| C-c C-c | commit changes to dir - that changes the fs   |
| C-h i   | emacs manual                                  |



Evidently I needed a sweeter and efficient way to both manage Git repositories and modify my file system contents swiftly. Note how I was taking notes of keybindings cheatsheets as Org tables: it really takes time for muscle memory to kick in!

My big challenge as a new Emacs user, which I can still remember with uneasiness, was to setup mu4e to read my emails:

* DONE switch to mu4e as email client                        :emacs
CLOSED: [2016-03-02 Wed 22:18]
:PROPERTIES:
:ARCHIVE_TIME: 2016-03-25 Fri 14:39
:ARCHIVE_OLPATH: On the fly
:ARCHIVE_TODO: DONE
:END:
** THE REASON: Mozilla does not maintain Thunderbird anymore
and the plugin to increase the font ceases to work (blind me!)
** DONE STEP 1: gather information
** DONE STEP 2: OMG, let's install this!
*** DONE understand how to fetch mails
CLOSED: [2016-03-01 Tue 09:28]
**** offlineimap [5/5]
*** DONE understand how to use smtpmail [4/4]
CLOSED: [2016-02-29 Mon 23:27]
- Note taken on [2016-02-29 Mon 23:27] \\
< C-x m > to send an email
*** DONE install mu (if we get to this victory near :D)
CLOSED: [2016-03-01 Tue 10:14]
** DONE STEP 3: now read manual LOL
CLOSED: [2016-03-02 Wed 22:18]
#+BEGIN_SRC sh :results output silent
wget -P /tmp/ https://github.com/djcb/mu-releases/raw/master/mu4e-0.9.16.pdf;
evince /tmp/mu4e-0.9.16.pdf;
#+END_SRC


It felt difficult because I needed to integrate multiple pieces of software while still being a bit uncomfortable with how configuring Emacs itself.

Again it is funny to discover that I had an actual reason to start managing emails from within Emacs other than being a geek: at that time Mozilla ended maintenance for Thunderbird, my previous preferred email client.

Few months later I learned how to maintain my Emacs configuration as an Org Mode file by copying Daniel Mai's approach.

* DONE move to org and use-package
SCHEDULED:<2016-06-21 Tue>
:PROPERTIES:
:ARCHIVE_TIME: 2016-06-21 Tue 01:06
:ARCHIVE_OLPATH: Daily Stuff
:ARCHIVE_TODO: DONE
:END:


More importantly I started using use-package for my dependencies. At that time I introduced use-package mainly because of its clean syntax. Only much later I learned how to use it to load packages lazily and instrument my configuration to find out initialization problems. By the way, that time must have also been when I started preferring the SCHEDULED timestamp format to Org raw dates.

From then on I started installing programming environments within Emacs, like Ensime, Tuareg and Cider. I also bugged a significant amount of times Pandoc's maintainers to support all the features I needed to export my thesis written in Org Mode via the amazing ox-pandoc.

All in all, Emacs was a majestic investment: I basically literate-programmed away my Ph.D. activities via Org Mode and completed the numerous todos with all the extensions Emacs support.

If you are a new user, a possible checklist to familiarize with Emacs is:

1. learn the basics keybindings with the Emacs tutorial C-h t
2. start using Org Mode to keep track of your todos
3. explore how to extend your Emacs to fulfill your needs, where good resources for this are

Again I wish my beginnings (about 3 years actually!) with Emacs let you get that learning this tool is a process. So no rush and enjoy each struggle (and get in touch with the lovely community please)!

Happy enlightening!

## Footnotes:

1

It will take longer or shorter for you, it does not matter: is a joy not a challenge, so take all the time you need.

2

Later I found out even my mother used Emacs for composing her dissertation, but she moved on as soon as she typed the last dissertation character.

3

When is a minimal tool to keep track of your calendar, and, until now, I totally forgot about it.