all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: altlockg@gmail.com
Cc: 39891@debbugs.gnu.org
Subject: bug#39891: 26.3; C++ indenting error
Date: Sat, 7 Mar 2020 11:05:35 +0000	[thread overview]
Message-ID: <20200307110535.GA7219@ACM> (raw)
In-Reply-To: <874kv5ksn1.fsf@js.i-did-not-set--mail-host-address--so-tickle-me>

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





  reply	other threads:[~2020-03-07 11:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 21:58 bug#39891: 26.3; C++ indenting error altlockg
2020-03-07 11:05 ` Alan Mackenzie [this message]
2020-04-02 17:58 ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200307110535.GA7219@ACM \
    --to=acm@muc.de \
    --cc=39891@debbugs.gnu.org \
    --cc=altlockg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.