Emacs: Python and C modes improvements.

master
Pierre Neidhardt 2013-01-18 19:46:11 +01:00
parent ae6d5b1044
commit 07dc40bac9
1 changed files with 7 additions and 5 deletions

View File

@ -313,11 +313,8 @@ your document embeds raster graphics."
(or (getenv "CFLAGS") "-ansi -pedantic -std=c99 -Wall -Wextra -Wshadow -lm -g3 -O0") (or (getenv "CFLAGS") "-ansi -pedantic -std=c99 -Wall -Wextra -Wshadow -lm -g3 -O0")
file)))) file))))
(local-set-key (kbd "C-c C-f") 'compile) (local-set-key (kbd "C-c C-c") 'compile)
;; (global-set-key (kbd "<f12>") 'next-error) ;; (global-set-key (kbd "<f12>") 'next-error)
(local-set-key (kbd "M-a") 'beginning-of-defun)
(local-set-key (kbd "M-e") 'end-of-defun)
) )
) )
@ -330,16 +327,21 @@ your document embeds raster graphics."
;; Python ;; Python
;;============================================================================== ;;==============================================================================
(defcustom python-compiler "python"
"Python compiler."
:safe 'stringp)
(add-hook (add-hook
'python-mode-hook 'python-mode-hook
(lambda () (lambda ()
(defun python-my-compile () (defun python-my-compile ()
"Use compile to run python programs." "Use compile to run python programs."
(interactive) (interactive)
(compile (concat "python " buffer-name)) (compile (concat python-compiler " " buffer-file-name))
) )
(setq compilation-scroll-output t) (setq compilation-scroll-output t)
(local-set-key "\C-c\C-c" 'python-my-compile) (local-set-key "\C-c\C-c" 'python-my-compile)
(local-set-key "\C-c\C-d" 'duplicate-line)
) )
) )