Subject: Re: bug#6829: M-; doesn't comment lines in Octave mode

From: Stefan Monnier <[email-masked]>
Date: Thu, 12 Aug 2010 12:49:57 +0200

>  In Octave mode, select a line or several lines of code.
> I would expect M-; would comment the lines, or uncomment
> them if they are already commented out. Instead, Octave
> starts a comment at the end of the line the comment is on,
> which is the behavior I would expect if no lines were selected.

I've installed the patch below into trunk, which should fix this problem.

        Stefan

=== modified file 'lisp/progmodes/octave-mod.el'
--- lisp/progmodes/octave-mod.el	2010-05-20 15:12:20 +0000
+++ lisp/progmodes/octave-mod.el	2010-08-12 10:44:34 +0000
@@ -194,7 +194,6 @@
     (define-key map ";" 'octave-electric-semi)
     (define-key map " " 'octave-electric-space)
     (define-key map "\n" 'octave-reindent-then-newline-and-indent)
-    (define-key map "\e;" 'octave-indent-for-comment)
     (define-key map "\e\n" 'octave-indent-new-comment-line)
     (define-key map "\e\t" 'octave-complete-symbol)
     (define-key map "\M-\C-a" 'octave-beginning-of-defun)
@@ -507,6 +506,7 @@
   (setq comment-start-skip "\\s<+\\s-*")
   (make-local-variable 'comment-indent-function)
   (setq comment-indent-function 'octave-comment-indent)
+  (set (make-local-variable 'comment-add) 1)
 
   (make-local-variable 'parse-sexp-ignore-comments)
   (setq parse-sexp-ignore-comments t)