This works *but* I get
Symbol's value as variable is void: compilation-read-command
unless I do a M-x compile first (or run the function in a local
buffer).
-chris
On 23 May 2001, Kai [iso-8859-1] Großjohann wrote:
> On Wed, 23 May 2001, Chris Majewski wrote:
>
> > On 23 May 2001, Kai [iso-8859-1] Großjohann wrote:
> >
> >> On Wed, 23 May 2001, Chris Majewski wrote:
> >>
> >> > Cool, that worked. I had to put (require 'tramp-util) in my
> >> > .emacs. Now, how can I tell C-x C-e to run tramp-compile in a
> >> > remote buffer, and compile otherwise?
> >>
> >> (defun cm-compile-maybe-remote ()
> >> (interactive)
> >> (if (and (buffer-file-name)
> >> (tramp-tramp-file-p (expand-file-name
> >> (buffer-file-name))))
> >> (call-interactively 'tramp-compile)
> >> (call-interactively 'compile)))
> >>
> >> Untested.
> >
> > Really? What do you use?
>
> I don't use remote compilation. You would be surprised at how rarely
> I use Tramp, and how few features I use.
>
> Maybe I'm not the right maintainer anymore because I don't really use
> its power.
>
> >> Does it work?
> >
> > No. buffer-file-name returns nil in a remote dired buffer.
>
> Does it help to edit the `if' statement as follows?
>
> (if (or (and (buffer-file-name)
> (tramp-tramp-file-p (expand-file-name (buffer-file-name))))
> (and default-directory
> (tramp-tramp-file-p (expand-file-name default-directory))))
> ... as before ...)
>
> If it works, I could add it to tramp-util.el.
>
> kai
> --
> ~/.signature: No such file or directory
>