Hi,

Is it possible to make 'matlab-comment' behave more like 'comment-dwim' in
the mode 'Emacs-Lisp'?

What I'd like is the following behaviour. When you use 'M-;'
(matlab-comment) and there is already a comment on the line that is too
long, i.e. extends beyond 'fill-column' (76), then the '%' is shifted to
the left if possible in order to keep the comment within the 'fill-column'.

Note: I tried calling 'comment-dwim' in matlab-mode, but it places the '% '
at the wrong place and the right alignment isn't working properly. I.e. the
'% ' is moved as far left as possible, not merely as much that is needed to
make the comment fit.

Best regards,
Christian

PS. In case the above isn't clear, here's an example.
Let's say we have this line of code:

x = 1;

Pressing 'M-;' will add '% ' at column 40. Then we add a long comment,
getting this:

x = 1; % Here is a comment that is getting long

Now press 'M-;' again, and now the '%' is shifted to the left, resulting in
e.g.:

x = 1; % Here is a comment that is getting long

-- 
Christian Ridderström,     +46-70 687 39 44
------------------------------------------------------------------------------
_______________________________________________
Matlab-emacs-discuss mailing list
Matlab-emacs-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matlab-emacs-discuss

Reply via email to