Hi List,
newcomment.el uses (line 477)
,------------------------------------
| (if (looking-at comment-start-skip)
`------------------------------------
in function
,--------------------------------------------------------
| (defun comment-search-forward (limit &optional noerror)
`--------------------------------------------------------
what gives an error if `comment-start-skip' is nil, as in sql-mode.
E.g. this small file (sql-test.sql) in a buffer in sql-mode
,----------------------
| -- * data load
| -- ** data for table1
| drop table1;
`----------------------
with point at (point-min), causes an error when this command is applied:
,----------------------------------
| M-: (comment-search-forward 15 t)
`----------------------------------
,----------------------------------------------------------------
| Debugger entered--Lisp error: (wrong-type-argument stringp nil)
| looking-at(nil)
| comment-search-forward(15 t)
| eval((comment-search-forward 15 t) nil)
| eval-expression((comment-search-forward 15 t) nil)
| call-interactively(eval-expression nil nil)
`----------------------------------------------------------------
because 'C-h v comment-start-skip' gives
,-------------------------------------------------------------
| comment-start-skip is a variable defined in `newcomment.el'.
| Its value is nil
`-------------------------------------------------------------