How to teach emacs remote compilation? - emacs

I use sshfs + emacs to remotely work on a project.
But I can't "M-X compile, make" since make is remote.
What is the easiest way to solve it so that emacs can take me to the first error?
(I have only ssh access to the machine)
TRAMP seems to be an overkill.
No, I don't want to give up having emacs locally.

Have you tried something like M-x compile RET ssh remotehost cd project/dir\; make RET

Related

Tramp can not connect to remote server

I have upgraded my emacs and updated some el-get packages including tramp (my system is a bit old, and I could not upgrade some emacs packages), and now I can not use tramp to connect to a remote server:
Tramp: Opening connection for server1 using ssh...failed
byte-code: Host `server1' looks like a remote host, `ssh' can only use the local host
I am using tramp version 2.2.13-pre and emacs version 24.5.1. I have compiled emacs myself, in case it matters.
What can be going wrong? What could I try?
EDIT
I am calling tramp like this:
C-x C-f /user#server1:filename
Call emacs -Q. Likely, Tramp will work then. In this case, bisect your .emacs file and restart Emacs, until you find the package which causes the trouble.
One package which didn't cooperate well with Tramp was projectile. Disable it, when you are using it.

How to use rlwrap in Gauche running on emacs in MinGW?

I am new to Scheme, and using gosh running on emacs buffer, in MinGW on Windows. It seems that people use readline or rlwrap to use history and more, but I still cannot figure out to accomplish the setting. Though it may be easy to run one on Linux using virtual machine, I would stick to Windows for now. Any idea or alternative suggestion?
An Emacs buffer is not a real terminal, and rlwrap will not run in it. However, this is no tragedy: almost all of rlwraps goodness can be had directly from Emacs (you could use one of the existing scheme modes, or even Emacs-gosh-mode)
If you insist, Emacs can provide a terminal emulator for you (M-x term) in which rlwrap will feel right at home.

Emacs shell behavior

I am using cygwin on windows 7. I have a question regarding the Emacs shell.
Whenever I use the shell inside of the Emacs(M-x shell)
It echo pwd directory after prints out the result.
I found it very annoying since it distracts me.
e.g.
$ ls
workspace
^[]0;~/cs61bl^G
myname#pc ~/cs61bl
Is there any way to remove these lines?
^[]0;~/cs61bl^G
myname#pc ~/cs61bl
When using Emacs, try using the eshell: M-x eshell. The eshell does not suffer from this problem.
You might be looking for "shell-dirtrack-mode". You can either do an M-x shell-dirtrack-toggle or (shell-dirtrack-mode 1) in your init file. Recent emacs versions seem to disable it by default.
There is this file http://www.emacswiki.org/emacs/setup-cygwin.el that simplifies setup of various packages in Emacs (including shell) to use cygwin. Also try not to use ANSI sequences in your PS1 prompt because Emacs shell mode wouldn't interpret them, something like
export PS1="\h \W\$ "
should do.

Emacs desktop doesn't remember TRAMP connections?

I use emacs to edit scripts and code files on several different servers. TRAMP is working very well. However, when I exit emacs, all my tramp connections go away. I tried desktop-save-mode, but only local files show up when I restart emacs. Is there some package that will remember tramp connections? Is this just a configuration issue?
You can customize the variable desktop-buffers-not-to-save to do this:
(setq desktop-buffers-not-to-save "^$")
By default it is set to a regexp that matches TRAMP filenames. I would have expected setting it to nil would have worked, but, alas, it does not.

Doing a make over TRAMP

I am using Emacs Tramp for remote development. I think something must be wrong. I had some serious issues with speed when I used ssh:, so I switched to scp:. It seems to work much faster. I tried to run M-x compile with make and it seems to act differently than if I run make directly from a shell prompt. Namely, it is unable to find .h files. It compiles fine from a shell prompt.
Any ideas why this is happening?
Try using M-x tramp-compile explicitly. The keybindings for compilation are automatically remapped when you're editing a remote file with TRAMP, but M-x compile may be operating on the local copy of the files. ?