bug#66911: CC Mode 5.35.2 (C++//l); Noise macro being taken as anchor to class-open
Arsen Arsenović via CC-Mode-help <[email protected]> Mon, 06 Nov 2023 16:07:05 +0100
| Newsgroups | gmane.emacs.cc-mode.general |
|---|---|
| Message-ID | <[email protected]> |
--===============1892445294798155908== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Alan Mackenzie <[email protected]> writes: >> Though, the anchor still anchors on the template<> line rather than the >> struct line in: > >> template<size_t _Nw> >> struct _Base_bitset >> { > >> ... making it impossible (AFAICT) to create a style that implements: > >> template<size_t _Nw> >> struct _Base_bitset >> { >> }; > >> struct foo >> { >> }; > >> instead, the former gets formatted as: > >> template<size_t _Nw> >> struct _Base_bitset >> { >> }; > >> Is this intended? > > Apologies. I missed this second point in your original bug report. Admittedly, I had considered making it two bug reports because the issues seemed separate to me, but I wasn't sure if one caused the other or vice-versa. So, I don't blame you :-) > This should be fixable, but will be more work to fix than the other > point. > > I think something like the following would do it: we could add a second > anchor point to topmost-intro-cont forms, that second point pointing at > struct. In languages without templates/generics, or in constructs > lacking template components, both anchor points would be the same. > > So you could write an alignment function which would use that second > anchor point for class-open lines and the like. Or, just possibly, we > might be able to make that second point the default for class-open. This > should keep backward compatibility. I'll have to think about this. > > And of course, the manual and test programs will need amending, too. ;-) That sounds lovely - thanks in advance, if you do, indeed, decide to do it. For now, I can get this patch implemented with some manual indenting. Thanks for the quick fix, have a lovely day :-) =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOYEARYKAI4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZUkCUF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosSTRzgBALjG0I7uLk/NUZMxSLSKH1zWZtPCS+MxOyvR IWZbFly+AQDDVTWnb/gLR2EHOf8fwfwL4WT6gZi84Lh7pKKjzBhmDQ== =Yuw7 -----END PGP SIGNATURE----- --=-=-=-- --===============1892445294798155908== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============1892445294798155908==--