I guess the real quesion is : how to evaluate a file via it's url?
Of course it wouldn't be the actual .emacs file, but it it would serve that purpose, so you can run your personal settings on any PC that has emacs installed.
I'm aware of the fact that loading a buffer in certain situations (mainly 'toggling stuff) is not the same as evaluating a buffer afterwards, but that's OK.
browse-url-emacs
from the standard url
library makes this simple. It displays the resulting buffer, which you probably don't want in this case, but we can wrap it with save-window-excursion
to circumvent that issue.
(save-window-excursion
(eval-buffer (browse-url-emacs "http://foo/bar.el")))
or with some rudimentary error handling:
(condition-case e
(save-window-excursion
(eval-buffer
(browse-url-emacs "http://foo/bar.el")))
(error (message "Could not load remote library: %s" (cadr e))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With