From: Julien C. <jul...@mo...> - 2021-05-03 11:30:35
|
Hi, First, thanks to the developer team for maintaining this emacs package. I'm using it almost every day. I'm sending this mail because I want to suggest one improvement in the emacsrunregion.m matlab function for being able to use it into a tramp opened file (I'm also doing a lot of remote development on several targets). This improvement is relatively straightforward, it adds the following lines at the beginning of the function : modified toolbox/emacsrunregion.m @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) % Run code from FILE between STARTCHAR and ENDCHAR. % Command sent by Emacs for run-cell & run-region functionality. + % Filter out emacs tramp file path prefix + trampMatch = regexp(file, {'/*:',':/'}); + if (~isempty(trampMatch{1})) + file = file((trampMatch{2}+1):end); + end + if ~exist(file,'file') error('You must save your region into a file accessible by MATLAB process.'); end This way, file tramp path prefixes like "/scp:host@host_ip:" are filtered out and the MATLAB remote shell can find the file without any trouble. How can I submit this pull request ? Do I simply need to commit and push ? *Julien Claisse* |
From: Uwe B. <ou...@ma...> - 2021-05-03 16:06:13
Attachments:
smime.p7s
|
>>> "JCvM" == Julien Claisse via Matlab-emacs-discuss <mat...@li...> writes: Hi Julien, > Hi, > First, thanks to the developer team for maintaining this emacs package. I'm > using it almost every day. Most of the work is done by Eric and John. > I'm sending this mail because I want to suggest one improvement in the > emacsrunregion.m matlab function for being able to use it into a tramp > opened file (I'm also doing a lot of remote development on several targets). > This improvement is relatively straightforward, it adds the following lines > at the beginning of the function : > modified toolbox/emacsrunregion.m > @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) > % Run code from FILE between STARTCHAR and ENDCHAR. > % Command sent by Emacs for run-cell & run-region functionality. > + % Filter out emacs tramp file path prefix > + trampMatch = regexp(file, {'/*:',':/'}); > + if (~isempty(trampMatch{1})) > + file = file((trampMatch{2}+1):end); > + end > + > if ~exist(file,'file') > error('You must save your region into a file accessible by MATLAB > process.'); > end > This way, file tramp path prefixes like "/scp:host@host_ip:" are filtered > out and the MATLAB remote shell can find the file without any trouble. That looks ok to me, but since this is Eric's brainchild, I think he should also agree. > How can I submit this pull request ? Do I simply need to commit and push ? Commit and push to where? The main development is done in sourceforge, github is just a mirror. I am not sure whether you have write access to sourceforge I rather think not. I not a huge fan of pull request[1] although I know most people consider it today as a standard. Once we agreed on that patch I can apply it to Master, or Eric for that matter. Regards Uwe Footnotes: [1] I prefer to discuss patches on the mailing list and then apply them or to give a person write access to that he/she can push. |
From: Eric L. <eri...@gm...> - 2021-05-04 11:12:44
|
Hi, Thanks Julien for the patch. The nature of this patch seems good to me. The workflow of Emacs and MATLAB on different machines is an interesting one, and it is nice that it can be made to work in such a simple way! Eric On Mon, May 3, 2021 at 12:06 PM Uwe Brauer <ou...@ma...> wrote: > >>> "JCvM" == Julien Claisse via Matlab-emacs-discuss < > mat...@li...> writes: > > Hi Julien, > > > > Hi, > > First, thanks to the developer team for maintaining this emacs package. > I'm > > using it almost every day. > > Most of the work is done by Eric and John. > > > > I'm sending this mail because I want to suggest one improvement in the > > emacsrunregion.m matlab function for being able to use it into a tramp > > opened file (I'm also doing a lot of remote development on several > targets). > > > This improvement is relatively straightforward, it adds the following > lines > > at the beginning of the function : > > > modified toolbox/emacsrunregion.m > > @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) > > % Run code from FILE between STARTCHAR and ENDCHAR. > > % Command sent by Emacs for run-cell & run-region functionality. > > > + % Filter out emacs tramp file path prefix > > + trampMatch = regexp(file, {'/*:',':/'}); > > + if (~isempty(trampMatch{1})) > > + file = file((trampMatch{2}+1):end); > > + end > > + > > if ~exist(file,'file') > > error('You must save your region into a file accessible by > MATLAB > > process.'); > > end > > > This way, file tramp path prefixes like "/scp:host@host_ip:" are > filtered > > out and the MATLAB remote shell can find the file without any trouble. > > > That looks ok to me, but since this is Eric's brainchild, > I think he should also agree. > > > > How can I submit this pull request ? Do I simply need to commit and push > ? > > Commit and push to where? > > The main development is done in sourceforge, github is just a mirror. I > am not sure whether you have write access to sourceforge I rather think > not. > I not a huge fan of pull request[1] although I know most people consider it > today as a standard. > > Once we agreed on that patch I can apply it to Master, or Eric for that > matter. > > Regards > > Uwe > > Footnotes: > [1] I prefer to discuss patches on the mailing list and then apply them > or to give a person write access to that he/she can push. > > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > |
From: Julien C. <jul...@mo...> - 2021-05-04 13:09:07
|
Hi Eric, Thanks for the feedback and your nice emacs package. Yes, even if there are still missing features, TRAMP works really well and I think there is not a lot of work for having almost all features of your emacs package which work under it. I will let you know about other patches as I come across issues. Regards, Julien Le mar. 4 mai 2021 à 13:12, Eric Ludlam <eri...@gm...> a écrit : > Hi, > > Thanks Julien for the patch. > > The nature of this patch seems good to me. The workflow of Emacs and > MATLAB on different machines is an interesting one, and it is nice that it > can be made to work in such a simple way! > > Eric > > On Mon, May 3, 2021 at 12:06 PM Uwe Brauer <ou...@ma...> wrote: > >> >>> "JCvM" == Julien Claisse via Matlab-emacs-discuss < >> mat...@li...> writes: >> >> Hi Julien, >> >> >> > Hi, >> > First, thanks to the developer team for maintaining this emacs package. >> I'm >> > using it almost every day. >> >> Most of the work is done by Eric and John. >> >> >> > I'm sending this mail because I want to suggest one improvement in the >> > emacsrunregion.m matlab function for being able to use it into a tramp >> > opened file (I'm also doing a lot of remote development on several >> targets). >> >> > This improvement is relatively straightforward, it adds the following >> lines >> > at the beginning of the function : >> >> > modified toolbox/emacsrunregion.m >> > @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) >> > % Run code from FILE between STARTCHAR and ENDCHAR. >> > % Command sent by Emacs for run-cell & run-region functionality. >> >> > + % Filter out emacs tramp file path prefix >> > + trampMatch = regexp(file, {'/*:',':/'}); >> > + if (~isempty(trampMatch{1})) >> > + file = file((trampMatch{2}+1):end); >> > + end >> > + >> > if ~exist(file,'file') >> > error('You must save your region into a file accessible by >> MATLAB >> > process.'); >> > end >> >> > This way, file tramp path prefixes like "/scp:host@host_ip:" are >> filtered >> > out and the MATLAB remote shell can find the file without any trouble. >> >> >> That looks ok to me, but since this is Eric's brainchild, >> I think he should also agree. >> >> >> > How can I submit this pull request ? Do I simply need to commit and >> push ? >> >> Commit and push to where? >> >> The main development is done in sourceforge, github is just a mirror. I >> am not sure whether you have write access to sourceforge I rather think >> not. >> I not a huge fan of pull request[1] although I know most people consider >> it >> today as a standard. >> >> Once we agreed on that patch I can apply it to Master, or Eric for that >> matter. >> >> Regards >> >> Uwe >> >> Footnotes: >> [1] I prefer to discuss patches on the mailing list and then apply them >> or to give a person write access to that he/she can push. >> >> _______________________________________________ >> Matlab-emacs-discuss mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss >> > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss > -- Cordialement, Kind regards *Julien Claisse* Software Engineer *Moduleus S.A.S,* 34 rue Pierre et Marie Curie 37100 Tours, France +33 (0)2 47 49 08 16 <+33%202%2047%2049%2008%2016> www.moduleus.com |
From: Uwe B. <ou...@ma...> - 2021-05-04 12:57:09
Attachments:
smime.p7s
|
>>> "EL" == Eric Ludlam <eri...@gm...> writes: > Hi, > Thanks Julien for the patch. > The nature of this patch seems good to me. The workflow of Emacs and > MATLAB on different machines is an interesting one, and it is nice that it > can be made to work in such a simple way! Ok then. I apply his patch to master and push. |
From: Uwe B. <ou...@ma...> - 2021-05-04 13:12:44
Attachments:
smime.p7s
|
>>> "JCvM" == Julien Claisse via Matlab-emacs-discuss <mat...@li...> writes: > Hi, > First, thanks to the developer team for maintaining this emacs package. I'm > using it almost every day. > I'm sending this mail because I want to suggest one improvement in the > emacsrunregion.m matlab function for being able to use it into a tramp > opened file (I'm also doing a lot of remote development on several targets). > This improvement is relatively straightforward, it adds the following lines > at the beginning of the function : > modified toolbox/emacsrunregion.m > @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) > % Run code from FILE between STARTCHAR and ENDCHAR. > % Command sent by Emacs for run-cell & run-region functionality. > + % Filter out emacs tramp file path prefix > + trampMatch = regexp(file, {'/*:',':/'}); > + if (~isempty(trampMatch{1})) > + file = file((trampMatch{2}+1):end); > + end > + > if ~exist(file,'file') > error('You must save your region into a file accessible by MATLAB > process.'); > end The patch is damaged by the MTA, could you please send it again, as an attachment? |
From: Julien C. <jul...@mo...> - 2021-05-04 14:38:06
Attachments:
emacsrunregiontramp.patch
|
Sure, here it is. Regards Julien Le mar. 4 mai 2021 à 15:12, Uwe Brauer <ou...@ma...> a écrit : > >>> "JCvM" == Julien Claisse via Matlab-emacs-discuss < > mat...@li...> writes: > > > Hi, > > First, thanks to the developer team for maintaining this emacs package. > I'm > > using it almost every day. > > > I'm sending this mail because I want to suggest one improvement in the > > emacsrunregion.m matlab function for being able to use it into a tramp > > opened file (I'm also doing a lot of remote development on several > targets). > > > This improvement is relatively straightforward, it adds the following > lines > > at the beginning of the function : > > > modified toolbox/emacsrunregion.m > > @@ -2,6 +2,12 @@ function emacsrunregion(file, startchar, endchar) > > % Run code from FILE between STARTCHAR and ENDCHAR. > > % Command sent by Emacs for run-cell & run-region functionality. > > > + % Filter out emacs tramp file path prefix > > + trampMatch = regexp(file, {'/*:',':/'}); > > + if (~isempty(trampMatch{1})) > > + file = file((trampMatch{2}+1):end); > > + end > > + > > if ~exist(file,'file') > > error('You must save your region into a file accessible by > MATLAB > > process.'); > > end > > The patch is damaged by the MTA, could you please send it again, as an > attachment? > -- Cordialement, Kind regards *Julien Claisse* Software Engineer *Moduleus S.A.S,* 34 rue Pierre et Marie Curie 37100 Tours, France +33 (0)2 47 49 08 16 <+33%202%2047%2049%2008%2016> www.moduleus.com |
From: Uwe B. <ou...@ma...> - 2021-05-04 14:45:28
Attachments:
smime.p7s
|
>>> "JC" == Julien Claisse <jul...@mo...> writes: > Sure, here it is. > Regards > Julien Thanks, applied, committed and pushed. I realized that I have not pushed to the github mirror for a while: however little has been changed on master, most of the commits where on the new branches, which BTW, I could/should merge to master? |
From: Julien C. <jul...@mo...> - 2021-05-04 16:06:23
|
Awesome, thanks! I'm using doom emacs and it seems that doom fetches it from sourceforge : jc@localhost:matlab-mode$ git remote -v origin https://git.code.sf.net/p/matlab-emacs/src (fetch) So yes, I think you can. Julien Le mar. 4 mai 2021 à 16:45, Uwe Brauer <ou...@ma...> a écrit : > >>> "JC" == Julien Claisse <jul...@mo...> writes: > > > Sure, here it is. > > Regards > > Julien > > Thanks, applied, committed and pushed. > > > I realized that I have not pushed to the github mirror for a while: > however little has been changed on master, most of the commits where on > the new branches, which BTW, I could/should merge to master? > -- Cordialement, Kind regards *Julien Claisse* Software Engineer *Moduleus S.A.S,* 34 rue Pierre et Marie Curie 37100 Tours, France +33 (0)2 47 49 08 16 <+33%202%2047%2049%2008%2016> www.moduleus.com |