2

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?

Terry
  • 370
  • 2
  • 14
  • 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 '20 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 '20 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 '20 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. – Terry Feb 15 '20 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 '20 at 18:04
  • Ops. I'm critical of those newest macOS versions like the Mojave. In fact, I'm using this version Yosemite because I had to install a newer version of Firefox or Waterfox. It's unfortunate that they break older macOS versions compatibility just to make it compatible with Mojave. – Terry Feb 15 '20 at 18:14
  • For my daily workflow, I still use a build of Emacs *prior to* the 09/28/2018 commit bearing 7946445962372c4255180af45cb7c857f1b0b5fa .... I generally only play with a current version of the master branch when developing a new proposed feature, or when I'm trying to debug something that requires help from the developers and it is necessary that everyone be on the same version to properly debug .... [I have a small fleet of computers running OSX 10.6.8, and have no need for Mojave compatibility ....] – lawlist Feb 15 '20 at 18:21
  • That particular version 7946445962372c4255180af45cb7c857f1b0b5fa is not present as a binary at https://emacsformacosx.com/builds/all. Did you build it from source? If so, which tarball did you use? – Terry Feb 15 '20 at 19:04
  • In terms of nightly builds, it would be necessary to look for something prior to 09/28/2018 or know the precise commit if it was built on that date. I'd need to spend time reviewing the nightly builds of Emacs 26 or nightly builds of Emacs master branch on https://emacsformacosx.com/ to locate a build immediately prior to the 09/28/2018 commit bearing `7946445962372c4255180af45cb7c857f1b0b5fa`, or at least as close as prior to the offending commit as possible. Here is how to do it using the source code for the Emacs 26 branch: `git clone -b emacs-26 git://git.sv.gnu.org/emacs.git` ... – lawlist Feb 15 '20 at 20:08
  • ... The commit immediately prior to the aforementioned offending Mojave compatibility commit is `41fa88b99bebf7af62cdea0c0867b04e9b968db3` dated 09/28/2018 with a subject line of "*; Fix some doc typos*". To go back to the commit bearing last five digits 68db3, run the terminal command in the emacs 26 repository main directory: `git reset --hard 41fa88b99bebf7af62cdea0c0867b04e9b968db3` and the terminal will output the message: "*HEAD is now at 41fa88b ; Fix some doc typos*" Then, build normally ... assuming you have the required tools installed ... – lawlist Feb 15 '20 at 20:08

2 Answers2

2

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
lawlist
  • 18,826
  • 5
  • 37
  • 118
  • 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. – Terry Feb 17 '20 at 09: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 '20 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. – Terry Feb 18 '20 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).

Michael Albinus
  • 6,647
  • 14
  • 20
  • 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. – Terry Feb 17 '20 at 09:40