From: Eric L. <Eri...@ma...> - 2012-02-12 17:20:34
|
Hi Uwe, I can't run matlab-shell at the moment to help answer the question, but I'm confused as to what you are expecting. In your example, of the cursor is on line 2, run cell should only run x=8. If your cursor is on the line for y=91, it should only run that. I tried the parsing bit of matlab-shell-run-cell without executing the code, and it seemed to work as expected for me. Are you seeing some other behavior? Eric -----Original Message----- From: Uwe Brauer [mailto:ou...@ma...] Sent: Wednesday, February 08, 2012 10:55 AM To: matlab-emacs Subject: [Matlab-emacs-discuss] resend:matlab-shell-run-cell can only run one cell, narrow-to-region Hello I am sorry that I missed the change to the new list. Here is a copy of an email I just sent to the old list (and to Eric) I tested this in GNU emacs Xemacs 21.5.31 and Xemacs 21.4.21: matlab-shell-run-cell can only run one cell, all others cells below are ignored: the cells of the following example ,---- | %% | x=8 | | | %% | y=91 | `---- Are executed in the built in editor but in all the Emacsen I tested only x=8 is executed, the other command is ignored which is odd. The only solution consists to use narrow-to-region for a cell and then use the function: matlab-shell-run-cell. So I presume the function should be modfied. I tried that but I can't get narrow-to-region (narrow-to-region start end) to work: (defun matlab-shell-run-cell () "Run the cell the cursor is in." (interactive) (let ((start (save-excursion (forward-page -1) (if (looking-at "function") (error "You are not in a cell. Try `matlab-shell-save-and-go' instead")) (when (matlab-ltype-comm) ;; Skip over starting comment from the current cell. (matlab-end-of-command 1) (end-of-line) (forward-char 1)) (point))) (end (save-excursion (forward-page 1) (when (matlab-ltype-comm) (beginning-of-line) (forward-char -1)) (point)))) (save-restriction (progn (narrow-to-region start end) (matlab-shell-run-region start end))))) Uwe Brauer ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Matlab-emacs-discuss mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss |