0

I've just installed Emacs 26.3 on my macOS 10.10 (Yosemite) using the binary at Emacs for OSX Everything so far works fine icluding new package installations and different themes. However, when I tried to edit a file on my Linux server using this TRAMP line:

/myuname@myserver.com:

It returned:

File not found and directory write-protected

and a blank buffer appeared in the window area.

When I tried Emacs-25.3 binary from the same website, that same TRAMP line worked perfectly and I managed to edit file on the server. When I tried Emacs 26.1 and 26.2, the same problem occured again. So I think this problem is specific to Emacs 26.x.

What should I do to make TRAMP work on Emacs 26.x on macOS?

  • 1
    The following syntax works for me on OSX 10.6.8 (Snow Leopard) using Emacs 26.1 built by Emacs for OSX: /ssh:username@server#port:. E.g., /ssh:hello@world.com#2222: and that logs in to my root home directory on the shared server in cyberspace at the following path in the top of the dired-mode buffer: /ssh:hello@world.com#2222:/home3/hello: The developer who produces the Emacs binary app package on Emacs for OSX stopped producing builds for OSX 10.6.8 after Emacs 26.1, so that is the only build I can test from his website. – lawlist Feb 15 at 17:03
  • 1
    ... Here is the same thing on Emacs 26.1 by Emacs for OSX (running on OSX 10.6.8 Snow Leopard), but opening a file (instead of the root home directory) on the shared server in cyberspace: /ssh:hello@world.com#2222:/home3/hello/.spamassassin/user_prefs In this case, I opened the file named user_prefs inside the spamassassin folder. I would imagine Tramp uses a default port other than 2222 and that is why I must also specify the desired port, but I don't remember where I asked that particular question -- probably a few years ago.... – lawlist Feb 15 at 17:08
  • 1
    This is how I open shell or eshell using Tramp on Emacs 26.1 built by Emacs for OSX: (let ((default-directory "/ssh:hello@world.com#2222:")) (eshell)) or (let ((default-directory "/ssh:hello@world.com#2222:")) (shell)) .... If you want to setup an .authinfo file to login automatically, here is an example entry in that file: machine 12.34.567.89 login username password abcdefg Alternatively, one can use an appropriate entry in the ~/.ssh/config file to login automatically ... -- the entry in the config can include a port number ... – lawlist Feb 15 at 17:22
  • When I added ssh to the TRAMP line i.e. /ssh:myuname@myserver.com: it worked out but the buffer and mini buffer all went blank, then after the connection was made the buffers returned back. Small glitch. – Romario Feb 15 at 17:57
  • 1
    Perhaps related .... On 09/28/2018 (commit 7946445962372c4255180af45cb7c857f1b0b5fa), compatibility for Mohave was added to Emacs. Sadly, that patch prevents Emacs from updating the glass directly during the internal function update_window ..., and this results in screen update glitches. Since then, I think the master branch has undergone additional changes that are designed to help with screen update glitches, but I haven't played around with the master branch since mid-July of last year ... so, I'm not sure what new/problematic goodies are available there .... – lawlist Feb 15 at 18:04
1

The following is an excerpt from the Quick Start Guide for Tramp, which is built-in to Emacs 26:

https://www.gnu.org/software/emacs/manual/html_node/tramp/Quick-Start-Guide.html

Tramp extends the Emacs file name syntax by a remote component. A remote file
name looks always like /method:user@host:/path/to/file.

You can use remote files exactly like ordinary files, that means you could open
a file or directory by C-x C-f /method:user@host:/path/to/file <RET>, edit the
file, and save it. You can also mix local files and remote files in file
operations with two arguments, like copy-file or rename-file. And finally, you
can run even processes on a remote host, when the buffer you call the process
from has a remote default-directory.

The O.P. has indicated in a comment that using /method:user@host:/path/to/file has resolved the issue.

  • Example using ssh and a non-standard port (2222) to connect to the root default directory:

    /ssh:user@host#2222:

  • Example using ssh to open a file with a non-standard port (2222):

    /ssh:user@host#2222:/path/to/file

Here is an example to connect to the root default directory using eshell with a non-standard port (2222):

(let ((default-directory "/ssh:user@host#2222:"))
  (eshell))

Here is an example to connect to the root default directory using shell with a non-standard port (2222):

(let ((default-directory "/ssh:user@host#2222:"))
  (shell))

To login automatically using an .authinfo file, here is a sample entry in that file:

machine HOST login USER password PWD

To assist with logging in automatically with a non-standard port (2222), one can use an appropriate entry in the ~/.ssh/config file, which can include other attributes; e.g., HostName and User. https://emacs.stackexchange.com/a/31339/2287

Host 12.34.567.89
  Port    2222
| improve this answer | |
  • Thank you for the answer. I'm in the process of building the Emacs-26.1 from scratch (using the repo whose commit ID is b968db3) using the gcc-10.0 and ../emacs/configure --without-x --with-gnutls=no --without-ns i.e. minimum working configuration for macOS. I got stuck at Converting leim/CXTERM-DIC/CCDOSPY.tit to lisp/leim/quail/CCDOSPY.el (quail-package) TIT dictionary doesn’t have body part error. – Romario Feb 17 at 9:31
  • I'm not sure why you would want to build Emacs for MacOS using the --without-ns flag. Here is what I used today to successfully build from the commit bearing 41fa88b99bebf7af62cdea0c0867b04e9b968db3 on the emacs-26 branch: CFLAGS='-Wall -O0 -g3' ./configure --with-ns --with-gnutls=no --with-mailutils --without-makeinfo. I'm on OSX 10.6.8 (server) -- I have installed the /Developer tools that came with the installation DVD (which has Xcode 3.2). I only added more recent versions of autoconf and automake to a separate folder, which I then added to the front of the $PATH. – lawlist Feb 17 at 18:29
  • You have vocalized what I was thinking because I would also like to build with --with-ns but that option causes further issues like configure: error: AppKit/AppKit.h required for a Nextstep build are missing so I have to postpone that until after I'm able to build a bare version, --without-x i.e. the terminal version of emacs. No problems on the autoconf& automake I'll go on building that bare version soon. – Romario Feb 18 at 17:06
1

As other answers have mentioned already, Tramp has strengthened its syntax. It requires a mandatory method name now.

You could use - as method name if you mean the default method, like in /-:myuname@myserver.com:. If you don't what to apply any other method name but the default one, apply (tramp-change-syntax 'simplified). This changes Tramp syntax to /myuname@myserver.com:.

All of this is described in the Tramp manual, so you might want to read there. (Disclaimer: I'm the author of that manual).

| improve this answer | |
  • Thank you for the answer. For the time being I'm trying to build Emacs-26.1 from scratch so as to make it the most compatible to my macOS. Btw, Emacs-26.3 has another networking issue. When I use eww it gives multiple Emergency (url): Unknown proxy directive: DIRECT warnings. By building if from scratch, I hope those issues will be all eliminated. If they aren't, then I will try your solution suggestion. – Romario Feb 17 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.