mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-28 07:44:49 +00:00
fixed some weird long-prompt issues with shell comint buffer
This commit is contained in:
parent
2dea1ea367
commit
9623b16914
@ -122,12 +122,18 @@ last statement in BODY."
|
||||
;; (message (format "split-results=%S" (mapcar #'org-babel-trim (split-string string-buffer comint-prompt-regexp)))) ;; debugging
|
||||
;; split results with `comint-prompt-regexp'
|
||||
(setq results (cdr (member org-babel-shell-eoe-output
|
||||
(reverse (mapcar #'org-babel-trim (split-string string-buffer comint-prompt-regexp))))))
|
||||
;; (message (format "processed-results=%S" results)) ;; debugging
|
||||
(reverse (mapcar #'org-babel-shell-strip-weird-long-prompt
|
||||
(mapcar #'org-babel-trim (split-string string-buffer comint-prompt-regexp)))))))
|
||||
(message (replace-regexp-in-string "%" "%%" (format "processed-results=%S" results))) ;; debugging
|
||||
(or (case result-type
|
||||
(output (org-babel-trim (mapconcat #'org-babel-trim (reverse results) "\n")))
|
||||
(value (car results))
|
||||
(t (reverse results))) ""))))
|
||||
|
||||
(defun org-babel-shell-strip-weird-long-prompt (string)
|
||||
(while (string-match "^% +[\r\n$]+ *" string)
|
||||
(setq string (substring string (match-end 0))))
|
||||
string)
|
||||
|
||||
(provide 'org-babel-shell)
|
||||
;;; org-babel-shell.el ends here
|
||||
|
@ -641,6 +641,7 @@ echo $WHAT
|
||||
: patton
|
||||
|
||||
**** TODO R
|
||||
|
||||
*** TODO function to bring up inferior-process buffer
|
||||
|
||||
This should be callable from inside of a source-code block in an
|
||||
|
Loading…
Reference in New Issue
Block a user