reddit / emacs
How would you configure emacs if you can't install external elisp packages.
fromadarkcontinent · 2022-05-31 13:02
I've seen a lot of posts about people not being able to use Emacs at work because of security concerns raised by their security team. I was in similar yet different situation where I was able to use packages from the a local repo mirror and I was not allowed to install any external ones. That made me think about how I would setup and use Emacs in those environments. I separated out my config (which is a literate org file) into Vanilla Emacs Configs and External Configs. When ever I'm the afore-mentioned environments I started to comment out the \`\`\`External Configs\`\`\` heading. I've also been hacking on the vanilla configs and I was pleasantly surprised. I miss certain things like hydra, magit, yasnippet and avy but I was surprised by how far I could go with Emacs's built in functions and my Spaghettified lisp config. So I'm asking about your experiences in using vanilla emacs. If you have any tips and tricks or some forgotten built in packages I should give a try and so on.
FrozenOnPluto · 2022-05-31 14:06
My favorite is when they don’t want folks to use external melpa packages (even manually downloaded and used by directory reference), on open source systems like BSD and linux riddled with thousands of packages, serving up nodejs apps with thousands of external packages..
I can live fine on vanilla Emacs with no config changes at all, but I way prefer local heavily modded Emacs using tramp, even multi-hop tramp to reach through jump servers.
I’ve not looked into emacsclient over ssh tunnels yet :p
fromadarkcontinent · 2022-05-31 14:20
I know security teams are dumb about such things, It's not like they could notice if I copy whole packages into my org init and have a hundred thousand line config that generates tangled files. But still I found it a fun challenge pretending to do work while exploring obscure Emacs functionalities and libraries.
ekd123 · 2022-05-31 16:45
I think I will immediately reach for ido-mode, icomplete-mode, recentf-mode, windmove-mode; change the color scheme with customize-themes; disable the welcome screen. I’ll change the default C style, too. Some other useful things do not require any config: project, dabbrev, vc, eshell, etc.
I might have forgot some must-have for me, but this looks good enough for me. One problem I can think of is that Emacs has too few bundled major modes.
BunnyLushington · 2022-05-31 17:49
`M-x find-new-job`
dsemy · 2022-05-31 20:40
I only use 10 packages, and 6 won’t be useful at a work place anyway.
Out of the four remaining, two were written by me (so I would probably just include them in my config) and one isn’t super important (disk-usage).
The one package I’d miss (depending on the type of job) is Eglot - Emacs’ built in alternatives don’t come close to it unfortunately.
As for useful vanilla features:
- dabbrev-expand (M-/), dabbrev-completion (C-M-/) and hippie-expand provide quick completion pretty much anywhere.
- delete-horizontal-space (M-\\) deletes all spaces and tabs around point.
- yank-pop (M-y) inserts a kill from the kill ring with completion.
Emacs also includes at least three mail readers (one of which can be extended to read pretty much anything), at least three emulation layers for other editors, a (bad) mpd client, an RSS/Atom feed reader, etc.
My configuration is currently sitting at around 1100 SLOC.
spauldo_the_hippie · 2022-05-31 22:19
I work in a lot of air-gapped environments, where Internet access is completely disallowed. What I ended up doing was downloading the Windows Emacs distribution and manually copying over packages that I need, then put in a system config that loads those. I don't have all the packages I enjoy in my regular Emacs config, but I've got all the essentials (for me, that's Evil, CSV-mode, ivy, company, and a few others, plus some packages I've written specifically for my work).
It's been a while and I don't have it handy so I can't give any specifics, but it's not difficult to do. Everything Emacs is in one directory that I just have to copy over to the air-gapped system, adjust the system %PATH% variable, put a shortcut in the start menu, and I'm good to go.
HM0880 · 2022-06-01 00:19
It's amazing how well Emacs works on Windows.
Your job is ok with you copying over files to air-gapped systems (via plugging in a usb stick, I assume)?
Nice_Elk_55 · 2022-06-01 02:38
It really depends what packages you use or need, but but you can do a lot with just the built-ins.
Navigation: dired for files, ibuffer for buffers, occur or isearch within a buffer. Ibuffer is actually pretty cool and it doesn't get much attention. You can filter many different ways, create buffer groups, etc. Occur is great for finding stuff in a large file.
Completion: ido or icomplete. These are basic but somewhat configurable. Not as good as ivy/helm/etc but they're an option.
Source control: vc mode
Code completion: dabbrev, hippie-expand, company. You can use ctags to generate a TAGS database and use that for navigation.
You could replace hydra with custom keymaps and the built-in help. If you enter a prefix key followed by `C-h`, it'll give you a popup with the keys starting with that prefix. For example, if you do `C-x C-h` it will list all the keys in `ctl-x-map`. You could create your own keymaps.
There's a built-in equivalent for yasnippet called skeleton, but I haven't used it and I don't think it's very well documented. I never found yasnippet useful myself.
avy is great, but you can replace it with isearch.
Under `C-h p` there's a nifty categorized list of built-in packages. That can be fun to explore.
fromadarkcontinent · 2022-06-01 03:06
I didn't know about C-h p. It seems a handy way of exploring packages. These are the kinds of things I've been missing out.
fromadarkcontinent · 2022-06-01 03:11
I've also forgot to mention about tempo and skeletons which are snippet and templating tools built into Emacs . They have allowed me to have most of the snippet functionality I need.
spauldo_the_hippie · 2022-06-01 05:06
Yes, but there's a procedure and only people like me are authorized to do it. We use a special drive that's designated for this specific purpose.
I work on industrial control systems for the military. Since I'm a developer I get a lot more leeway regarding what goes onto the system than pretty much everyone else - hence why I was able to declare Emacs as "good enough for government work" and copy it over to the system.
zackteo · 2022-06-01 08:57
I'm in a similar situation but I found a way to download external zip files onto my work machine.
I personally use a Doom Emacs configuration. I do the syncing of my packages on my personal machine before transferring it over and rebuilding it for my work machine with `doom build`
redguardtoo · 2022-06-01 09:01
See https://github.com/redguardtoo/elpa-mirror
Use it to create a local repository at home pc. Then you can install packages from local repository at corp work station.
See https://github.com/redguardtoo/emacs.d#support-legacy-emacs-version for some real world example. I use about 300 packages, the local repository zip is just 20M bytes. Small enough to fit into any usb stick.
The package was originally designed to help some guy living on the island in Pacific Ocean. His network is unreliable so he can't use elpa or melpa.
HM0880 · 2022-06-01 11:57
Gotcha. Happy to hear that you're putting your "developer powers" to good use! :D
blablook · 2022-06-01 14:49
Heh, quite similar here. We've three users on Emacs in an airgapped env. Both doom emacs and spacemacs works ok after installing deps and then moving directories into the env - Linux though.