diff options
author | mms <michal@sapka.me> | 2024-06-17 20:16:21 +0200 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-06-17 20:16:21 +0200 |
commit | 46ec6e03d79584366a1e269f15ebe4da1f50f7dc (patch) | |
tree | c0d75474af281aab8da6fa941f3f9835a0853b6b | |
parent | 874c77e2f875d348afc70b5dd78750f4558f8849 (diff) |
feat: coolmacs
-rw-r--r-- | assets/cool-emacs/cool-macs.png | bin | 0 -> 791136 bytes | |||
-rw-r--r-- | assets/cool-emacs/header-rect.png | bin | 0 -> 794932 bytes | |||
-rw-r--r-- | content-org/cool-emacs.org | 112 | ||||
-rw-r--r-- | content/cool-emacs/_index.md | 9 | ||||
-rw-r--r-- | content/cool-emacs/reading-rss-elfeed.md | 2 | ||||
-rw-r--r-- | layouts/cool-emacs/baseof.html | 10 | ||||
-rw-r--r-- | layouts/shortcodes/image.html | 6 |
7 files changed, 130 insertions, 9 deletions
diff --git a/assets/cool-emacs/cool-macs.png b/assets/cool-emacs/cool-macs.png Binary files differnew file mode 100644 index 0000000..b754bcd --- /dev/null +++ b/assets/cool-emacs/cool-macs.png diff --git a/assets/cool-emacs/header-rect.png b/assets/cool-emacs/header-rect.png Binary files differnew file mode 100644 index 0000000..aa1f923 --- /dev/null +++ b/assets/cool-emacs/header-rect.png 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. diff --git a/content/cool-emacs/_index.md b/content/cool-emacs/_index.md index a973284..de195f5 100644 --- a/content/cool-emacs/_index.md +++ b/content/cool-emacs/_index.md @@ -16,6 +16,10 @@ shortname = "Cool usages of Emacs" post = "Emacs usage that is not text editing" +++ +{{< image forced_width="350" class="right no-border" alt="An Emacs logo in cool glassess doing a skateboard flip" file="cool-macs.png" >}} +noop +{{< /image >}} + > _Let me tell you: Emacs is not a text editor._ > > -- Emerald McS., PhD @@ -37,3 +41,8 @@ Dune {{< menu "cool-emacs-appendix" >}} Dune {{< /menu >}} + + +## Coolmacs {#coolmacs} + +The mascot, Coolmacs, was drawn by [Drew](https://drewsh.com/). diff --git a/content/cool-emacs/reading-rss-elfeed.md b/content/cool-emacs/reading-rss-elfeed.md index 9bed359..550b8ab 100644 --- a/content/cool-emacs/reading-rss-elfeed.md +++ b/content/cool-emacs/reading-rss-elfeed.md @@ -31,7 +31,7 @@ One huge upside of elfeed compared to newsboat is image support. Emacs is a GUI application, so all images are present in their glory! {{< image class="centered" alt="An Emacs screenshot showing a list using a dark mode" file="elfeed-list.png" >}} -List of artucles +List of articles {{< /image >}} {{< image class="centered" alt="An Emacs screenshot showing Elfeed in a dark mode with a vintage PC case in the middle" file="elfeed-details.png" >}} diff --git a/layouts/cool-emacs/baseof.html b/layouts/cool-emacs/baseof.html index 7f2e20b..fecc1c6 100644 --- a/layouts/cool-emacs/baseof.html +++ b/layouts/cool-emacs/baseof.html @@ -7,7 +7,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> - {{- $header_rect := resources.Get "unix-history/header-rect.png" }} + {{- $header_rect := resources.Get "cool-emacs/header-rect.png" }} {{- $header_rect_180 := $header_rect.Resize "180x webp q90"}} <link rel="apple-touch-icon" sizes="180x180" href="{{ $header_rect_180.Permalink }}"> @@ -85,6 +85,7 @@ border-color: var(--heading-color); } + p, ul { line-height: 1.4em; text-align: justify; @@ -115,6 +116,13 @@ font-family: monospace; color: var(--heading-color); } + .no-border img { + border: 0; + } + .right { + float: right; + max-width: 40%; + } </style> diff --git a/layouts/shortcodes/image.html b/layouts/shortcodes/image.html index a03ded6..1bc0619 100644 --- a/layouts/shortcodes/image.html +++ b/layouts/shortcodes/image.html @@ -15,6 +15,12 @@ <!-- Decide on the desired 1x and 2x width --> {{- $raw_width := $img.Width}} {{- $final1x_width := (cond (gt $max_width $raw_width) $raw_width $max_width) }} + +<!-- forced width --> +{{ if .Params.forced_width }} + {{ $final1x_width = cast.ToInt .Params.forced_width }} +{{ end }} + {{- $final2x_width := math.Mul $final1x_width 2}} <!-- Generate 1x and 2x images --> |