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 <nidish.bal...@ila.uni-stuttgart.de>
*Sent:* Wednesday, May 22, 2024 2:18 PM
*To:* John Ciolfi <cio...@mathworks.com>; Uwe Brauer <o...@mat.ucm.es>
*Cc:* matlab-emacs-discuss@lists.sourceforge.net <matlab-emacs-discuss@lists.sourceforge.net>
*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 <matlab-emacs-discuss@lists.sourceforge.net> <mailto:matlab-emacs-discuss@lists.sourceforge.net>
*Sent:* Sunday, May 19, 2024 2:11 AM
*To:* Nidish Narayanaa Balaji <nidish.bal...@ila.uni-stuttgart.de> <mailto:nidish.bal...@ila.uni-stuttgart.de> *Cc:* matlab-emacs-discuss@lists.sourceforge.net <mailto:matlab-emacs-discuss@lists.sourceforge.net> <matlab-emacs-discuss@lists.sourceforge.net> <mailto:matlab-emacs-discuss@lists.sourceforge.net> *Subject:* Re: [Matlab-emacs-discuss] [font-lock stopped working] [fixed] >>> "NNB" == Nidish Narayanaa Balaji <nidish.bal...@ila.uni-stuttgart.de> <mailto:nidish.bal...@ila.uni-stuttgart.de> 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.
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to