all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Run Command from python-mode
@ 2006-07-24 21:00 Kevin Harriss
  2006-07-24 21:49 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Harriss @ 2006-07-24 21:00 UTC (permalink / raw)


I am using python-mode and I would like a similar solution to mapping
f10 to compile with csharp mode.  I would like f10 mapped to the command
'cvc cook <filename>' I was wondering what variable in python-mode would
need to be modified.  I currently have this in my .emacs 
(setq 'compile-command "cvc cook")
(local-set-key [f10] 'compile)
 When I open a python file I get this error 
File mode specification error: (wrong-type-argument symbolp (quote
compile-command))

Thanks in advance,

Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Run Command from python-mode
  2006-07-24 21:00 Run Command from python-mode Kevin Harriss
@ 2006-07-24 21:49 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2006-07-24 21:49 UTC (permalink / raw)


Kevin Harriss wrote:
> I am using python-mode and I would like a similar solution to mapping
> f10 to compile with csharp mode.  I would like f10 mapped to the command
> 'cvc cook <filename>' I was wondering what variable in python-mode would
> need to be modified.  I currently have this in my .emacs 
> (setq 'compile-command "cvc cook")
> (local-set-key [f10] 'compile)
>  When I open a python file I get this error 
> File mode specification error: (wrong-type-argument symbolp (quote
> compile-command))

(setq 'compile-command ...) == (setq (quote compile-command) ...)

Either use (setq SYMBOL ...) or (set (quote SYMBOL) ...)

Try this:

(add-hook 'python-mode-hook
	  (lambda ()
	    (local-set-key [f10] 'compile)
	    (set (make-local-variable 'compile-command)
		 (format "cvc cook %s"
			 (file-name-nondirectory buffer-file-name)))))

-- 
Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-24 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-24 21:00 Run Command from python-mode Kevin Harriss
2006-07-24 21:49 ` Kevin Rodgers

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.