Emacs: advanced Org literate configuration

  Рет қаралды 9,113

Protesilaos Stavrou

Protesilaos Stavrou

Күн бұрын

Пікірлер: 56
@hexdump1337
@hexdump1337 Жыл бұрын
Your contributions are always extremely useful, thank you
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@susanpinochet
@susanpinochet Жыл бұрын
I've been thinking about doing this with my emacs configs, but I wasn't sure how to go about it. This is exactly the resource I needed from a source I trust. I will be studying it carefully.
@protesilaos
@protesilaos Жыл бұрын
Very well! Make sure to try it with test files before switching to the real ones. I did it by prefixing "TEST-" to the actual names. I compared the results with what I already had and once I was sure everything was correct, I removed the prefix. Let me know if you need any help.
@auntiecarol
@auntiecarol Жыл бұрын
The youtube algorithm loves comments, so this is mine: - Love the "prot-gruvbox" theme! - Literate configs are great especially for times when you need to write many configs in many different places… one's mbsync config, one's not muchconfig, systemd timers etc all related to mail but in many different places. (And perversely I tangle my vimrc from an org file 😂)
@protesilaos
@protesilaos Жыл бұрын
Good points! I don't know if I will go all the way to make it generate every dotfile, though doing so keep things consistent. The theme is 'ef-melissa-dark' from my 'ef-themes' package ("melissa" means "bee" in Greek): github.com/protesilaos/ef-themes
@auntiecarol
@auntiecarol Жыл бұрын
@@protesilaos Nix or Guix people would prove me wrong, but it seems feasible that one could set up a whole system configuration file in org. Tangle the whole damned environment! (I've been drinking, so there's a good chance i am wrong)
@protesilaos
@protesilaos Жыл бұрын
@@auntiecarol Well, I have not been drinking and am inclined to agree. Haha!
@goparism
@goparism Жыл бұрын
Absolutely amazing content as always. Didn't think of tangling.
@protesilaos
@protesilaos Жыл бұрын
You are welcome! Tangling is a neat feature for such a case.
@LucaCanali
@LucaCanali Жыл бұрын
Another really awesome contributes ... thank you so much !!! 💪
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@BrenSmith
@BrenSmith Жыл бұрын
Amazing, I *always* learn so much watching your videos. Thanks Prot!
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@qu4ku
@qu4ku Жыл бұрын
also, displaying keybindings with description on the bottom was a great idea.
@protesilaos
@protesilaos Жыл бұрын
This is done by the 'keycast' package. I like it!
@fernseed
@fernseed Жыл бұрын
Very nice! As someone who has explored your dotfiles directory hierarchy --- and taken plenty of inspiration from it --- I find this format much more approachable. And the new descriptions that you've written so far are surprisingly thorough. I've also been experimenting lately with structuring my init files in a more high-level way (albeit with Guix/Scheme instead of Org), and I find that it ultimately ends up improving "code excellence" by forcing us to be more deliberate in design choices, cut out unnecessary stuff, etc. I look forward to reading more.
@protesilaos
@protesilaos Жыл бұрын
Good point about code excellence! It is what I think is happening in my case as well. How is Guix working for you on this front? I get the sense it has lots of potential.
@fernseed
@fernseed Жыл бұрын
​@@protesilaos Yes, the potential of Guix is mostly untapped. I'm to a point where all of my Emacs configuration is done in a single Scheme file (including custom building Emacs itself and installing all packages from source repos). All Elisp that is "configuration", as opposed to something that belongs in its own package, is generated from a list of Scheme objects that hold configuration data for each package --- so, e.g., you could switch from generating Elisp with `prot-emacs-package' macros to `use-package' by plugging in a new translator function. Perhaps extreme, but it has certainly improved my Emacs experience in unexpected ways!
@maxreuv
@maxreuv Жыл бұрын
Excellent, I should certainly try this approach! Thank you!
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@lovelovelove6816
@lovelovelove6816 Жыл бұрын
Great video! btw. if it makes sense to you, you could also define the target file for tangling for a whole subtree, so you wouldn't have to repeat the statement for every code-block. Example from my config: * UI (ui.el) :PROPERTIES: :header-args:emacs-lisp: :tangle (expand-file-name "ui.el" mylisp-directory) :END: in this way, all code blocks within this subtree will be tangled in ui.el
@ricardonunes709
@ricardonunes709 Жыл бұрын
another great video, thanks Prot. been thinking doing that with my dotfiles, but i had doubts about how to do it :D till now... i think
@protesilaos
@protesilaos Жыл бұрын
You are welcome! Try to tangle to demo files, like what I did in the video. Before switching to this setup, I prefixed each file with "TEST-". I then compared the tangled "TEST-" files with the ones I had and confirmed there were no differences. Then I simply removed the prefix.
@antoniocorbibellot6532
@antoniocorbibellot6532 Жыл бұрын
@@protesilaos I'm using option "--init-directory" to change temporarily the directory where emacs searches for init files and it seems to work.
@protesilaos
@protesilaos Жыл бұрын
@@antoniocorbibellot6532 Very well!
@gnu-lynx2501
@gnu-lynx2501 Жыл бұрын
refreshingly based editor macros and literate programming
@protesilaos
@protesilaos Жыл бұрын
Thank you!
@HarishNarayanan
@HarishNarayanan Жыл бұрын
No problem, no stress
@protesilaos
@protesilaos Жыл бұрын
A phrase I use frequently, haha!
@HarishNarayanan
@HarishNarayanan Жыл бұрын
@@protesilaosI love it. Thank you for all that you do.
@protesilaos
@protesilaos Жыл бұрын
@HarishNarayanan You are welcome!
@johnhammer8668
@johnhammer8668 Жыл бұрын
Thanks very much Prot.
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@0netom
@0netom Жыл бұрын
Perfection!
@protesilaos
@protesilaos Жыл бұрын
Thanks!
@alexandrewaechter7585
@alexandrewaechter7585 9 ай бұрын
Hello Prot. Once again thanks a lot for the video and the exaplanations. Wonderful, great methodology. I was wondering how to document my init file, at least for me for the moment, but your method looks perfect. I have already switched. I'm just wondering how to deal with automatically added code by emacs, but it's may be just a beginner problem. Take Care.
@protesilaos
@protesilaos 9 ай бұрын
You can put the automatically added code in another file, known as the 'custom-file', by simply defining a path to that file. Then load that file from your configuration: load it at the start, if you want to potentially override it later, or at the end to not override it. To set this up, check the following code: ;; Let the `custom-file' to a file called "custom.el" inside of the ;; user's Emacs directory, whichever that is. (setq custom-file (locate-user-emacs-file "custom.el")) ;; Try to load the `custom-file'. Do not produce an error if the file ;; is missing: just ignore it (so we do not have an error while ;; starting up). (load custom-file :no-error)
@alexandrewaechter7585
@alexandrewaechter7585 9 ай бұрын
@@protesilaos oh great, thank you for you reply. I will try that.
@__-oe6wn
@__-oe6wn Жыл бұрын
good to know to use :tangle to dump source code from org-mdoe to external file system. 2. happy to learn C-c C-v C-d technique. Question: why you don't use default ID? I really like this idea. I will use the concept in my Workflow
@protesilaos
@protesilaos Жыл бұрын
I don't remember why I stopped using the default ID. I think it has to do with the HTML export, which was not producing the desired internal links. I must check the code again.
@sus4793
@sus4793 Жыл бұрын
You somehow managed to make a better looking Emacs than Doom Emacs ;)
@JonnyAlexander3
@JonnyAlexander3 Жыл бұрын
What is the difference in startup time from not using org-babel-load-file?
@protesilaos
@protesilaos Жыл бұрын
I don't remember the exact values, but the old method felt considerably slower.
@antoniocorbibellot6532
@antoniocorbibellot6532 Жыл бұрын
Hi Prot! Very useful video, thx! Would it be useful for you the "#+auto_tangle: t" property? With it in your file, you only have to save the file and it tangles all the blocks automagically.
@protesilaos
@protesilaos Жыл бұрын
I have not tried it in earnest but I will check. Thank you!
@antoniocorbibellot6532
@antoniocorbibellot6532 Жыл бұрын
@@protesilaos Hi Prot! I forgot to say that it dependes on package "org-auto-tangle", hope this helps you.
@cliosport1374
@cliosport1374 Жыл бұрын
Thanks a lot!!! 👍👍👍
@protesilaos
@protesilaos Жыл бұрын
You are welcome!
@rashie
@rashie Жыл бұрын
👍👍
@protesilaos
@protesilaos Жыл бұрын
Thanks!
@giorgosK936
@giorgosK936 7 ай бұрын
high iq setup
Emacs: multilingual editing (Greek, French, Chinese, etc.)
11:00
Protesilaos Stavrou
Рет қаралды 2,9 М.
Emacs: organise your init file (outline-minor-mode or Org literate config)
24:53
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Emacs: completion framework (Embark,Consult,Orderless,etc.)
46:58
Protesilaos Stavrou
Рет қаралды 16 М.
Emacs: define  prefix/leader key (nested key maps)
23:18
Protesilaos Stavrou
Рет қаралды 3,9 М.
The 6 Emacs Settings Every User Should Consider
15:41
System Crafters
Рет қаралды 38 М.
Emacs 30 Built-in Completion UI & Styles Overview
5:14
Thanos Apollo
Рет қаралды 997
Emacs: Org todo and agenda basics
45:28
Protesilaos Stavrou
Рет қаралды 3 М.
C++ Super Optimization: 1000X Faster
15:33
Dave's Garage
Рет қаралды 334 М.
Emacs: control where buffers are displayed (the 'display-buffer-alist')
29:52
Configuring Emacs on My New Laptop
2:00:09
Tsoding Daily
Рет қаралды 107 М.
Consistent Technical Documents Using Emacs and Org Mode
22:43
ThePrimeagen On Running Linux
9:40
Tech Over Tea
Рет қаралды 302 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН