added single-buffer ctrl+enter Python halt

This commit is contained in:
Darren Ranalli 2007-02-08 05:36:11 +00:00
parent 1c6caa4e55
commit facf4c95e5

View File

@ -585,6 +585,7 @@ support for features needed by `python-mode'.")
;; VR STUDIO ENHANCEMENTS
(define-key py-shell-map "\C-d" 'comint-delchar-or-maybe-python-resume)
(define-key py-shell-map [return] 'comint-interrupt-subjob-or-maybe-return)
(define-key py-shell-map [C-return] 'comint-interrupt-subjob-or-maybe-return-curbuf)
(define-key py-shell-map "\C-c\C-r" 'python-resume)
(define-key py-shell-map "\C-c\C-s" 'pyd-shell)
(define-key py-shell-map "\C-c\C-f" 'py-kill-shells)
@ -3421,6 +3422,33 @@ These are Python temporary files awaiting execution."
)
)
(defun comint-interrupt-subjob-or-maybe-return-curbuf (arg)
"Enter a return (comint-send-input) or send a comint-interrupt-subjob
if point is at the end of the buffer and there is no input"
(interactive "p")
(let ((proc (get-buffer-process (current-buffer))))
(if (and (eobp) proc (= (point) (marker-position (process-mark proc))))
(let ((current (point)))
(goto-char (- current 4))
(if (or (search-forward ">>> " current t)
(search-forward "... " current t))
(comint-send-input)
(save-current-buffer
(goto-char current)
(let ((procbuf (process-buffer proc)))
(set-buffer procbuf)
(goto-char (point-max))
(if (and (eobp) proc (= (point) (marker-position (process-mark proc))))
(comint-interrupt-subjob))
)
)
)
)
(comint-send-input)
)
)
)
(defun py-point-to-max (proc)
;; updates the cursor position of a buffer for all windows
;; into that buffer