From: Eric L. <Eri...@ma...> - 2011-07-11 15:25:29
|
Hi, It looks like it thinks your comment is an end-of-function comment. The following update fixes the issue for me: (defun matlab-ltype-endfunction-comm () "Return t if the current line is an ENDFUNCTION style comment." (save-excursion (if (not (matlab-ltype-comm)) nil (beginning-of-line) (if (looking-at "^[ \t]*%[ \t]*endfunction") t (while (and (or (matlab-ltype-comm) (matlab-ltype-empty)) (not (eobp))) (forward-line 1)) (and (matlab-ltype-function-definition) (not (save-excursion (matlab-beginning-of-enclosing-defun)))) )))) Basically, the last line checks to see if the defun is enclosed in some other structure. What I don't know is if it will break anything else. :( Eric ----------------------------- From: Nick Henderson [mailto:nw...@st...] Sent: Thursday, July 07, 2011 11:22 PM To: mat...@li... Subject: [Matlab-emacs-discuss] bug in formatting of comments in "methods" blocks Hello All, There seems to be a bug in the formatting of comments in methods blocks. See the file attached file, bug1.m. The first comment in the methods block causes formatting to be messed up. If it is removed, things work as they should. The strange thing is that comments in the classdef and properties block work just fine. Cheers, Nick -- nw...@st... nic...@gm... 650-352-3551 |