Subject: bug#18970: 24.3; indent region fails in C++ mode after adding a #include

From: Piotr Sipika <[email-masked]>
Date: Fri, 07 Nov 2014 21:27:15 -0500

> To confirm that your problem is the same one, would you please do the
> following:
> (i) Kill a line starting with "#include" with C-k, then yank it back
> again with C-y.
> (ii) Move point to the beginning of that line and type C-u C-x =
> (`what-cursor-position' with a C-u prefix argument).
> (iii) You should see something like this:
Awesome directions, here's the output from my instance of that command:

             position: 110 of 3316 (3%), column: 0
            character: # (displayed as #) (codepoint 35, #o43, #x23)
    preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x23
               syntax: . 	which means: punctuation
             category: .:Base, a:ASCII, l:Latin, r:Roman
             to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
          buffer code: #x23
            file code: #x23 (encoded by coding system undecided-unix)
              display: by this font (glyph code)
    xft:-unknown-Liberation
Mono-normal-normal-normal-*-15-*-*-*-m-0-iso10646-1 (#x06)

Character code properties: customize what to show
  name: NUMBER SIGN
  general-category: Po (Punctuation, Other)
  decomposition: (35) ('#')

There are text properties here:
  c-in-sws             t
  c-is-sws             t
  category             c-cpp-delimiter
  face                 font-lock-preprocessor-face
  fontified            t
  risky-local-variable t
  syntax-table         nil

> If you see the syntax-table text property set to nil, as in the above,
> then we have found the bug.
As you can see that is the exact output indicating the bug.

> Either upgrade your Emacs to version 24.4, or apply the following patch
> to ..../emacs-24.3/lisp/progmodes/cc-mode.el:
Thank you for the patch and further directions/suggestions.

> Restart Emacs, and hopefully the bug will be gone.  Please let me know
> whether or not this works.
Will do.

Best!
Piotr