Tuesday, April 11, 2006

Comment a block in Matlab (emacs)

Highlight a block and then 'M-;' -- what happened? It is really not helpful.

Edit the matlab.el file at: /usr/local/matlab7/java/extern/EmacsLink/lisp, find and change the following line

;; (define-key km [(meta \;)] 'matlab-comment)
(define-key km [(meta \;)] 'comment-dwim)

Then 'M-;' can be used to comment and uncomment a block.

Use the following keys can do the similar job but we are just familar with 'M-;'. The other problem is some "$" are added after % in this case.
C-c; add comments
C-c: remove comments

No comments:

Post a Comment