On Thu, 15 Mar 2001, Tom Roche wrote:
> On Thu, 15 Mar 2001, Tom Roche wrote:
>>>>> What am I doing wrong?

[...]

> Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 11:18:38 +1100
>> You want:
> 
>> (define-key global-map "\M-`"
>>   (lambda (&optional arg)
>>     (interactive)
>>     (if (tramp-tramp-file-p buffer-file-name)
>>         'tramp-compile
>>         'compile
>>     )
>>   )
>> )
> 
> Umm ... I tried that. Is there a typo?

Probably. I didn't actually test it. :)

Hang on...  It /looks/ right. Let me check my own sources.

> I can eval the above, checking to see that the key bound (it has). But
> if I try to use the key, nothing happens.

Ah. Wait. I see it. Let me guess, in the minibuffer, you see either
"compile" or "tramp-compile" when you hit the key, right?

You are returning a symbol from the keypress function which is then
ignored. You actually need to /call/ the function you want run.

So, rather than doing (if ... 'tramp-compile 'compile), run the command
you want, so:

(if ... (tramp-compile) (compile))

That'll teach me to answer questions without reading more than the top
of the function. :)

        Daniel

-- 
The heart has its reasons which reason knows nothing of.
        --Blaise Pascal, _Pensees_

Reply via email to