summaryrefslogtreecommitdiff
path: root/content-org/cool-emacs.org
diff options
context:
space:
mode:
authormms <michal@sapka.me>2024-06-17 20:16:21 +0200
committermms <michal@sapka.me>2024-06-17 20:16:21 +0200
commit46ec6e03d79584366a1e269f15ebe4da1f50f7dc (patch)
treec0d75474af281aab8da6fa941f3f9835a0853b6b /content-org/cool-emacs.org
parent874c77e2f875d348afc70b5dd78750f4558f8849 (diff)
feat: coolmacs
Diffstat (limited to 'content-org/cool-emacs.org')
-rw-r--r--content-org/cool-emacs.org112
1 files changed, 105 insertions, 7 deletions
diff --git a/content-org/cool-emacs.org b/content-org/cool-emacs.org
index d34ab7a..3d165e8 100644
--- a/content-org/cool-emacs.org
+++ b/content-org/cool-emacs.org
@@ -22,6 +22,14 @@ CLOSED: [2024-06-15 Sat 21:52]
:EXPORT_HUGO_MENU: :menu emacs :post "Emacs usage that is not text editing"
:END:
+#+attr_shortcode: :file cool-macs.png
+#+attr_shortcode: :alt An Emacs logo in cool glassess doing a skateboard flip
+#+attr_shortcode: :class right no-border
+#+attr_shortcode: :forced_width 350
+#+begin_image
+noop
+#+end_image
+
#+begin_quote
/Let me tell you: Emacs is not a text editor./
@@ -32,6 +40,7 @@ Even though most of what Emacs is known for is /editing text/, it can do so much
It's the most flexible application out there, so when you start to adjust the basics for yourself, you want to use it everywhere.
Here, I will present /Emacs/ as a general purpose interface.
+
*** Cool ways to use Emacs
#+attr_shortcode: "cool-emacs-ways"
@@ -46,6 +55,9 @@ Dune
Dune
#+end_menu
+*** Coolmacs
+
+The mascot, Coolmacs, was drawn by [[https://drewsh.com/][Drew]].
** Ways
:PROPERTIES:
:EXPORT_HUGO_MENU: :menu cool-emacs-ways
@@ -78,7 +90,7 @@ Emacs is a GUI application, so all images are present in their glory!
#+attr_shortcode: :alt An Emacs screenshot showing a list using a dark mode
#+attr_shortcode: :class centered
#+begin_image
-List of artucles
+List of articles
#+end_image
#+attr_shortcode: :file elfeed-details.png
@@ -652,15 +664,101 @@ Pavel Korytov writes in his [[https://sqrtminusone.xyz/posts/2023-04-13-emacs/][
So over time, Emacs has become my programming environment, email client, window manager, knowledge base, and a lot more. I think I ended up using Emacs for almost as many things as possible;
#+END_QUOTE
-This is where I want to be in the near future. So far I've moved my development environment and email to Emacs. Next up are notes, RSS reading, and music listening.
+This is where I want to be in the near future.
+So far I've moved my development environment and email to Emacs.
+Next up are notes, RSS reading, and music listening.
-What I love about Emacs is the consistency between modes/packages. They accomplish widely different things, but the general control scheme is the same. It's great since all TUI programs I use tend to support Vim's way of doing things. Having it all inside Emacs changes the dynamic. I'm trying to think of Emacs as a shell rather than an editor.
+What I love about Emacs is the consistency between modes/packages.
+They accomplish widely different things, but the general control scheme is the same.
+It's great since all TUI programs I use tend to support Vim's way of doing things.
+Having it all inside Emacs changes the dynamic.
+I'm trying to think of Emacs as a shell rather than an editor.
-What Emacs really is, is a virtual machine running LISP code. Some say that Emacs violates Linux philosophy. I don't see it this way. Does shell violate it? It's also a way to run different programs. Emacs is an abstraction over real shell which adds some calm to it. It's a way to have an interactive layer over OS... which also does text editing.
+What Emacs really is, is a virtual machine running LISP code.
+Some say that Emacs violates Linux philosophy.
+I don't see it this way.
+Does shell violate it?
+It's also a way to run different programs.
+Emacs is an abstraction over real shell which adds some calm to it.
+It's a way to have an interactive layer over OS... which also does text editing.
So, when you look at it this way, Emacs makes a lot of sense:
-- It runs programs. Bigger packages, like Magit, are nothing short of real programs.
-- It's scriptable. Elisp all the way!
+- It runs programs.
+ Bigger packages, like Magit, are nothing short of real programs.
+- It's scriptable.
+ Elisp all the way!
- It allows for interoperability between programs.
-- It runs above basic OS. You can replace your window manager with Emacs, but you need some sort of kernel.
+- It runs above basic OS.
+ You can replace your window manager with Emacs, but you need some sort of kernel.
- You can live entirely inside Emacs, just like you can live entirely inside a terminal.
+
+*** DONE Multi process Emacs environment
+CLOSED: [2024-06-17 Mon 17:46]
+:PROPERTIES:
+:EXPORT_FILE_NAME: multi-process-emacs
+:EXPORT_HUGO_CUSTOM_FRONT_MATTER+: :abstract Running dedicated Emacs processes
+:END:
+
+The more you move into Emacs, the happier you may become.
+But at the same time, Emacs is not a *real* shell, but a text editor.
+This means there is no real way to manage functionality in a similiar way one would manage applications.
+It's all a buffer - the file you opened, each IRC channel, email list, and so on.
+There are ways to manage it, like dedicated "workspace" plugins[fn:perspective] or simple tabs.
+But all those don't fit my mental model.
+I am "Editing a file" or "chatting" or "writing a webpage".
+Those are separate concerns, so I want to have dedicated spaces for them.
+
+At the same time I want them in emacs, as it gives me a unified interface.
+I don't need to think how to change IRC channel, how to spell check, or how to actually write in my selected keybindings.
+
+**** Dedicated Emacs instances
+
+This lead me to use multiple, dedicated Emacs instances.
+This way, I've a got a dedicated IRC client, Code editor, Notepad, Email client, and so on.
+I have unified interace, but at the same time it's still akin to dedicated programs.
+
+This has the addeed benefit of fault protection.
+Tramp session hunging entire Emacs doesn't disconnect me from IRC, as those are separate processes.
+
+Therefore, I have functions which I call /ultimate modes/[fn:music] to configure Emacs for given usecase.
+
+A simple ultimate mode for IRC would look like:
+
+#+begin_src emacs-lisp
+ (defun mms-irc-mode()
+ "use this instance of Emacs for IRC"
+ (interactive)
+
+ (load-theme 'ef-bio)
+
+ (erc-tls :server "irc.tilde.chat" :port "6697"
+ :nick "mms" :full-name "https://michal.sapka.me")
+ (erc-tls :server "irc.libera.chat" :port "6697"
+ :nick "mms" :full-name "https://michal.sapka.me")
+ )
+#+end_src
+
+
+This simple fuction:
+- loads a dedicated theme, so I won't get lost. IRC is a happy palce, therefore green.
+- connects me to my servers
+
+ERC is configured elsewhere, so all auto-joins are there, just redacted, but nothing limits the number of things the ultimate mode setup up.
+Want to defer loading of bigger package?
+Want to preconfigure ispell language?
+Or maybe you want to load parts of Emacs configurations only when they make sense?
+Shy is the limit!
+
+Now, I can eiter run =emacs= and call =mms-irc-mode= or have a dedicated OS level key binding to run emacs in this mode via:
+
+#+begin_src shell
+emacs --eval='(mms-irc-mode)'
+#+end_src
+
+This method could easily be expanded to run dedicated =emacs servers= and connected clients, but I wanted a simplier way.
+
+[fn:perspective] Like [[https://github.com/nex3/perspective-el][perspective.el]]
+[fn:music] Yes, it breaks the musical theory naming scheme.
+I could have used "tonic" there to run the =erc= and pla play with the wordplay, bit I decided aganist it.
+Damnit Jim, I'm an engineer, not a musican!
+Also, diatonic modes don't fit the "larger than major" mode.