Subject: 24.3; comment-search-forward in SQL-mode raises an error

From: Eric Hanchrow <[email-masked]>
Date: Thu, 9 May 2013 13:04:54 -0700

This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

* Create a file that contains three bytes: two dashes followed by a
  newline.
* Start emacs -Q
* C-x C-f NAME-OF-THE-FILE RET
* M-x sql-mode RET
* M-<
* M-: (comment-search-forward (point-max) t) RET

You'll see this error:

    Debugger entered--Lisp error: (wrong-type-argument stringp nil)
      looking-at(nil)
      comment-search-forward(4 t)
      eval((comment-search-forward (point-max) t) nil)
      eval-expression((comment-search-forward (point-max) t) nil)
      call-interactively(eval-expression nil nil)

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Applications/Emacs.app/Contents/Resources/etc/DEBUG.

In GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-12 on bob.porkrind.org
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin'
 '--with-ns' 'build_alias=i686-apple-darwin'
 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.7
 -isystem
 /Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/
 -F/Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks''

Important settings:
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: SQL[ANSI]

Minor modes in effect:
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f / t m p / f r o t z . s q l <return> - - <return>
- - SPC H e y SPC y o u <return> - - <return> M-< M-:
M-( c o m m e n t - s e a r c h - f o r w a r d M-(
p o i n t - m a x C-f SPC t <return> q M-> C-SPC C-p
C-p C-w M-. C-g M-> M-: M-p <return> M-< M-: M-p <return>
q M-> C-x C-s M-! s t a t SPC f r <tab> <return> M-x
r e p o r t - e m a c s - b <tab> <return>

Recent messages:
Quit
Mark set
nil
Mark set
Entering debugger...
Back to top level.
Mark set
Saving file /tmp/frotz.sql...
Wrote /tmp/frotz.sql
16777224 1250723 -rw-r--r-- 1 erichanchrow wheel 0 3 "May  9 13:00:57 2013"
"May  9 13:00:57 2013" "May  9 13:00:57 2013" "May  9 13:00:57 2013" 4096 8
0 frotz.sql

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils shell pcomplete etags help-mode debug sql easymenu
thingatpt comint ansi-color ring time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)