From: Uwe B. <ou...@ma...> - 2024-05-15 07:20:30
Attachments:
smime.p7s
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: Hi > A few pointers: > The main features that the new minor-mode enables are: > * It redefines the page-break character to "%%" so an overline is > drawn over those, making it visually look better. > * The current cell that point is in is highlighted by being boldfaced > (this is customizable). > * Convenience functions for moving point forward and backward by one > cell (also support being called with prefix arguments). > * Convenience functions for moving a cell up or down by a block > (number-prefixes supported too). After a very very brief testing, some comments: 1. Could you please include matlab-cell in the Makefile? 2. So I understand your code does not generalise in any way matlab-shell-run-cell? > * Some more non-interactive convenience functions to help development. > * I've not bound any of the functions to any keymap within the package > yet. > In my config though, these are the bindings I'm using (in case > someone's interested): > ("C-v" . 'matlab-cell-forward-cell) > ("M-v" . 'matlab-cell-backward-cell) > ("C-<return>" . matlab-shell-run-cell) > ("C-c C-b" . (lambda () (interactive) > (save-window-excursion > (matlab-shell-run-cell)) > (matlab-cell-forward-cell))) > ("C-x n c" . 'matlab-cell-narrow-to-cell) > ("M-[" . 'backward-paragraph) > ("M-]" . 'forward-paragraph) > ("C-c <down>" . 'matlab-cell-move-cell-down) > ("C-c <up>" . 'matlab-cell-move-cell-up) > I'll appreciate comments and suggestions! :) Could you maybe enhance the documentation of matlab-cell-mode, for example describe the navigation functions. The keyb binding is something we might discuss later Thanks for the code Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-15 07:57:11
|
>>>> "NNB" == Nidish Narayanaa Balaji<nid...@il...> writes: > Hi > > >> A few pointers: > >> The main features that the new minor-mode enables are: >> * It redefines the page-break character to "%%" so an overline is >> drawn over those, making it visually look better. >> * The current cell that point is in is highlighted by being boldfaced >> (this is customizable). >> * Convenience functions for moving point forward and backward by one >> cell (also support being called with prefix arguments). >> * Convenience functions for moving a cell up or down by a block >> (number-prefixes supported too). > After a very very brief testing, some comments: > > 1. Could you please include matlab-cell in the Makefile? > > 2. So I understand your code does not generalise in any way > matlab-shell-run-cell? 1. Done. I've added it to the lisp_LISP variable in the Makefile and can confirm that it builds fine. 2. This is correct. I found no reason to rewrite matlab-shell-run-cell since it works fine as is. Let me know if you feel otherwise. >> * Some more non-interactive convenience functions to help development. >> * I've not bound any of the functions to any keymap within the package >> yet. >> In my config though, these are the bindings I'm using (in case >> someone's interested): >> ("C-v" . 'matlab-cell-forward-cell) >> ("M-v" . 'matlab-cell-backward-cell) >> ("C-<return>" . matlab-shell-run-cell) >> ("C-c C-b" . (lambda () (interactive) >> (save-window-excursion >> (matlab-shell-run-cell)) >> (matlab-cell-forward-cell))) >> ("C-x n c" . 'matlab-cell-narrow-to-cell) >> ("M-[" . 'backward-paragraph) >> ("M-]" . 'forward-paragraph) >> ("C-c <down>" . 'matlab-cell-move-cell-down) >> ("C-c <up>" . 'matlab-cell-move-cell-up) >> I'll appreciate comments and suggestions! :) > Could you maybe enhance the documentation of matlab-cell-mode, for > example describe the navigation functions. Okay - I've added a short writeup under the "Commentary" section in matlab-cell.el. Let me know if this is what you had in mind. > The keyb binding is something we might discuss later > > Thanks for the code > > Uwe Thanks for taking a look! Nidish |
From: Uwe B. <ou...@ma...> - 2024-05-15 11:28:35
Attachments:
smime.p7s
|
> 1. Done. I've added it to the lisp_LISP variable in the Makefile and > can confirm that it builds fine. > 2. This is correct. I found no reason to rewrite matlab-shell-run-cell > since it works fine as is. Let me know if you feel otherwise. It still works fine, well with one exception at least for me, a cell must end with an empty new line. For example %% t=0:0.1:1 x=sin(t) %% Does not work while %% t=0:0.1:1 x=sin(t) %% does > Okay - I've added a short writeup under the "Commentary" section in > matlab-cell.el. Let me know if this is what you had in mind. Well I thought of including in the docstring of matlab-cell-mode But maybe this just me but I use `C-h m' quite a bit. Not sure I can do real testing today, but hopefully tomorrow. Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-15 11:53:19
|
> > 1. Done. I've added it to the lisp_LISP variable in the Makefile and > > can confirm that it builds fine. > > > 2. This is correct. I found no reason to rewrite matlab-shell-run-cell > > since it works fine as is. Let me know if you feel otherwise. > > It still works fine, well with one exception at least for me, a cell > must end with an empty new line. For example > > %% > t=0:0.1:1 > x=sin(t) > %% > > Does not work while > > %% > t=0:0.1:1 > x=sin(t) > > %% > > does Yes this is true. This seems to be a restriction from matlab-shell-run-cell. I guess I'll just write a matlab-cell-shell-run-cell function that's more neatly integrated within the matlab-cell minor-mode. The real restriction with matlab-cell is that I'm assuming that the cell header is "%%" followed by at least a space character - if there's no character right after the "%%", then this is not recognized as a cell header. This comes from the matlab-cell-cellbreak-regexp variable (which can be customized, of course). I will change it to default to not requiring the space character after the "%%" since this makes more sense. > > Okay - I've added a short writeup under the "Commentary" section in > > matlab-cell.el. Let me know if this is what you had in mind. > > Well I thought of including in the docstring of matlab-cell-mode > > But maybe this just me but I use `C-h m' quite a bit. I've added the list of navigation functions to the docstring. > > Not sure I can do real testing today, but hopefully tomorrow. > > Uwe > I'll try to have the above edits done by then! Thanks! Nidish |
From: Uwe B. <ou...@ma...> - 2024-05-15 11:58:45
Attachments:
smime.p7s
|
> Yes this is true. This seems to be a restriction from > matlab-shell-run-cell. I guess I'll just write a > matlab-cell-shell-run-cell function that's more neatly integrated > within the matlab-cell minor-mode. I remember of having discussions with Eric, when that feature was implemented, but alas I don't recall any details. > The real restriction with matlab-cell is that I'm assuming that the > cell header is "%%" followed by at least a space character - if > there's no character right after the "%%", then this is not recognized > as a cell header. This comes from the matlab-cell-cellbreak-regexp > variable (which can be customized, of course). But that seems fine to me, because that is (or at least was till recently) the convention of the native matlab editor. > I will change it to default to not requiring the space character after > the "%%" since this makes more sense. > I've added the list of navigation functions to the docstring. > I'll try to have the above edits done by then! Thanks, I just saw it. More testing, later Thanks Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-15 18:36:33
|
I just finished the edits and pushed them. 1. I've defined a 'matlab-cell-shell-run-cell' function in matlab-cell.el which basically calls 'matlab-shell-run-region' from matlab-shell.el with the appropriate bounds of the current point. 2. I also simplified the cellbreak regexp to: (rx line-start (* space) (group "%%" (* (not (any "\n"))) line-end)) This evaluates to: "^[[:space:]]*\\(%%.*$\\)" As mentioned before, I've removed the requirement of having a blank-space character after "%%" since I think this is more intuitive. 3. I also refreshed 'matlab-load.el'. Best, Nidish On 5/15/24 13:58, Uwe Brauer wrote: > >> Yes this is true. This seems to be a restriction from >> matlab-shell-run-cell. I guess I'll just write a >> matlab-cell-shell-run-cell function that's more neatly integrated >> within the matlab-cell minor-mode. > I remember of having discussions with Eric, when that feature was > implemented, but alas I don't recall any details. > > >> The real restriction with matlab-cell is that I'm assuming that the >> cell header is "%%" followed by at least a space character - if >> there's no character right after the "%%", then this is not recognized >> as a cell header. This comes from the matlab-cell-cellbreak-regexp >> variable (which can be customized, of course). > But that seems fine to me, because that is (or at least was till > recently) the convention of the native matlab editor. > > >> I will change it to default to not requiring the space character after >> the "%%" since this makes more sense. >> I've added the list of navigation functions to the docstring. >> I'll try to have the above edits done by then! > > Thanks, I just saw it. More testing, later > > Thanks > > Uwe > > |
From: Uwe B. <ou...@ma...> - 2024-05-16 06:44:25
Attachments:
smime.p7s
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > I just finished the edits and pushed them. > 1. I've defined a 'matlab-cell-shell-run-cell' function in > matlab-cell.el which basically calls 'matlab-shell-run-region' from > matlab-shell.el with the appropriate bounds of the current point. > 2. I also simplified the cellbreak regexp to: (rx line-start (* space) > (group "%%" (* (not (any "\n"))) line-end)) > This evaluates to: "^[[:space:]]*\\(%%.*$\\)" > As mentioned before, I've removed the requirement of having a > blank-space character after "%%" since I think this is more intuitive. > 3. I also refreshed 'matlab-load.el'. Thanks. I just pulled, and compiled. I will run test and report back later this evening. Thanks a lot > Best, > Nidish > On 5/15/24 13:58, Uwe Brauer wrote: >> >>> Yes this is true. This seems to be a restriction from >>> matlab-shell-run-cell. I guess I'll just write a >>> matlab-cell-shell-run-cell function that's more neatly integrated >>> within the matlab-cell minor-mode. >> I remember of having discussions with Eric, when that feature was >> implemented, but alas I don't recall any details. >> >> >>> The real restriction with matlab-cell is that I'm assuming that the >>> cell header is "%%" followed by at least a space character - if >>> there's no character right after the "%%", then this is not recognized >>> as a cell header. This comes from the matlab-cell-cellbreak-regexp >>> variable (which can be customized, of course). >> But that seems fine to me, because that is (or at least was till >> recently) the convention of the native matlab editor. >> >> >>> I will change it to default to not requiring the space character after >>> the "%%" since this makes more sense. >>> I've added the list of navigation functions to the docstring. >>> I'll try to have the above edits done by then! >> >> Thanks, I just saw it. More testing, later >> >> Thanks >> >> Uwe >> >> -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-16 08:39:59
|
Wow that's interesting, thanks for noticing! I didn't catch this because I myself use tree-sitter for syntax highlighting and don't use the syntax highlighting from matlab-mode. I have a feeling that something got mixed up when I refreshed the matlab-load.el - I'd recommend retrying by using the matlab-load.el from master to see if that's the issue. I'll also look into this today. Thanks! Nidish On 5/16/24 10:36, Uwe Brauer wrote: >>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: >> I just finished the edits and pushed them. >> 1. I've defined a 'matlab-cell-shell-run-cell' function in >> matlab-cell.el which basically calls 'matlab-shell-run-region' from >> matlab-shell.el with the appropriate bounds of the current point. >> 2. I also simplified the cellbreak regexp to: (rx line-start (* space) >> (group "%%" (* (not (any "\n"))) line-end)) >> This evaluates to: "^[[:space:]]*\\(%%.*$\\)" >> As mentioned before, I've removed the requirement of having a >> blank-space character after "%%" since I think this is more intuitive. >> 3. I also refreshed 'matlab-load.el'. > Hi > > I sometimes mix functions with scripts (that uses cell). > > I noticed that the font-lock for functions does not work anymore using > your branch, even with matlab-cell-mode disabled and even in a function > without cell as the attached screenshots shows. > > I also attach the screenshot with the fontlocking from master. > > Not sure who is the culprit here. > > > Uwe > > |
From: Uwe B. <ou...@ma...> - 2024-05-16 08:49:01
Attachments:
smime.p7s
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Wow that's interesting, thanks for noticing! > I didn't catch this because I myself use tree-sitter for syntax > highlighting and don't use the syntax highlighting from matlab-mode. I have heard about this package but I have never used it myself. > I have a feeling that something got mixed up when I refreshed the > matlab-load.el - I'd recommend retrying by using the matlab-load.el > from master to see if that's the issue. I'll also look into this > today. Right. The strange thing is. 1. The graph is linear 2. Git does not complain when switching branches. 3. But when I use mercurial (and the hg-git plugin) mercurial notices a conflict! 4. So I did what you proposed, but it does not help: one your branch the traditional font-locking is broken. Good that we are testing Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-16 09:09:30
|
> I have heard about this package but I have never used it myself. I highly recommend checking it out! I use tree-sitter-hl for highlighting, and ts-fold for code folding. >> I have a feeling that something got mixed up when I refreshed the >> matlab-load.el - I'd recommend retrying by using the matlab-load.el >> from master to see if that's the issue. I'll also look into this >> today. > > Right. The strange thing is. > > 1. The graph is linear > > 2. Git does not complain when switching branches. > > 3. But when I use mercurial (and the hg-git plugin) mercurial > notices a conflict! > > 4. So I did what you proposed, but it does not help: one your branch > the traditional font-locking is broken. Good that we are testing > > Uwe Strange indeed. Fair enough, I'm happy we're still testing. I'll have more time this evening to do a deep dive (git bisect should help, I guess). I'll let you know if I manage to catch it. Best, Nidish |
From: Nidish N. B. <nid...@il...> - 2024-05-18 10:43:19
|
Okay I've fixed the font-lock issue. Since I adapted the code from a pre-existing package that was meant to be stand-alone, it had some checks in place that were overriding the existing font-lock. I got rid of these and simplified it since we want this to be distributed as part of matlab-mode.el . I've verified that the syntax highlighting now works identical to the master branch. Best, Nidish On 5/16/24 11:09, Nidish Narayanaa Balaji wrote: >> I have heard about this package but I have never used it myself. > I highly recommend checking it out! I use tree-sitter-hl for > highlighting, and ts-fold for code folding. >>> I have a feeling that something got mixed up when I refreshed the >>> matlab-load.el - I'd recommend retrying by using the matlab-load.el >>> from master to see if that's the issue. I'll also look into this >>> today. >> Right. The strange thing is. >> >> 1. The graph is linear >> >> 2. Git does not complain when switching branches. >> >> 3. But when I use mercurial (and the hg-git plugin) mercurial >> notices a conflict! >> >> 4. So I did what you proposed, but it does not help: one your branch >> the traditional font-locking is broken. Good that we are testing >> >> Uwe > > Strange indeed. Fair enough, I'm happy we're still testing. I'll have > more time this evening to do a deep dive (git bisect should help, I > guess). I'll let you know if I manage to catch it. > > Best, > Nidish > > > > _______________________________________________ > Matlab-emacs-discuss mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |
From: Uwe B. <ou...@ma...> - 2024-05-18 20:27:31
Attachments:
smime.p7s
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Okay I've fixed the font-lock issue. > Since I adapted the code from a pre-existing package that was meant to > be stand-alone, it had some checks in place that were overriding the > existing font-lock. I got rid of these and simplified it since we want > this to be distributed as part of matlab-mode.el . > I've verified that the syntax highlighting now works identical to the > master branch. Thanks I just pulled and will have a look. > Best, > Nidish > On 5/16/24 11:09, Nidish Narayanaa Balaji wrote: >>> I have heard about this package but I have never used it myself. >> I highly recommend checking it out! I use tree-sitter-hl for >> highlighting, and ts-fold for code folding. >>> I have a feeling that something got mixed up when I refreshed the >>> matlab-load.el - I'd recommend retrying by using the matlab-load.el >>> from master to see if that's the issue. I'll also look into this >>> today. >>> Right. The strange thing is. >>> >>> 1. The graph is linear >>> >>> 2. Git does not complain when switching branches. >>> >>> 3. But when I use mercurial (and the hg-git plugin) mercurial >>> notices a conflict! >>> >>> 4. So I did what you proposed, but it does not help: one your branch >>> the traditional font-locking is broken. Good that we are testing >>> >>> Uwe >> >> Strange indeed. Fair enough, I'm happy we're still testing. I'll have >> more time this evening to do a deep dive (git bisect should help, I >> guess). I'll let you know if I manage to catch it. >> >> Best, >> Nidish >> >> >> >> _______________________________________________ >> 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 -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Uwe B. <ou...@ma...> - 2024-05-19 06:11:19
Attachments:
smime.p7s
|
>>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Okay I've fixed the font-lock issue. > Since I adapted the code from a pre-existing package that was meant to > be stand-alone, it had some checks in place that were overriding the > existing font-lock. I got rid of these and simplified it since we want > this to be distributed as part of matlab-mode.el . > I've verified that the syntax highlighting now works identical to the > master branch. Right, after a short testing, I can confirm that. Today however I have not much time for further testing, but I would like to run some tests more before merging and maybe somebody else might come back to us. Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: John C. <ci...@ma...> - 2024-05-22 18:07:40
|
Hi I like the idea of speedy navigation of cells. I took a brief look at the matlab-cell branch but wasn't sure what it's supposed to be used for. The first thing I tried was navigating a large cell argument to a function, something like: a = fun( { .... Big cell ....}, {.... Another cell ....}) Where the call to the function spanned many lines. M-x matlab-cell-foward-cell Jumped to the end of the file? Can you share use cases which could be used for testing? As for key bindings, it would be good to put them under C-c (take a look at the C-c C-c CHAR in matlab-cgen.el). Maybe add some additional C-c C-c CHARs? I saw you are using pos-eol instead of point-at-eol. pos-eol is new in Emacs 29, which now means we have a dependency on the compat library. Would be nice to not require that dependency for Emacs 27 and later. Can you use flycheck to cleanup minor issues in the lisp files you've added? Thanks, John ________________________________ From: Uwe Brauer via Matlab-emacs-discuss <mat...@li...> Sent: Sunday, May 19, 2024 2:11 AM To: Nidish Narayanaa Balaji <nid...@il...> Cc: mat...@li... <mat...@li...> Subject: Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] >>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > Okay I've fixed the font-lock issue. > Since I adapted the code from a pre-existing package that was meant to > be stand-alone, it had some checks in place that were overriding the > existing font-lock. I got rid of these and simplified it since we want > this to be distributed as part of matlab-mode.el . > I've verified that the syntax highlighting now works identical to the > master branch. Right, after a short testing, I can confirm that. Today however I have not much time for further testing, but I would like to run some tests more before merging and maybe somebody else might come back to us. Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-05-22 18:18:26
Attachments:
tmp.m
|
Hello John, Thank you for taking a look! By "Cells" I don't mean the matlab cell objects, but rather "code-blocks" delimited by commented lines starting with "%%". I'm attaching a short matlab script that can be used for trying it out. I recommend trying out the following (interactive) functions to get a feel for the additions: 1. Move point to the beginning of the buffer and try out the function `matlab-cell-forward-cell'. This should take you to the next cell (while highlighting). Do it a couple more times to navigate. 2. Then try out the function `matlab-cell-backward-cell'. 3. Go to the third cell and try the function `matlab-cell-move-cell-up'. This should move the contents of this cell to occur before the previous cell. 4. Try out `matlab-cell-move-cell-down' and this action will be reversed. 5. Next (ensure you have matlab-shell running) try out the function `matlab-cell-shell-run-cell' to run the contents of the cell in the shell. I rewrote this based on the matlab-cell environ to be consistent although `matlab-shell-run-cell` does something similar. And yes, I am using pos-bol and pos-eol - my emacs was giving me warnings actually so I changed them. But I did not know that these were only introduced in emacs 29. It makes sense to continue using the older functions - I'll fix it. Thanks for the suggestion on the keybinding, it would make sense to have something based on the convention that doesn't clash with anything else as default. I'll check with flycheck warnings before I push next! :) Best, Nidish On 5/22/24 20:07, John Ciolfi wrote: > Hi > > I like the idea of speedy navigation of cells. > > I took a brief look at the matlab-cell branch but wasn't sure what > it's supposed to be used for. The first thing I tried was navigating a > large cell argument to a function, something like: > > a = fun( { .... Big cell ....}, {.... Another cell ....}) > > Where the call to the function spanned many lines. > > M-x matlab-cell-foward-cell > > Jumped to the end of the file? > > Can you share use cases which could be used for testing? > > As for key bindings, it would be good to put them under C-c (take a > look at the C-c C-c CHAR in matlab-cgen.el). Maybe add some additional > C-c C-c CHARs? > > I saw you are using pos-eol instead of point-at-eol. pos-eol is new in > Emacs 29, which now means we have a dependency on the compat library. > Would be nice to not require that dependency for Emacs 27 and later. > > Can you use flycheck to cleanup minor issues in the lisp files you've > added? > > Thanks, > John > > > ------------------------------------------------------------------------ > *From:* Uwe Brauer via Matlab-emacs-discuss > <mat...@li...> > *Sent:* Sunday, May 19, 2024 2:11 AM > *To:* Nidish Narayanaa Balaji <nid...@il...> > *Cc:* mat...@li... > <mat...@li...> > *Subject:* Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] > >>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> writes: > > > Okay I've fixed the font-lock issue. > > Since I adapted the code from a pre-existing package that was meant to > > be stand-alone, it had some checks in place that were overriding the > > existing font-lock. I got rid of these and simplified it since we want > > this to be distributed as part of matlab-mode.el . > > > I've verified that the syntax highlighting now works identical to the > > master branch. > > Right, after a short testing, I can confirm that. Today however I have > not much time for further testing, but I would like to run some tests > more before merging and maybe somebody else might come back to us. > > Uwe > > -- > I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel > I strongly condemn Putin's war of aggression against Ukraine. > I support to deliver weapons to Ukraine's military. > I support the EU and NATO membership of Ukraine. > |
From: John C. <ci...@ma...> - 2024-05-22 20:21:49
|
Ah - I forgot we call the %% sections "cells". Perhaps a better name would be code sections, https://www.mathworks.com/help/matlab/matlab_prog/create-and-run-sections.html I'll re-look at this soon. Thanks John ________________________________ From: Nidish Narayanaa Balaji <nid...@il...> Sent: Wednesday, May 22, 2024 2:18 PM To: John Ciolfi <ci...@ma...>; Uwe Brauer <ou...@ma...> Cc: mat...@li... <mat...@li...> Subject: Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] Hello John, Thank you for taking a look! By "Cells" I don't mean the matlab cell objects, but rather "code-blocks" delimited by commented lines starting with "%%". I'm attaching a short matlab script that can be used for trying it out. I recommend trying out the following (interactive) functions to get a feel for the additions: 1. Move point to the beginning of the buffer and try out the function `matlab-cell-forward-cell'. This should take you to the next cell (while highlighting). Do it a couple more times to navigate. 2. Then try out the function `matlab-cell-backward-cell'. 3. Go to the third cell and try the function `matlab-cell-move-cell-up'. This should move the contents of this cell to occur before the previous cell. 4. Try out `matlab-cell-move-cell-down' and this action will be reversed. 5. Next (ensure you have matlab-shell running) try out the function `matlab-cell-shell-run-cell' to run the contents of the cell in the shell. I rewrote this based on the matlab-cell environ to be consistent although `matlab-shell-run-cell` does something similar. And yes, I am using pos-bol and pos-eol - my emacs was giving me warnings actually so I changed them. But I did not know that these were only introduced in emacs 29. It makes sense to continue using the older functions - I'll fix it. Thanks for the suggestion on the keybinding, it would make sense to have something based on the convention that doesn't clash with anything else as default. I'll check with flycheck warnings before I push next! :) Best, Nidish On 5/22/24 20:07, John Ciolfi wrote: Hi I like the idea of speedy navigation of cells. I took a brief look at the matlab-cell branch but wasn't sure what it's supposed to be used for. The first thing I tried was navigating a large cell argument to a function, something like: a = fun( { .... Big cell ....}, {.... Another cell ....}) Where the call to the function spanned many lines. M-x matlab-cell-foward-cell Jumped to the end of the file? Can you share use cases which could be used for testing? As for key bindings, it would be good to put them under C-c (take a look at the C-c C-c CHAR in matlab-cgen.el). Maybe add some additional C-c C-c CHARs? I saw you are using pos-eol instead of point-at-eol. pos-eol is new in Emacs 29, which now means we have a dependency on the compat library. Would be nice to not require that dependency for Emacs 27 and later. Can you use flycheck to cleanup minor issues in the lisp files you've added? Thanks, John ________________________________ From: Uwe Brauer via Matlab-emacs-discuss <mat...@li...><mailto:mat...@li...> Sent: Sunday, May 19, 2024 2:11 AM To: Nidish Narayanaa Balaji <nid...@il...><mailto:nid...@il...> Cc: mat...@li...<mailto:mat...@li...> <mat...@li...><mailto:mat...@li...> Subject: Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] >>> "NNB" == Nidish Narayanaa Balaji <nid...@il...><mailto:nid...@il...> writes: > Okay I've fixed the font-lock issue. > Since I adapted the code from a pre-existing package that was meant to > be stand-alone, it had some checks in place that were overriding the > existing font-lock. I got rid of these and simplified it since we want > this to be distributed as part of matlab-mode.el . > I've verified that the syntax highlighting now works identical to the > master branch. Right, after a short testing, I can confirm that. Today however I have not much time for further testing, but I would like to run some tests more before merging and maybe somebody else might come back to us. Uwe -- I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel I strongly condemn Putin's war of aggression against Ukraine. I support to deliver weapons to Ukraine's military. I support the EU and NATO membership of Ukraine. |
From: Nidish N. B. <nid...@il...> - 2024-06-01 16:09:42
|
Hello all, I just fixed the warnings in matlab-cell.el. To avoid a recursive require issue (matlab-cell.el requires matlab-shell.el, which requires matlab.el; so requiring matlab-cell.el in matlab.el was problematic), I have made the matlab-shell-send-region function in matlab-shell.el to be autoloaded. I'll be happy to know if there are other, cleaner, solutions for this also. Best, Nidish On 5/22/24 22:21, John Ciolfi wrote: > Ah - I forgot we call the %% sections "cells". Perhaps a better name > would be code sections, > https://www.mathworks.com/help/matlab/matlab_prog/create-and-run-sections.html > > I'll re-look at this soon. > > Thanks > John > > > ------------------------------------------------------------------------ > *From:* Nidish Narayanaa Balaji <nid...@il...> > *Sent:* Wednesday, May 22, 2024 2:18 PM > *To:* John Ciolfi <ci...@ma...>; Uwe Brauer <ou...@ma...> > *Cc:* mat...@li... > <mat...@li...> > *Subject:* Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] > > Hello John, > > > Thank you for taking a look! > > > By "Cells" I don't mean the matlab cell objects, but rather > "code-blocks" delimited by commented lines starting with "%%". I'm > attaching a short matlab script that can be used for trying it out. > > I recommend trying out the following (interactive) functions to get a > feel for the additions: > > 1. Move point to the beginning of the buffer and try out the function > `matlab-cell-forward-cell'. > This should take you to the next cell (while highlighting). Do it > a couple more times to navigate. > > 2. Then try out the function `matlab-cell-backward-cell'. > > 3. Go to the third cell and try the function `matlab-cell-move-cell-up'. > This should move the contents of this cell to occur before the > previous cell. > > 4. Try out `matlab-cell-move-cell-down' and this action will be > reversed. > > 5. Next (ensure you have matlab-shell running) try out the function > `matlab-cell-shell-run-cell' to run the contents of the cell in > the shell. > I rewrote this based on the matlab-cell environ to be consistent > although `matlab-shell-run-cell` does something similar. > > And yes, I am using pos-bol and pos-eol - my emacs was giving me > warnings actually so I changed them. But I did not know that these > were only introduced in emacs 29. It makes sense to continue using the > older functions - I'll fix it. > > Thanks for the suggestion on the keybinding, it would make sense to > have something based on the convention that doesn't clash with > anything else as default. > > > I'll check with flycheck warnings before I push next! :) > > > Best, > > Nidish > > > > On 5/22/24 20:07, John Ciolfi wrote: >> Hi >> >> I like the idea of speedy navigation of cells. >> >> I took a brief look at the matlab-cell branch but wasn't sure what >> it's supposed to be used for. The first thing I tried was navigating >> a large cell argument to a function, something like: >> >> a = fun( { .... Big cell ....}, {.... Another cell ....}) >> >> Where the call to the function spanned many lines. >> >> M-x matlab-cell-foward-cell >> >> Jumped to the end of the file? >> >> Can you share use cases which could be used for testing? >> >> As for key bindings, it would be good to put them under C-c (take a >> look at the C-c C-c CHAR in matlab-cgen.el). Maybe add some >> additional C-c C-c CHARs? >> >> I saw you are using pos-eol instead of point-at-eol. pos-eol is new >> in Emacs 29, which now means we have a dependency on the compat >> library. Would be nice to not require that dependency for Emacs 27 >> and later. >> >> Can you use flycheck to cleanup minor issues in the lisp files you've >> added? >> >> Thanks, >> John >> >> >> ------------------------------------------------------------------------ >> *From:* Uwe Brauer via Matlab-emacs-discuss >> <mat...@li...> >> <mailto:mat...@li...> >> *Sent:* Sunday, May 19, 2024 2:11 AM >> *To:* Nidish Narayanaa Balaji <nid...@il...> >> <mailto:nid...@il...> >> *Cc:* mat...@li... >> <mailto:mat...@li...> >> <mat...@li...> >> <mailto:mat...@li...> >> *Subject:* Re: [Matlab-emacs-discuss] [font-lock stopped working] >> [fixed] >> >>> "NNB" == Nidish Narayanaa Balaji <nid...@il...> >> <mailto:nid...@il...> writes: >> >> > Okay I've fixed the font-lock issue. >> > Since I adapted the code from a pre-existing package that was meant to >> > be stand-alone, it had some checks in place that were overriding the >> > existing font-lock. I got rid of these and simplified it since we want >> > this to be distributed as part of matlab-mode.el . >> >> > I've verified that the syntax highlighting now works identical to the >> > master branch. >> >> Right, after a short testing, I can confirm that. Today however I have >> not much time for further testing, but I would like to run some tests >> more before merging and maybe somebody else might come back to us. >> >> Uwe >> >> -- >> I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel >> I strongly condemn Putin's war of aggression against Ukraine. >> I support to deliver weapons to Ukraine's military. >> I support the EU and NATO membership of Ukraine. >> |