[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Several novice questions

From: Florian Lindner
Subject: Re: Several novice questions
Date: Thu, 21 Nov 2002 21:48:38 +0000
User-agent: KNode/0.7.1

Kevin Rodgers wrote:

> Florian Lindner wrote:
>> Hi,
>> I'm currently learning Emacs 21.2 with pascal-mode and freepascal.
>> I've set the compile-command variable in my .emacs
>> (add-hook 'pascal-mode-hook
>>           (lambda()
>>             (set (make-local-variable 'compile-command)
>>             (concat "fpc -Ci -Co -Cr -CR -Ct -So -Ss -g "
>> buffer-file-name))))
>> And it's working with M-x compile. How can I bind this command to another
>> key comba (C-c C-v for example)?
>> I've tried: (define-key pascal-mode-map "\C-c\C-v" 'compile)))) but is
>> doesn't work. "File mode specification error: (wrong-number-of-arguments
>> #<subr set> 3)"


> The problem isn't with your define-key call (although I would recommend
> using
> a binding reserved for users, like `C-c v'), but with your hook function. 
> I suspect your .emacs file is different from what you have above: is there
> a close parenthesis after the "fpc -Ci -Co -Cr -CR -Ct -So -Ss -g "
> string?

(add-hook 'pascal-mode-hook
            (set (make-local-variable 'compile-command)
                 (concat "fpc -Ci -Co -Cr -CR -Ct -So -Ss -g " 
            (define-key pascal-mode-map "\C-c\C-v" 'compile)))

Ok, you're right. It's working with that call now. There need to be 2 
parens, one for the concat, the other for the set.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]