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 ...
system-name is a built-in function in ‘C source code’.
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.
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
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"
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.
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/"
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"))
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 ...
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:
[10 151 0 63 0])
[10 151 2 76 0])
[127 0 0 1 0]))
And when I turn off wifi, en0 disappears:
[10 151 ...
To expand on Legoscia's answer:
(defun test-internet ()
(remove-if (lambda (el)
(string-match-p "lo.*" (car el)))
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 ...
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)
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
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))))...
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 ...
On a modern Linux system with DBus and NetworkManager:
(equal 70 (dbus-get-property
:system "org.freedesktop.NetworkManager" "/org/freedesktop/NetworkManager"
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.
Tramp helm interface for ssh server and docker
*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 ...
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 ...
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 ...
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 ...
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....
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.
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
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 ...
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-...