aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2004-04-13 16:05:36 +0000
committerStefan Monnier2004-04-13 16:05:36 +0000
commitf9f25632b33a48f0f01ac024f66fa0eae0cabff1 (patch)
tree33bcc09017b985bd8694cf97e5e71a8d988ce3ae
parent38b9d7d9140b4963f5d86f754d867de29c16ff34 (diff)
downloademacs-f9f25632b33a48f0f01ac024f66fa0eae0cabff1.tar.gz
emacs-f9f25632b33a48f0f01ac024f66fa0eae0cabff1.zip
(run-python): Use compilation-shell-minor-mode.
Set compilation-error-regexp-alist earlier.
-rw-r--r--lisp/progmodes/python.el20
1 files changed, 3 insertions, 17 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 1028e937924..ee752f78352 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1062,24 +1062,10 @@ def _emacs_execfile (file):
1062 (setq python-command cmd) 1062 (setq python-command cmd)
1063 (setq python-buffer "*Python*") 1063 (setq python-buffer "*Python*")
1064 (pop-to-buffer "*Python*") 1064 (pop-to-buffer "*Python*")
1065 (compilation-minor-mode 1)
1066 (add-hook 'comint-input-filter-functions 'python-input-filter nil t)
1067 ;; Avoid clobbering comint bindings.
1068 (set (make-local-variable 'minor-mode-overriding-map-alist)
1069 `((compilation-minor-mode
1070 . ,(let ((map (make-sparse-keymap)))
1071 ;; It would be useful to put keymap properties on the
1072 ;; error lines so that we could use RET and mouse-2 on
1073 ;; them directly. These bindings will only DTRT with
1074 ;; the font-lock-style compilation mode.
1075 (define-key map [mouse-2] #'python-mouse-2-command)
1076 (define-key map "\C-m" #'python-RET-command)
1077 (if (boundp 'compilation-menu-map)
1078 (define-key map [menu-bar compilation]
1079 (cons "Errors" compilation-menu-map)))
1080 map))))
1081 (set (make-local-variable 'compilation-error-regexp-alist) 1065 (set (make-local-variable 'compilation-error-regexp-alist)
1082 python-compilation-regexp-alist)) 1066 python-compilation-regexp-alist)
1067 (compilation-shell-minor-mode 1)
1068 (add-hook 'comint-input-filter-functions 'python-input-filter nil t))
1083 1069
1084(defun python-mouse-2-command (event) 1070(defun python-mouse-2-command (event)
1085 "Command bound to `mouse-2' in inferior Python buffer. 1071 "Command bound to `mouse-2' in inferior Python buffer.