Subject: Re: bug#5706: 23.1; Comments incorrectly detected in autoconf mode

From: Stefan Kangas <[email-masked]>
Date: Thu, 19 Nov 2020 06:51:12 -0800

tags 5706 + confirmed
thanks

Reuben Thomas <[email-masked]> writes:

> On Thu, 19 Nov 2020 at 03:12, Stefan Kangas <[email-masked]> wrote:
>
>> [email-masked] writes:
>>
>> > A hash character does not always introduce a comment in autoconf code,
>> > but autoconf-mode always colors if as if it did. Unfortunately, I
>> > cannot really tell from the autoconf manual what the rules are. I
>> > suspect that # does not start a comment if it is inside [...] quotes,
>> > but I guess this should be checked.
>>
>> (This bug was reported 10 years ago, but unfortunately never got a reply
>> at the time.)
>>
>> Could you give an example of some autoconf code where you believe the
>> hash character is incorrectly identified as a comment?
>>
>
> A quick bit of grepping finds the in XEmacs's configure.ac. Note in
> particular the contents of the first argument to AC_LANG_PROGRAM:
>
> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <features.h>],[
> #if ! (defined __GLIBC__ || defined __GNU_LIBRARY__)
> #error Not a GNU libc system :-(
> ******* ======= ******** &&&&&&&&
> #endif
> ])], have_glibc=yes, have_glibc=no)

Thanks.  I see the same on current master using the configure.ac from
Emacs.

It incorrectly uses `font-lock-comment-face' for the entire line after
"langinfo.h" below:

AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset],
  [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]],