瀏覽代碼

fix prefs for python-mode

pull/1/head
10sr 12 年之前
父節點
當前提交
eed1b05237
共有 1 個文件被更改,包括 27 次插入26 次删除
  1. +27
    -26
      emacs.el

+ 27
- 26
emacs.el 查看文件

@@ -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…
取消
儲存