I was having an issue with `matlab-shell-collect-commmand-output' not deleting
the output of emacsdocomplete (or any matlab command), leaving shell completion
broken. I found out it was happening because I had the variable
`comint-prompt-read-only' set to t.

While investigating that issue, I saw this comment in the function
`matlab-shell-collect-command-output':

> Ideally there would be some way to prevent the *MATLAB* buffer from refreshing
> as we are interacting with it, but I couldn't figure out a way to do that.

One potential way to prevent the buffer from refreshing is using the function
`comint-redirect-results-list'. So, the function mentioned above can be
implemented like this:


(defun matlab-shell-collect-command-output (command)
  "Send COMMAND to matlab process and silently capture output."
  (car (comint-redirect-results-list command "\\(?:.\\|\n\\)*" 0)))


As a bonus, no more issues with read-only prompts.

Regards,
Thiago


_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to