all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#39891: 26.3; C++ indenting error
@ 2020-03-03 21:58 altlockg
  2020-03-07 11:05 ` Alan Mackenzie
  2020-04-02 17:58 ` Alan Mackenzie
  0 siblings, 2 replies; 3+ messages in thread
From: altlockg @ 2020-03-03 21:58 UTC (permalink / raw)
  To: 39891


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))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#39891: 26.3; C++ indenting error
  2020-03-03 21:58 bug#39891: 26.3; C++ indenting error altlockg
@ 2020-03-07 11:05 ` Alan Mackenzie
  2020-04-02 17:58 ` Alan Mackenzie
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2020-03-07 11:05 UTC (permalink / raw)
  To: altlockg; +Cc: 39891

Hello, altlockg

On Tue, Mar 03, 2020 at 22:58:26 +0100, altlockg@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).





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#39891: 26.3; C++ indenting error
  2020-03-03 21:58 bug#39891: 26.3; C++ indenting error altlockg
  2020-03-07 11:05 ` Alan Mackenzie
@ 2020-04-02 17:58 ` Alan Mackenzie
  1 sibling, 0 replies; 3+ messages in thread
From: Alan Mackenzie @ 2020-04-02 17:58 UTC (permalink / raw)
  To: 39891-done; +Cc: altlockg

close 39891 27.1
quit

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

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-02 17:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-03 21:58 bug#39891: 26.3; C++ indenting error altlockg
2020-03-07 11:05 ` Alan Mackenzie
2020-04-02 17:58 ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.