comparison lisp/progmodes/python.el @ 54838:6072018b576e

(run-python): Use compilation-shell-minor-mode. Set compilation-error-regexp-alist earlier.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 13 Apr 2004 16:05:36 +0000
parents 9d1d7f062a4f
children 3768540a819c
comparison
equal deleted inserted replaced
54837:496ddc14c1a0 54838:6072018b576e
1060 (inferior-python-mode) 1060 (inferior-python-mode)
1061 (setq comint-output-filter-functions nil))) 1061 (setq comint-output-filter-functions nil)))
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.
1086 Selects Comint or Compilation mode command as appropriate." 1072 Selects Comint or Compilation mode command as appropriate."
1087 (interactive "e") 1073 (interactive "e")