Sounds reasonable to me.

When you are happy with your changes, post a diff and hopefully Uwe can install 
it.

Thanks
Eric

From: Nathaniel Chodosh [mailto:nchod...@andrew.cmu.edu]
Sent: Tuesday, October 03, 2017 12:26 PM
To: Eric Ludlam <eric.lud...@mathworks.com>; 
matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] Removing extra lines from 
collect-command-output

That's what I thought the purpose of the newline is, but the documentation for 
comint-simple-send states that it automatically appends a newline to the 
command, so it's not needed.
As an aside I think that in the current version of emacs the while loop in the 
same function needs to be wrapped in a with-local-quit to avoid raising an 
error (or at least the accept-process-output call does).
Best,
Nate

On Mon, Oct 2, 2017 at 4:14 PM Eric Ludlam 
<eric.lud...@mathworks.com<mailto:eric.lud...@mathworks.com>> wrote:
I wrote that a long time ago, but my vague recollection is that the newline was 
needed to make the subprocess execute the command.  Is it adding a 2nd newline 
to the end of ‘command’ resulting in the spare line?

Eric

From: Nathaniel Chodosh 
[mailto:nchod...@andrew.cmu.edu<mailto:nchod...@andrew.cmu.edu>]
Sent: Monday, October 02, 2017 1:27 PM
To: 
matlab-emacs-discuss@lists.sourceforge.net<mailto:matlab-emacs-discuss@lists.sourceforge.net>
Subject: [Matlab-emacs-discuss] Removing extra lines from collect-command-output

Hello,
I've noticed that calling 'matlab-shell-collect-command-output' can result in 
extra new lines being sent to the *MATLAB* buffer which aren't deleted. When 
using company-mode to complete text this behavior is pretty annoying since as 
I'm typing lines are being inserted above the prompt. I believe that the cause 
of this is the line:
(comint-simple-send (get-buffer-process (current-buffer))
              (concat command "\n"))
The newline added to the end of the command causes an extra line to be printed 
since it's interpreted as execute 'command' and then send a newline. Removing 
the newline fixes the problem.
This seems like a suspiciously simple fix so I'm wondering why the newline was 
being appended to the command.
Thanks,
Nate
P.S I am new to using mailing lists so if I've committed any faux pas in this 
email please let me know
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to