GNU bug report logs - #39891
26.3; C++ indenting error

Previous Next

Package: emacs;

Reported by: altlockg <at> gmail.com

Date: Tue, 3 Mar 2020 22:05:01 UTC

Severity: normal

Found in version 26.3

Fixed in version 27.1

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39891 in the body.
You can then email your comments to 39891 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39891; Package emacs. (Tue, 03 Mar 2020 22:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to altlockg <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 03 Mar 2020 22:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: altlockg <at> gmail.com
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; C++ indenting error
Date: Tue, 03 Mar 2020 22:58:26 +0100
I was trying to reindent my file, but got the error, visible in the
recent messages below.

I tracked it down to a single line, line 34 of the following file:
https://pastebin.com/kVJATcsF
The line containing "rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, ",
to be exact.
When I remove the newline before this line, the issue does not occur.

I wouldn't have a clue on how to dig deeper, so that's why I'm sending
you this report. If it helps, my configuration is available here:
https://github.com/Altlock/EmacsDots

Thank you for your time.


In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
 of 2019-08-29 built on juergen
Windowing system distributor 'The X.Org Foundation', version 11.0.12007000
Recent messages:
Wrote /home/jan/Programming/Raydraw/2.cpp
c-guess-basic-syntax: Wrong type argument: integer-or-marker-p, nil [3 times]
Saving file /home/jan/Programming/Raydraw/2.cpp...
Wrote /home/jan/Programming/Raydraw/2.cpp
evil-forward-char: End of line [2 times]
Saving file /home/jan/Programming/Raydraw/2.cpp...
Wrote /home/jan/Programming/Raydraw/2.cpp
c-guess-basic-syntax: Wrong type argument: integer-or-marker-p, nil [11 times]
Saving file /home/jan/Programming/Raydraw/2.cpp...
Wrote /home/jan/Programming/Raydraw/2.cpp
c-guess-basic-syntax: Wrong type argument: integer-or-marker-p, nil
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-modules
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: C++//l

Minor modes in effect:
  flycheck-mode: t
  show-paren-mode: t
  global-display-line-numbers-mode: t
  display-line-numbers-mode: t
  global-origami-mode: t
  origami-mode: t
  electric-pair-mode: t
  global-hl-line-mode: t
  ivy-mode: t
  global-color-identifiers-mode: t
  color-identifiers-mode: t
  global-aggressive-indent-mode: t
  aggressive-indent-mode: t
  rainbow-delimiters-mode: t
  global-company-mode: t
  company-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg gnus-util rmail mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail smex cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
ffap counsel xdg compile swiper powerline powerline-separators flycheck
cl-extra help-mode subr-x init org-rmail org-mhe org-irc org-info
rmail-loaddefs rfc2047 rfc2045 ietf-drums mail-utils mm-util mail-prsvr
wid-edit org-docview doc-view jka-compr image-mode dired dired-loaddefs
org-bibtex bibtex org-bbdb org-w3m two-column rebecca-theme paren
display-line-numbers origami origami-parsers cl s company-oddmuse
company-keywords company-etags etags xref project company-gtags
company-dabbrev-code company-dabbrev company-files company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-bbdb company-c-headers rx elec-pair hl-line ido
ivy flx delsel colir ivy-overlay color-identifiers-mode python tramp-sh
tramp tramp-compat tramp-loaddefs trampver ucs-normalize parse-time json
map dash color powerline-themes aggressive-indent rainbow-delimiters
cal-iso org-agenda org-element avl-tree generator org org-macro
org-footnote org-pcomplete org-list org-faces org-entities noutline
outline easy-mmode org-version ob-emacs-lisp ob ob-tangle org-src ob-ref
ob-lob ob-table ob-keys ob-exp ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs modeConfig company-tng company pcase keybindings vi.el evil
evil-keybindings evil-integration undo-tree diff evil-maps evil-commands
reveal flyspell ispell evil-jumps evil-command-window evil-types
evil-search evil-ex shell pcomplete comint ansi-color evil-macros
evil-repeat evil-states evil-core advice evil-common windmove thingatpt
rect evil-digraphs evil-vars ring edmacro kmacro packages finder-inf
info package easymenu epg-config url-handlers url-parse auth-source
cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars
seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 572801 132993)
 (symbols 48 46411 2)
 (miscs 40 159 518)
 (strings 32 142665 11219)
 (string-bytes 1 4333844)
 (vectors 16 69926)
 (vector-slots 8 1188064 114920)
 (floats 8 538 1417)
 (intervals 56 1374 1955)
 (buffers 992 14))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39891; Package emacs. (Sat, 07 Mar 2020 11:06:02 GMT) Full text and rfc822 format available.

Message #8 received at 39891 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: altlockg <at> gmail.com
Cc: 39891 <at> debbugs.gnu.org
Subject: Re: bug#39891: 26.3; C++ indenting error
Date: Sat, 7 Mar 2020 11:05:35 +0000
Hello, altlockg

On Tue, Mar 03, 2020 at 22:58:26 +0100, altlockg <at> gmail.com wrote:

> I was trying to reindent my file, but got the error, visible in the
> recent messages below.

Thanks for taking the trouble to report this bug.

> I tracked it down to a single line, line 34 of the following file:
> https://pastebin.com/kVJATcsF
> The line containing "rec.x + rec.width - MOUSE_SCALE_MARK_SIZE, ",
> to be exact.
> When I remove the newline before this line, the issue does not occur.

The bug has actually already been fixed in the CC Mode and Emacs
repositories, although the fix hasn't yet appeared in a released
version.

> I wouldn't have a clue on how to dig deeper, so that's why I'm sending
> you this report. If it helps, my configuration is available here:
> https://github.com/Altlock/EmacsDots

What is happening is that the older CC Mode isn't recognising the brace
on L33 as a block containing data fields, and tries to parse it as
though it contained statements.  It thus gets horribly confused.

To get your CC Mode working until our next release happens, would you
please apply the following patch to .../lisp/progmodes/cc-engine.el in
your Emacs 26.3:


diff -r 26668f1829ba -r cc69c3edb59b cc-engine.el
--- a/cc-engine.el	Fri Nov 10 17:28:29 2017 +0000
+++ b/cc-engine.el	Fri Nov 10 17:32:55 2017 +0000
@@ -12558,7 +12558,11 @@
 			    (save-excursion
 			      (goto-char containing-sexp)
 			      (c-looking-at-special-brace-list)))
-		       (c-inside-bracelist-p containing-sexp paren-state t))))
+		       (c-inside-bracelist-p containing-sexp paren-state t)
+		       (save-excursion
+			 (goto-char containing-sexp)
+			 (and (eq (char-after) ?{)
+			      (not (c-looking-at-statement-block)))))))
 	(cond
 
 	 ;; CASE 9A: In the middle of a special brace list opener.


Then, please byte-compile cc-engine.el, and replace the current
cc-engine.elc with the one you've just built.  This should fix the bug.
(If you want any help with applying the patch or byte compiling, feel
free to send me personal email.)

> Thank you for your time.

Again, thank you for the report.


> In GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10)
>  of 2019-08-29 built on juergen
> Windowing system distributor 'The X.Org Foundation', version 11.0.12007000

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).




bug marked as fixed in version 27.1, send any further explanations to 39891 <at> debbugs.gnu.org and altlockg <at> gmail.com Request was from Alan Mackenzie <acm <at> muc.de> to control <at> debbugs.gnu.org. (Thu, 02 Apr 2020 17:59:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39891; Package emacs. (Thu, 02 Apr 2020 17:59:02 GMT) Full text and rfc822 format available.

Message #13 received at 39891-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: 39891-done <at> debbugs.gnu.org
Cc: altlockg <at> gmail.com
Subject: Re: bug#39891: 26.3; C++ indenting error
Date: Thu, 2 Apr 2020 17:58:30 +0000
close 39891 27.1
quit

Closing the bug, which had already been fixed for Emacs 27.1.

-- 
Alan Mackenzie (Nuremberg, Germany).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 May 2020 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 354 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.