(defun my-comment-matching-line ()
;; don't comment the region maybe
Should comment-line not be available, here from a recent newcomment.el:
(defun comment-line (n)
"Comment or uncomment current line and leave point after it.
With positive prefix, apply to N lines including current one.
With negative prefix, apply to -N lines above. Also, further
consecutive invocations of this command will inherit the negative
If region is active, comment lines in active region instead.
Unlike `comment-dwim', this always comments whole lines."
(when (and (eq last-command 'comment-line-backward)
(setq n (- n)))
(goto-char (line-end-position n)))))
(apply #'min range)
(apply #'max range)))
(unless (natnump n) (setq this-command 'comment-line-backward))))