On Thu, 15 Mar 2001, Tom Roche wrote:
>> I've done several variations on
>>> (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?
Daniel Pittman <[EMAIL PROTECTED]> 16 Mar 2001 10:48:11 +1100
> Trying to bind a function that isn't interactive to a key sequence.
> Add an `interactive' form to the top of the function.
Actually, I had tried that. If I do
> (define-key global-map "\M-`"
> (interactive)
> (lambda (&optional arg)
> (if (tramp-tramp-file-p buffer-file-name)
> 'tramp-compile
> 'compile
> )
> )
> )
I get
> Wrong number of arguments: #<subr define-key>, 4
and if I do
> (define-key global-map "\M-`"
> (lambda (&optional arg)
> (interactive)
> (if (tramp-tramp-file-p buffer-file-name)
> 'tramp-compile
> 'compile
> )
> )
> )
I get nothing at all (including no error, even with debug-on-error t).
Your assistance is appreciated, [EMAIL PROTECTED]