On Thu, 15 Mar 2001, Tom Roche wrote:
> Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100
>>>> So, rather than doing (if ... 'tramp-compile 'compile), run the
>>>> command you want, so:
> 
>>>> (if ... (tramp-compile) (compile))
> 
> On Thu, 15 Mar 2001, Tom Roche wrote:
>>> I get noise in *Messages* (broken for mail):
> 
> Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 13:47:29 +1100
>> The noise is a byte-compiled version of the compile function. It
>> takes a parameter, the event that started it.
> 
>> So, you need to pass arg from your lambda to `compile'. :)

Actually, no, you don't. I /am/ having a stupid day, I fear.

[...]

> *Backtrace*
>> Signaling: (wrong-type-argument char-or-string-p nil)

Quite. Because `compile' wants the command to run, not the event that
caused it to be called.

Try this for size, it /should/ work (with your key-binging, not mine :):

(define-key global-map [(control f10)]
            (lambda (&rest args)
              (interactive)
              (if (tramp-file-p ...)
                  (call-interactively 'tramp-compile)
                (call-interactively 'compile))))

That should be a little more like what you want.

Basically, that passes the call on to the correct version of the compile
command (tramp or otherwise) as though they had been called from the
keypress.

I even tested it here and it did what I want, just like passing no
arguments to the command.

I hope this helps. I should think more, I guess, before suggesting
solutions. :)

        Daniel

-- 
Explain the concept of death very carefully to your child. 
This will make threatening him with it much more effective.
        -- P.J. O'Rourke

Reply via email to