reddit / emacs

Offline Emacs

jakub1842 · 2022-10-12 04:39
Dear All, I just got Emacs 28.1 installed on my work laptop. It's a windows 10 machine administered by the IT. The Emacs install does not have access to the internet - howerver, other programs like Firefox do. I download packages manually and use use-package without :ensure to configure them. I managed to configure a very basic system with ivy, swiper, evil (+collection). The main goal is convenient org-mode use. Do you have any tips for such an offline situation? I admit its quite a chore to do all the config and package installation manually.
[deleted] · 2022-10-12 04:48
[deleted]
atamariya · 2022-10-12 04:56
You can simply copy over $HOME/.emacs.d from an already configured Emacs instance.
jakub1842 · 2022-10-12 05:05
Thank you! My normal config is Doom Emacs which requires some additional software (like git and ripgrep) so it is not easily applicable. I am not willing to talk with IT about e.g. ripgrep. I think it will be just easier to build from ground up as most of the functionality of doom is not necessary for the job. I just need a convenient org-mode "typewriter".
lj-read-it · 2022-10-12 05:14
A talk with the admin definitely seems to be in order--like, what kind of harm could you do with an online Emacs that you can't do with Firefox? It just seems to be a result of all unknown apps being cut off from online access by default. It's a sensible policy as it goes, I suppose, but users should be able to ask for review.
mavit0 · 2022-10-12 07:34
You don't mention how Emacs is prevented from accessing the Internet, so here's something worth considering: maybe if you extracted the proxy settings from Firefox and [plugged them in to Emacs](https://www.gnu.org/software/emacs/manual/html_node/url/Proxies.html), that would work?
7890yuiop · 2022-10-12 07:35
Put your Emacs config under version control. Online repositories like github provide an option to download a zip file, so you can manage your repo outside of work if necessary, and update it at work trivially by downloading the latest archive in Firefox.
jakub1842 · 2022-10-12 08:00
I agree with you completetly. Still I will not burn my time on trying to change company policy or the way our IT works. It seems much quicker still to manually copy package files into .emacs.d :)
jakub1842 · 2022-10-12 08:01
Sorry, no git on my system :( Maybe your answer will help someone else, thank you!
jakub1842 · 2022-10-12 08:04
I think it would be against company policy to circumvent the "firewall" preventing Emacs to access the Internet - not goint to try. I am not aware of the details how it works. Configuration is hidden from the user. Still, thank you for trying to help!
7890yuiop · 2022-10-12 08:05
Part of my point was that you *don't* need git on your work machine -- only on some *other* machine (with which you maintain that repo). You said you could download files with Firefox, and that's all you'd need on the work machine. E.g. on your work machine you can download the code from (for example) the Doom Emacs repository at https://github.com/doomemacs/doomemacs/archive/refs/heads/master.zip -- which is the "Download Zip" link, in the "Code" drop-down menu at https://github.com/doomemacs/doomemacs -- and I'm suggesting you do that with a (self-contained) config repository of your own. If you mean that you don't have git (or any other VCS with similar online facilities available) on *any* machine that you use, then sure, this won't help. But unless you don't *have* any other machine, that shouldn't be an issue? I suggested version-control because that's a very good idea in general, and a convenient way to manage the code; but at a pinch you could use *any* online file service from which downloading in Firefox is possible. Just upload a new archive to the file server whenever you make changes.
lj-read-it · 2022-10-12 08:19
(grognard voice) Those whippersnappers who don't even know Emacs call themselves an IT department??
mavit0 · 2022-10-12 08:51
If you believe that IT have blocked Emacs deliberately, then fair enough.
KleenexQ · 2022-10-12 09:09
Or they do, and realise giving Emacs unfettered internet access is basically letting a user run a completely uncontrolled operating system on their network? Emacs is too powerful!!!
[deleted] · 2022-10-12 09:27
That is not circumvention. It’s simply a proxy misconfiguration, your IT team sucks.
Horrih · 2022-10-12 09:43
Using your corporate proxy is playing by the rules, since this is what a proxy is used for. Things are different if they have blacklisted github/ melpa/elpa, or have a no install policy. Then you shouldn't install anything at all
jakub1842 · 2022-10-12 10:11
I think they don't truly know Emacs. Even without internet access it gives infinite possibilities :)
ComfyRug · 2022-10-12 10:35
Why don't you (if applicable) cross compile ripgrep and git, then just move the binaries over? However, I do always support people starting their inits from scratch because it's a good way to learn more about how you \_actually\_ use Emacs as opposed to how you thought you would.
arthurno1 · 2022-10-12 10:47
> what kind of harm could you do with an online Emacs that you can't do with Firefox? Firefox is sandboxed and can write to only specific directories, can not execute shell scripts etc. Emacs can do pretty much anything. Of course, the user should still not be able to damage the OS, but at least in theory he/she can wreak havoc in its own profile.
arthurno1 · 2022-10-12 10:48
It does. But that is another story.
redguardtoo · 2022-10-12 11:27
https://github.com/redguardtoo/elpa-mirror Similar question has been asked many times.
Bear-Repulsive · 2022-10-12 12:09
Tell your IT admin to clone melpa repo locally.
jakub1842 · 2022-10-12 14:43
Thank you for the clarification! I think this is a workable solution to ease the pain of manually copying packages.
microamplifier · 2022-10-13 06:15
My suggestion is to use built-in packages that come with Emacs 28 as much as possible. For instance, use project instead of projectile, repeat instead of hydra, eshell instead of vterm, pulse instead of pulsar, vc instead of magit, isearch instead of helm/ivy/vertico, etc.
Connect_Salt6928 · 2022-10-14 11:02
I have a similar situation and just downloaded git and ripgrep etc. and added to the path in my user environment variables.