Emacs as 21stC interdisciplinary tool
Once upon a time, I dealt with losing work on the book I am still writing that was written in Scrivener that was lost, as incompatible, when I switched to a LinuxOS. In researching what other tools were available, I found Emacs and fell in love with it immediately because its “swiss army knife” capabilities match what I expect in a dream tool. This is a general post explaining how Emacs turns out to be directly related to my distant epistemic domains of inquiry, why it is that I prefer mostly to explore what Emacs has within it before using apps, and link to a really great online book about Emacs. Note: This post is being filed as In progress because it could be improved and clarified/corrected; I welcome feedback.
- Emacs’ interdisciplinarity
- Emacs’ built-in potential
- Link to an Emacs book
Emacs’ interdisciplinarity topThis section gives a process-based account of how I discovered Emacs’ interdisciplinarity. I fell in love with Emacs’ built-in range of capabilities, like how Org-mode allowed me to at once keep an outline and unfoldable full text of my book, make tables that would calculate student grades, and even generate mind maps. More theoretically, as I am writing a book that addresses “re-presencing the digital trace” (which is its working title), about how a phenomenological/hermeneutic approach to what I’ll shorthand as digital cultural studies can lead to generative, co-creative insights, I have felt a need to try to do some research into digital tech from the inside out.
Not all digital studies require this and my background did not prepare me for this, but for my students’ sake, I feel I need to do the best I can to continue to learn how to learn. I could not have done this without what I learn from Emacs.
Firstly, the option to personalize Emacs through the initialization file means that one is almost immediately exposed to seeing Emacs Lisp, or ELisp. Emacs does not hide the code from users/co-creators!
I still don’t know how to write ELisp myself, but I can cope with assembling snippets to my liking. Additionally, using Emacs reveals to the user the “Emacs philosophy” which promotes the specialization, customization, extension, and reuse of patterns, which I discussed in my EmacsConf 2021 talk. I think what is relevant here is that even to a “greenhorn hacker”, the philosophy is apparent – but perhaps to see it, one has to be a ‘certain kind of thinker’.
In trying to understand something about digital technology from the inside out, I went with “my gut”, which in hermeneutics is related to pattern recognition. That is to say, to recognize a pattern, one has to have already internalized part of that pattern. I had done this through even rudimentary use of Emacs. I exposed myself to thousands of texts written by programmers, and one thing I kept noticing were patterns of recursion. I don’t know if I should also note that from the very beginning, I was fascinated by esolangs even though I didn’t know why since I don’t understand programming. What comes next will not surprise proficient hackers.
It was upon reading Shriram Krishnamurthi’s Papers We Love talk that I realized that the recursion I was seeing everywhere was related to programming’s roots in lamda calculus. A very rough draft of this discovery is in this other post – I wanted to post this first before I forget my related thoughts. For those who do not know who Krishnamurthi is, he is part of the Programming By Design team who are trying to make programming concepts part of the Liberal Arts education. They use Racket, a Lisp language, to do this.
Lambda calculus is at the heart of the ELisp we love. For example, while Dana Scott’s “then and now” overview of lambda calculus does not mention ELisp, it gives us an idea of the significance of Lisp languages. As such, it can be related to the following fields that I work in: epistemic fluency (as a mathematics concept can be related to both programming and linguistics), ontology (as lambda calculus can be considered foundational to mathematics), philosophy (not just of programming languages, but by expanding the discourse to include mathematics, there are now clearer lines between philosophy and mathematics, e.g. by way of Alexander North Whitehead), cognition (I am most interested in how this relates back to Plato’s Meno, because I personally experienced through Emacs philosophy a direct path opening back to maths), pedagogy (ditto), and linguistics (e.g. through the overlap with Chomsky’s work). I should perhaps add a disclaimer that I don’t know that my book will go into all of this, but it is very important for me to try to clearly establish in my mind a general background.
Even someone like me who knows next to nothing about coding recognized in ELisp the importance of nesting or S expressions, or the significance of how Emacs can handle multiple languages in code blocks, for example. This is all made more intelligible by lambda calculus.
Emacs’ built-in potential topWe have seen above that Emacs can handle all kinds of code. It can do so much without added applications and while I use it for extensive note-taking, I still haven’t made the switch to Org-Roam because I am still exploring the built-in features of hyperlinks, tags, and bookmarks. This is also why I have not been posting about Emacs much lately, as I am still figuring out the workflow that works best for me. In this section, I will illustrate this further through Emacs’ ability to work with .sql files, departing from an anecdote. Most importantly, Emacs has a sql-mode, and I will end this section with the resources I read.
I had a long-offline .sql file which I am writing like that because I wasn’t sure if it was MySQL or MariaDB, or something else. I tried to convert it to Sqlite, but the conversion did not work. It could be that the file is corrupt. I reached out for help, and Alex recommended that I either create a separate file containing only CREATE TABLE statements and pare them down until .table would list them, or just look at the INSERT statements and write a new CREATE TABLE so that l I could just run a SQL file containing all the INSERT statements. This help worked like magic to get me out of the mindset that I needed to continue to work with the file in sql-mode: since Emacs can do all kinds of things, and since I am using the data in the file to contribute to a totally new file (my book), I could take a different approach. So I copy-pasted the text into an org file, and cleaned it up a little. I am now tweaking the workflow, experimenting with icicles, grep, and bookmark tags – because the file is enormous, and I don’t want all of it, but a selection of the best parts of it. In exploring how Emacs can help me, I am using the built-in manual, at M-x info RET.
There is also a philosophical reason for even professional programmers to be exploring what in-built Emacs features. I found the following quote in the book I will write about below:
One of the gravest problems I see for the future of Emacs development is that we slowly but steadily lose old-timers who know a lot about the Emacs internals and have lots of experience hacking them, whereas the (welcome) newcomers mostly prefer working on application-level code in Lisp. If this tendency continues, we will soon lose the ability to make deep infrastructure changes, i.e. will be unable to add new features that need non-trivial changes on the C level. — Eli Zaretskii in Re: [PATCH] Add prettify symbols to python-mode (2015)
Some of the resources I consulted include: this really helpful basic intro to sql-mode with screenshots; examples of how to incorporate this functionality with a literate programming workflow: on Emacs as literate database, on using Emacs as database client; a charming account of using this mode in a bakery that you may remember as it went viral; posts on tweaking the init to better accommodate a Sqlmode workflow: Emacs redux also addressing Emacs as database client, John Coder on using Emacs with Postgres; other posts on relevant workflows: SQL in org-mode, Mastering Emacs on multiple major modes and using sql python in one buffer, experience with emacs as sql client. I do have one question, though, does the Emacs Wiki SQL page need updating?
Link to an Emacs book topThat Emacs is a philosophy or a mindset that promotes not just the specialization, customization, extension, and reuse of patterns within it but also extending these patterns beyond it for an inquisitive, dialogic experience of life can be demonstrated by Murilo Pereira’s digital book (I call it a book for its suggestiveness; it currently fits on a single web page), How To Open A File In Emacs. I trust that sentence, in the context of this post, is enough to recommend it!
It is amazing to be part of this community and I continue to be amazed, what with all the hard-won knowledge – much of which emerges through volunteer work, at how welcoming it is to people like me who come to it knowing nothing or next to nothing about programming. If this post has done its job, it shows how profoundly Emacs can be as a tool to augment learning, to invoke Douglas Engelbart, and end with an ellipsis that invites you to continue the thought in your own way . . .
Special thanks to Sacha Chua, Amin Bandali, Alex Schroeder, Andrea, and Emacs’ developers, maintainers, contributors, and community.
- In progress