reddit / emacs
Sharing (yet another) Emacs config
rpanadestein · 2022-10-19 09:24
Hey guys, feel free to take a look at my Emacs config, any feedback is welcome.
[https://panadestein.github.io/emacsd/](https://panadestein.github.io/emacsd/)
deaddyfreddy · 2022-10-19 10:30
- why do you use hooks to set mode-related customs? They become global anyway.
- you can replace `global-set-key` with `:bind` as well (nothing bad with the former, just to make things more consistent)
- `setq` is mostly replaceable with `:custom`
rpanadestein · 2022-10-19 10:37
Thanks for the feedback! I will try to improve that.
Agling · 2022-10-19 17:21
I always love reading other people's config files. Never know when you find a great nugget.
This may be the *most* literate config file I've ever read. I've been resisting the urge to go this direction for some time, but I think I'm going to have to do it--for one thing I want to make sure I don't forget why I put certain items in. Thanks for sharing the deets on how you implemented it.
holgerschurig · 2022-10-20 05:28
I used to have a literate, but then several things made me go away from that:
* untangling at start was slow. I wrote my own untangler, simpler and much faster, but it was still slow.
* getting a syntax error + backtrace and the first goto-char to the character offset, identifying the location, going into the .org then to fix it (all with a possibly half broken Emacs config) is not fun.
* I always wondered "why the hassle", who's going yo read it? I published back then my .org files several times,snd put the HTML on my home page. Never got feedback.
So, eventually I de-literate-ed my config. I use comments there, e.g. around line 500. Also structured it so that I can go to sections easily with imenu (or consult-imenu). In some sections I have URLs or hints, should something escape me.
https://github.com/holgerschurig/emacs-doom-config/blob/master/config.el
Agling · 2022-10-20 05:42
Very reasonable concerns. I kind of spent the evening making my init literate. Some people tangle it every time emacs starts up. I don't do that. I keep it in my git directory and any time I update it, I do a tangle manually when I'm done. It automatically overwrites my init.el and replaces it with an updated, but equally non-literate, version.
I actually don't expect to publish my init, ever, but I feel more comfortable leaving long comments and explanations (to my future self) in my org file (not to mention tables of bindings I want to remember). Easier to read and find in the final, rendered, html. As I've done this, I've made it a lot more organized--poor organization shows up very obviously in the html index.
Of course, you can do all that stuff without org. Actually, I'm kind of embarrassed to say this is my first time using org mode, so it was a learning project for me. Until now, I just haven't been able to figure out any reason to use org mode. I use markdown a lot, but I don't use emacs for todo lists or presentations or any of the other things I see people using it for. Yet.
Appreciate you posting your init. I don't know that I will have any useful feedback, but I hope to pick up some nuggets!
rpanadestein · 2022-10-20 09:26
Thanks a lot for reading my config! I am happy if you find some useful snippets there :)
rpanadestein · 2022-10-20 10:17
Thanks for your comment. I tend to disagree regarding literate configurations. Here is my rebuttal:
>untangling at start was slow. I wrote my own untangler, simpler and much faster, but it was still slow.
As I explain in the config, I use NixOS with home-manager. I trigger a tangling script every time I rebuild my system, and there is a change in the GitHub repo. Plus, I use emacsclient, so it only happens once.
>getting a syntax error + backtrace and the first goto-char to thecharacter offset, identifying the location, going into the .org then tofix it (all with a possibly half broken Emacs config) is not fun.
Not an issue anymore, provided my answer to the previous point.
>I always wondered "why the hassle", who's going yo read it? I publishedback then my .org files several times,snd put the HTML on my home page.Never got feedback.
Well, some people in this Reddit did read it after I published it :) It is very useful for me to remember things, and it comes very handy if I want to convert one of my colleagues that use a different text editor to Emacs.
ZZhanChi · 2022-10-21 10:05
Here is my take on auto-tangling: [Config | Applying Changes](https://github.com/KaratasFurkan/.emacs.d#applying-changes)
When you edit and save the literate config file, it automatically fires an async process to tangle itself to an elisp file. So you can use that elisp file on init and don't worry about slowness. Only downside is it doesn't work if you edit the file with another text editor, which I never do :)
And here is my init.el: [init.el](https://github.com/KaratasFurkan/.emacs.d#initel)
So the init.el checks if there is an elisp config file and loads it if there is. Otherwise, it tangles README org file to config.el and loads it. Second case is slower but it only happens in first install or when you delete config.el manually.
holgerschurig · 2022-10-21 15:42
Well, your rebuttal is void.
I shared a personal experience. You cannot do a rebuttal on that. You could perhaps write "My experifnce is different because of ...".
Rebuttals are only possible with objective factoids, not with subjective feelings.
(PS: I once tried nix, and had the impression that it makes things complex that should be simple. Wasn't for me. And no, don't rebut this ...)