Browse Source

fix prefs for python-mode

pull/1/head
10sr 12 years ago
parent
commit
eed1b05237
1 changed files with 27 additions and 26 deletions
  1. +27
    -26
      emacs.el

+ 27
- 26
emacs.el View File

@@ -964,33 +964,34 @@ delete; o: select other; j, l: enlarge; h, k: shrink; q: quit."
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; python

(setq python-python-command (or (executable-find "python3")
(executable-find "python")))
(defun my-python-run-as-command ()
""
(interactive)
(shell-command (concat python-python-command " " buffer-file-name)))
(defun my-python-display-python-buffer ()
""
(interactive)
(set-window-text-height (display-buffer python-buffer
t)
7))
(add-hook 'python-mode-hook
(lambda ()
(define-key python-mode-map
(kbd "C-c C-e") 'my-python-run-as-command)
(define-key python-mode-map
(kbd "C-c C-b") 'my-python-display-python-buffer)
(define-key python-mode-map (kbd "C-m") 'newline-and-indent)))
(when (lazy-load-eval 'python '(python-mode))
(setq python-python-command (or (executable-find "python3")
(executable-find "python")))
(defun my-python-run-as-command ()
""
(interactive)
(shell-command (concat python-python-command " " buffer-file-name)))
(defun my-python-display-python-buffer ()
""
(interactive)
(set-window-text-height (display-buffer python-buffer
t)
7))
(add-hook 'python-mode-hook
(lambda ()
(define-key python-mode-map
(kbd "C-c C-e") 'my-python-run-as-command)
(define-key python-mode-map
(kbd "C-c C-b") 'my-python-display-python-buffer)
(define-key python-mode-map (kbd "C-m") 'newline-and-indent)))

(add-hook 'inferior-python-mode-hook
(lambda ()
(my-python-display-python-buffer)
(define-key inferior-python-mode-map
(kbd "<up>") 'comint-previous-input)
(define-key inferior-python-mode-map
(kbd "<down>") 'comint-next-input)))
(add-hook 'inferior-python-mode-hook
(lambda ()
(my-python-display-python-buffer)
(define-key inferior-python-mode-map
(kbd "<up>") 'comint-previous-input)
(define-key inferior-python-mode-map
(kbd "<down>") 'comint-next-input))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; GNU GLOBAL(gtags)


Loading…
Cancel
Save