From: Uwe B. <ou...@ma...> - 2012-02-18 15:24:40
|
Hello The culprit for me is page-delimiter setting of matlab: (setq page-delimiter "^\\(\f\\|%% \\)") So the following simple solutions solves my problem: (defun matlab-shell-run-cell () "Run the cell the cursor is in." (interactive) (let ((page-delimiter "^%%")) (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)))) |