23

You cannot use emacsclient to connect to an Emacs instance running on a remote computer. This client-server concept is related to (local) processes, not network nodes. However, you can use various network technologies to log in to the remote computer, attach to an emacs server running there and display the emacsclient's screen locally. Depending on the ...


12

C-hf system-name system-name is a built-in function in ‘C source code’. (system-name) Return the host name of the machine you are running on, as a string. It's also a variable, but (a) that's now deprecated, and (b) the function pre-dates it, so don't use the variable. It is safe and best to use the function in all scenarios. C-hv system-name system-...


12

M-x erc is built in and works well. You want to join irc.freenode.net; the initial login is pretty self-explanatory. Then, type /join #emacs from the main IRC prompt.


12

Probably not what you asked for but assuming you have ssh setup with X-forwarding, you could start emacsclient on the server and forward it to remote DISPLAY. (Disclaimer: code typed directly into webform) local> ssh server -f emacsclient -c --display=$DISPLAY


8

This may be not what you want but just in case see if it can help you some way. I usually work inside a virtual machine bootstrapped with Vagrant, I have my ~/.emacs.d directory synced between my machine (local) and the virtual machine (remote) putting the following in the Vagrantfile file: config.vm.synced_folder "~/.emacs.d", "/home/vagrant/.emacs.d" ...


8

Here's a really quick and dirty solution: (defun my-view-source (url) (interactive "MURL: ") (switch-to-buffer (url-retrieve url (lambda (_))))) url-retrieve is built-in to Emacs; there are also alternatives such as request.el.


7

Well, if you still wanted to refresh contents automatically, whenever possible, you could do something like the code below: (defun can-retreive-packages () (cl-loop for url in '("http://marmalade-repo.org/packages/" "http://melpa.milkbox.net/packages/" "http://elpa.gnu.org/packages/") do (...


7

A simple solution that I've adopted from my shell scripts is (defun internet-up-p (&optional host) (= 0 (call-process "ping" nil nil nil "-c" "1" "-W" "1" (if host host "www.google.com")))) You can test this in the *scratch* buffer: (message (if (internet-up-p) "Up" "Down")) "Up"


5

Emacs used to try and set system-name to an FQDN. This has caused a fair bit of bug-reports and frustration over the years, since it caused Emacs to sometimes hang for somewhere between 30s and 2min at startup in case of a "misconfigured" DNS setup. Things have gotten worse nowadays since in many common situations (e.g. machine behind NAT) it's almost ...


5

The w3 mode can do this with the w3-source-document-at-point command which by default is bound to s. You could also use M-! and invoke curl.


4

One thing you could try is the function network-interface-list. It returns an alist of network interfaces and their IP addresses. For me, this is what it returns when I'm connected to both Ethernet and wifi: (("en5" . [10 151 0 63 0]) ("en0" . [10 151 2 76 0]) ("lo0" . [127 0 0 1 0])) And when I turn off wifi, en0 disappears: (("en5" . [10 151 ...


4

emacsclient and TRAMP Automatically open remote files in local emacs I have had success with the first solution. The second seems to be simpler, I'm yet to try it out.


3

To expand on Legoscia's answer: (defun test-internet () (remove-if (lambda (el) (string-match-p "lo.*" (car el))) (network-interface-list))) This will return a list of active network connections (lo.* is the loopback interface, in some cases lo in others lo#. If the test returns non-nil, then there is a network ...


3

The reason of this problem can be using of the recentf mode. You need to disable cleaning up unavailable files using following command in your ~/.emacs (or ~/.emacs.d/init.el if you are using it): (setq recentf-auto-cleanup 'never)


3

I had the same problem, and it seems like it is being caused by the windows netlogon service. The simplest solution is to turn it off when outside your company network, by running the following command in the command line: net stop netlogon When you are back on the company network, start it again using net start netlogon


2

I use the following to exclude loopback interfaces and also VirtualBox and Docker interfaces. I hope it's helpful. (defun tzz-has-network () (remove-if (lambda (i) (or (string-match-p "\\(vboxnet\\|docker\\).*" i) (member 'loopback (nth 4 (network-interface-info i))))) (mapcar 'car (network-interface-list))))...


2

There is also circe, but you have to install it through melpa


2

Quite a few possible reasons, two off the top of my head (had these troubles in the past.) You may have a remote folder mapped in Windows, and when off the local network it may slow you down a lot (getting off the VPN doesn't quite help, actually it may make matters worse since Windows will keep trying to reach it stopped only by timeouts.) More recent ...


2

On a modern Linux system with DBus and NetworkManager: (defun nm-is-connected() (equal 70 (dbus-get-property :system "org.freedesktop.NetworkManager" "/org/freedesktop/NetworkManager" "org.freedesktop.NetworkManager" "State")))


2

No, this is not possible directly from Elisp at the moment. Please open a bug report, so that this feature can be added (it won't be in time for Emacs 25, but it may make it to the next version). In the meantime, depending on your platform, you can call out to external programs such as ip -6 addr.


2

Easiest options: helm-tramp Tramp helm interface for ssh server and docker docker-tramp *docker-tramp.el offers a TRAMP method for Docker containers. Both are available on MELPA and can be easily installed with: M-x, package-install, and type name_of_the_package RET Note: The Spacemacs Emacs distribution have the Docker layer which provides syntax ...


2

My fix was to use this: (car (split-string (shell-command-to-string "hostname -f"))) It's a bit of a hack, because I just use the hostname -f shell command. This is because I don't think hostname should return the FQDN. there's all sorts of things wrong with this, and anyways, I don't always control the /etc/hosts file or the hostname myself My use case ...


2

This process provides the credential cache, so that you don't have to enter your password each time you pull, push or other otherwise access that remote. If you don't need the cache anymore, you can kill the process in the usual way, for example from the list-processes buffer, or with the kill-process function. Magit doesn't currently offer a command to ...


1

In a private email, Christopher Wellons answered my question. The problem is that server-process is a special variable defined in server.el. Special variables are always dynamically bound. As a result, the filter closure doesn't close over the server-process variable. When the filter closure is evaluated, the server-process variable's value is the one from ...


1

An alternative to setting httpd-host to a hostname is to set it to an IP. You can use 0.0.0.0 to bind to all local IP addresses. Try (setq httpd-host "0.0.0.0") (it works for me).


1

There is dns.el, which was in Gnus for a while but has long since been moved into the more general net subdirectory of lisp. This library seems to implement its own resolver. (It may call nslookup only to get your DNS resolver address(es), if you don't set dns-servers and /etc/resolv.conf cannot be found.) (dns-query "www.google.com") ; => "216.58.216....


1

I don't know how to integrate docker with Tramp, but you seem to have it solved. When you have enabled Tramp traces, there is a Tramp debug buffer. Enable at least trace level 6. Then you can search through the debug buffer with (6), this shows you all commands Tramp has sent, and the responses.


1

I think you're looking at it the wrong way. If you really want to auto-update your packages, then don't do it synchronously at startup: do it from an idle timer of some sort. E.g. (run-with-idle-timer 10 nil (lambda () (package-refresh-contents) ..etc..))


1

To troubleshoot the issue I started Emacs with a completely commented out .emacs init file then uncommented and executed my .emacs file one line/block at a time until came across a command that prompted the remote login authentication. ido-mode was the offending package. I found a variable, ido-save-directory-list-file which pointed to ~/.ido.last which had ...


1

In addition to what @Francesco said - If you are sure that the problem comes from bookmarks, then double-check your bookmarks file(s). (I know you said that you did that, but check again.) Check the value of variable bookmark-default-file, and look in that location (file). If you use Bookmark+ then check also the value of option bmkp-last-as-first-...


Only top voted, non community-wiki answers of a minimum length are eligible