Created
November 18, 2013 20:24
-
-
Save xcv58/7534683 to your computer and use it in GitHub Desktop.
Matlab-Emacs.
Fixed matlab-shell-run-cell ()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun matlab-shell-run-cell () | |
"Run the cell the cursor is in." | |
(interactive) | |
(let ((start (save-excursion (end-of-line);(forward-page -1) | |
(re-search-backward "\\(%%\\)\\|\\`") | |
(if (looking-at "function") | |
(error "You are not in a cell. Try `matlab-shell-save-and-go' instead")) | |
(point))) | |
(end (save-excursion (end-of-line) | |
(re-search-forward "\\(%%\\)\\|\\'") | |
(point)))) | |
(matlab-shell-run-region start end t))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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)))) | |
(matlab-shell-run-region start end t))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment