GNU bug report logs - #18158
Fix extra indent of d-mode "else static if" statements in cc-engine.el

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs,cc-mode; Reported by: Liran Zvibel <liranz@HIDDEN>; dated Thu, 31 Jul 2014 17:17:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Jul 2014 17:16:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jul 31 13:16:12 2014
Received: from localhost ([127.0.0.1]:53200 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1XCtxb-0001Zm-Dr
	for submit <at> debbugs.gnu.org; Thu, 31 Jul 2014 13:16:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51855)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <liranz@HIDDEN>) id 1XCsMg-0007XH-Gj
 for submit <at> debbugs.gnu.org; Thu, 31 Jul 2014 11:33:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <liranz@HIDDEN>) id 1XCsMW-000413-Gi
 for submit <at> debbugs.gnu.org; Thu, 31 Jul 2014 11:33:53 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:38318)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <liranz@HIDDEN>) id 1XCsMW-00040z-EW
 for submit <at> debbugs.gnu.org; Thu, 31 Jul 2014 11:33:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53571)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <liranz@HIDDEN>) id 1XCsMR-0004vJ-OX
 for bug-gnu-emacs@HIDDEN; Thu, 31 Jul 2014 11:33:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <liranz@HIDDEN>) id 1XCsMN-00040J-35
 for bug-gnu-emacs@HIDDEN; Thu, 31 Jul 2014 11:33:43 -0400
Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:42379)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <liranz@HIDDEN>) id 1XCsMM-0003zP-Rh
 for bug-gnu-emacs@HIDDEN; Thu, 31 Jul 2014 11:33:39 -0400
Received: by mail-wi0-f172.google.com with SMTP id n3so9549577wiv.11
 for <bug-gnu-emacs@HIDDEN>; Thu, 31 Jul 2014 08:33:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=date:from:to:message-id:subject:mime-version:content-type
 :content-transfer-encoding:content-disposition;
 bh=VexKV965hFhc1sAjWHPr0eZiTVOSFrDXE2d6uzudXrI=;
 b=JPiy3dTq4bg2ZJdA8gsMnqAHVTKE4yrqZH5uOeAlu6xD/kMvOdnQUTV/W57K+rAoi4
 orQgtyjLj5pcBc1rjYYQPxXJ1TetggzkGRAh1Js70pXVuLyQM7s/GzORO7n1iWeX/vSe
 QD6ShYRJ8Ppxy35TMkh4/K1mUZJieHLCUhhsINdIWs/73GZR0s6GS3UvC/y6Lk1JSzvZ
 RuZfs7ERAW096jIEWzpjFL15Vev8/6JafTIxVjsnVf6eFJ6Lo8OpyQT2GjNcNnHgKkG0
 BBXPu6q/r0HKqNN2zKWena2l/qFj75jg31ZTcXgb7mPiNvwwWGB/W0Rou+O5+DNKfxME
 ie1Q==
X-Received: by 10.194.187.241 with SMTP id fv17mr18266378wjc.13.1406820812227; 
 Thu, 31 Jul 2014 08:33:32 -0700 (PDT)
Received: from engine.local (dialup-62-0-73-102.jlm.netvision.net.il.
 [62.0.73.102])
 by mx.google.com with ESMTPSA id dj2sm67334114wib.11.2014.07.31.08.33.30
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
 Thu, 31 Jul 2014 08:33:31 -0700 (PDT)
Date: Thu, 31 Jul 2014 18:33:28 +0300
From: Liran Zvibel <liranz@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Message-ID: <etPan.53da61c8.70a64e2a.16175@HIDDEN>
Subject: Fix extra indent of d-mode "else static if" statements in cc-engine.el
X-Mailer: Airmail (247)
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.0 (----)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Thu, 31 Jul 2014 13:16:09 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.0 (----)

Hi,

I=E2=80=99m not subscribed to this list (or to -devel), so please reply a=
lso to my email when responding.

Thanks,
Liran Zvibel.

** Description:

=46ix extra indent of d-mode =C2=A0=22else static if=22 statements=C2=A0

The D programming language has a notion of =E2=80=9Cstatic if=E2=80=9D co=
nditionals.
The d-mode (from https://github.com/Emacs-D-Mode-Maintainers/Emacs-D-Mode=
.git)
requires cc-mode.
When writing =E2=80=9Celse static if=E2=80=9D blocks, the code block is g=
etting indented twice,
as well as all future =E2=80=9Celse static if=E2=80=9Ds that come later. =
This is very annoying.

This simple fix was originally suggested here:=C2=A0
http://www.prowiki.org/wiki4d/wiki.cgi=3FEditorSupport/EmacsDMode/ElseSta=
ticIf
The simple fix treats =22static if=22 same as =E2=80=9Cif=22 that comes r=
ight after an =E2=80=9Celse=22.

I fixed it locally in my installed emacs long time ago, but today when do=
wnloading=C2=A0
trunk to test 24.4 I was disappointed it was not already fixed by someone=
 else.=C2=A0
I know many D programmers that apply this change locally to their install=
ed Emacs,=C2=A0
hopefully not for long.

** ChangeLog

2014-07-31 Liran Zvibel <liranz=40gmail.com>

	* Small cc-mode change to make sure =E2=80=9Celse static if=E2=80=9D doe=
s not get=C2=A0
	deeper and deeper indentation the same way that =E2=80=9Celse if=E2=80=9D=
 is treated=C2=A0
	for d-mode that requires cc-mode.

** The patch :

=3D=3D=3D modified file 'lisp/progmodes/cc-engine.el'
*** lisp/progmodes/cc-engine.el	2014-06-29 11:26:47 +0000
--- lisp/progmodes/cc-engine.el	2014-07-31 15:22:15 +0000
*************** comment at the start of cc-engine.el for
*** 9053,9061 ****
=C2=A0 			 =C2=A0 =C2=A0 (looking-at =22else=5C=5C>=5B=5E=5F=5D=22)
=C2=A0 			 =C2=A0 =C2=A0 (save-excursion
=C2=A0 			 =C2=A0 =C2=A0 =C2=A0 (goto-char old-pos)
=21 			 =C2=A0 =C2=A0 =C2=A0 (looking-at =22if=5C=5C>=5B=5E=5F=5D=22)))
=C2=A0 			;; Special case to avoid deeper and deeper indentation
=21 			;; of =22else if=22 clauses.
=C2=A0 			)

=C2=A0 		 =C2=A0 =C2=A0 =C2=A0 ((and (not stop-at-boi-only)
--- 9053,9062 ----
=C2=A0 			 =C2=A0 =C2=A0 (looking-at =22else=5C=5C>=5B=5E=5F=5D=22)
=C2=A0 			 =C2=A0 =C2=A0 (save-excursion
=C2=A0 			 =C2=A0 =C2=A0 =C2=A0 (goto-char old-pos)
=21 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(or (looking-at =22if=5C=5C>=5B=
=5E=5F=5D=22)
=21 				 =C2=A0 (looking-at =22static=5C=5C>=5B=5E=5F=5D=22))))
=C2=A0 			;; Special case to avoid deeper and deeper indentation
=21 			;; of =22else if=22/=22static else if=22 clauses.
=C2=A0 			)

=C2=A0 		 =C2=A0 =C2=A0 =C2=A0 ((and (not stop-at-boi-only)








Acknowledgement sent to Liran Zvibel <liranz@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#18158; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

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