On Thu, 15 Mar 2001, Tom Roche wrote:

[...]

> Urgghh ... this highlights my elisp deficiency. I've done several
> variations on
> 
> ;; "Use 'tramp-compile' if in a tramp buffer, 'compile' otherwise."
> (define-key global-map "\M-`"
>   (lambda (&optional arg)
>     (if (tramp-tramp-file-p buffer-file-name)
>         'tramp-compile
>         'quote compile
>     )
>   )
> )
> 
> none of which work: the current error is
> 
>> Wrong type argument: commandp, (lambda (&optional arg) (if
>> (tramp-tramp-file-p buffer-file-name) (quote tramp-compile)
>> (quote compile)))
> 
> What am I doing wrong?

Trying to bind a function that isn't interactive to a key sequence. Add
an `interactive' form to the top of the function.

Specifically, `(interactive)' should do what you want.

        Daniel

-- 
We went too far, we can't turn back 
We built to high, we can't get down 
We are the slaves of our servants 
in the shadow of our ambitions
        -- Covenant, _Hardware Requiem_

Reply via email to