Re: [Matlab-emacs-discuss] Removing extra lines from collect-command-output

2017-11-13 Thread Eric Ludlam
Thanks Nate.

Hopefully this works for Uwe for merge/test.

Eric

From: Nathaniel Chodosh [mailto:nchod...@andrew.cmu.edu]
Sent: Wednesday, November 08, 2017 12:56 PM
To: Eric Ludlam 
Cc: matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] Removing extra lines from 
collect-command-output

Hi,
Here's the patch files, sorry I didn't know what the usual format was. You 
should just be able to pipe them into 'patch'.
-Nate
On Fri, Nov 3, 2017 at 10:41 AM Eric Ludlam 
mailto:eric.lud...@mathworks.com>> wrote:
Hi Nate,

Could your provide a diff that provides context (a context diff) ?  It isn’t 
clear how to merge the patch into code where the line numbers may have changed. 
 Ideally, the diff could be intput into the ‘patch’ command.

Thanks
Eric

From: nchodosh [mailto:nchod...@andrew.cmu.edu]
Sent: Tuesday, October 17, 2017 11:44 AM

To: Eric Ludlam mailto:eric.lud...@mathworks.com>>; 
matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] Removing extra lines from 
collect-command-output

Hi,

Sorry about the delay, I had a busy few weeks. Here's the diff for matlab.el, I 
also included one for company-matlab-shell.el which enables predictions while 
editing the middle of a line.

Best,
Nate

On Tue, Oct 3, 2017 at 3:24 PM Eric Ludlam 
mailto:eric.lud...@mathworks.com>> wrote:
Ah, this is a good reminder I need to poke the source forge site to point at 
the new github location that Uwe is using.

Start with the mailing list.  I’m not sure what process would work best for Uwe.

Eric

From: Nathaniel Chodosh 
[mailto:nchod...@andrew.cmu.edu]
Sent: Tuesday, October 03, 2017 1:18 PM

To: Eric Ludlam mailto:eric.lud...@mathworks.com>>; 
matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] Removing extra lines from 
collect-command-output

Great. I've never contributed to a sourceforge project, should I post the diff 
under patches?

On Tue, Oct 3, 2017 at 12:59 PM Eric Ludlam 
mailto:eric.lud...@mathworks.com>> wrote:
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 mailto: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 
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]
Sent: Monday, October 02, 2017 1:27 PM
To: 
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


Re: [Matlab-emacs-discuss] Removing extra lines from collect-command-output

2017-11-13 Thread Uwe Brauer
>>> "Eric" == Eric Ludlam  writes:

   > Thanks Nate.
   > Hopefully this works for Uwe for merge/test.

Hi

I don't see any patch attached.
There are several way to produce the patch.

The simplest would be

 diff -u old.el new.el 
 or
 diff -c old.el New.el 

I'd prefer -u but -c should be fine.

If you use mercurial :-D , you could do
 hg export tip

Or with git :'(
git format-patch HEAD~1

Uwe 


--
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


Re: [Matlab-emacs-discuss] Removing extra lines from collect-command-output

2017-11-13 Thread Eric Ludlam
Hi Uwe,

Are you not getting email from the matlab-emacs-discuss mailing list?

I'm re-attaching the diffs to this email.
Eric

-Original Message-
From: Uwe Brauer [mailto:o...@mat.ucm.es] 
Sent: Monday, November 13, 2017 1:45 PM
To: Eric Ludlam 
Cc: Nathaniel Chodosh ; Uwe Brauer ; 
matlab-emacs-discuss@lists.sourceforge.net
Subject: Re: [Matlab-emacs-discuss] Removing extra lines from 
collect-command-output

>>> "Eric" == Eric Ludlam  writes:

   > Thanks Nate.
   > Hopefully this works for Uwe for merge/test.

Hi

I don't see any patch attached.
There are several way to produce the patch.

The simplest would be

 diff -u old.el new.el 
 or
 diff -c old.el New.el 

I'd prefer -u but -c should be fine.

If you use mercurial :-D , you could do
 hg export tip

Or with git :'(
git format-patch HEAD~1

Uwe 



matlab.patch
Description: matlab.patch


company-matlab-shell.patch
Description: company-matlab-shell.patch
--
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


Re: [Matlab-emacs-discuss] Removing extra lines from collect-command-output

2017-11-13 Thread Uwe Brauer
>>> "Eric" == Eric Ludlam  writes:

   > Hi Uwe,
   > Are you not getting email from the matlab-emacs-discuss mailing list?

That is odd indeed.
   > I'm re-attaching the diffs to this email.

Hm does not work. This time patch did not refuse it outright as last
time but I obtain.
Hunk #1 FAILED at 24.
1 out of 1 hunk FAILED -- saving rejects to file company-matlab-shell.el.rej

And similar for matlab.el

Ok I see what happens (and why I hate git).
In the official repos
github
sf

The last commit is mine.

Git log gives

commit 3b3c48ac0c27039e0bef89c643f0ee4c0b53d3d0
Author: Uwe Brauer 
Date:   Fri Sep 2 11:59:06 2016 +

* tlc.el: Add space to
;;;###autoload(add-to-list 'auto-mode-alist '("\\.tlc$" .tlc-mode))
 ^^^
thanks to John Ciolfi

However in my local repos I still have three commits
by John Ciolfi, namely (using hg)


  changeset:   167:ea809ae422ac
|  bookmark:proposed_changes
|  tag: tip
|  user:John Ciolfi 
|  date:Tue Oct 18 10:18:15 2016 -0400
|  summary: Added custom completions, fixed typos
|
o  changeset:   166:0d6ad456b544
|  user:John Ciolfi 
|  date:Mon Oct 10 20:43:17 2016 -0400
|  summary: matlab-load.el is a generated file
|
o  changeset:   165:96cee86a0430
|  user:John Ciolfi 
|  date:Mon Oct 10 20:39:21 2016 -0400
|  summary: Fixed TAB completion, debugging updates, warning fixes

which sit as I understand in the branch (bookmark in hg speach)
proposed_changes. (That I would have failed to identify that these 3
commits belong to a different branch would not have happened in
mercurial using named branches, but I don't want to open a flamewar).

I can apply Nathan patch to master but not to the latest commit in that
branch. I think I will commit and push Nathan Changes, and could merge
in later John's changes from his branch.

Did anybody try out the commits in this branch? I seem now to remember
vaguely an email form him mentioning his changes and that he would put
in a branch. I am not even sure that I tested his changes.

Any thoughts before I push? I might wait a day or so more to hear
opinions. 

Uwe 

--
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