Christian Grothoff transcribed 5.4K bytes: > From private discussion with Martin where I pointed out a few style > issues I didn't like and Martin either created fixes or determined that > what I wanted was not (yet) possible... > (forwarding with permission)... > > On 4/17/19 3:58 PM, Schanzenbach, Martin wrote: > > The thing is clang-format is built with the most common styles in > > mind (including GNU). It does not cover every little corner case and > > does not want to in order to keep it simple (see > > https://clang.llvm.org/docs/ClangFormatStyleOptions.html#adding-additional-style-options). > > Yes, I did read that in the manual as well. Still, in the "worst case" > we could consider patching it ourselves, but it would have to be a > reasonably painful issue to justify that. > > > So either we move towards a tool-based solution (idk any other good > > besides clang-format) and sacrifice such little issues like odd > > formatting in the case of yoda expressions or just leave it as is. > Well, the list of sacrifices (= styles generated by the tool that I > personally don't like) is still a bit long. Regardless, I should start > by saying that I appreciate your efforts at making it shorter, and I am > still optimistic that this can be fixed. In the past we tried to get > there with GNU indent (even patching it!), but ultimately it didn't > quite work out. My feeling is that GNU indent didn't work in part > because it ultimately required installing indent with our patches, and > also in part because it didn't integrate with editors nicely. > > On that last point: > > There is still a few things we need to figure out (others on > gnunet-developers might weigh in here). First of all, how compatible is > this actually going to be with editing in Emacs and other editors? > > Sure, running an external tool afterwards is always possible, but does > this integrate with Emacs to the point that the formatting is > applied/conveniently apply-able during editing? (Say what I do right > now: press Tab and have the indentation match what clang will do? Or can > we adjust the existing Emacs style (and other editors!) to match 100% > what clang formatter generates?)
I'm not sure about the well integrating part, but the integrating part exists - search for clang-format.el and similar modules for emacs. I mostly use nvi, so I am not the best to give advice about anything doing auto format.. but clang-format.el looks like what I would use or what I would update if it were broken (last patch to it: 2014). Tbh looks easy enough to work on it to adjust to our needs, I might give it a try once I need it. > Naturally, some of the style issues that remain (like the impossibility > to force a break after function arguments even if the line is short even > without one) may feed into this. > > > _______________________________________________ > GNUnet-developers mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/gnunet-developers
signature.asc
Description: PGP signature
_______________________________________________ GNUnet-developers mailing list [email protected] https://lists.gnu.org/mailman/listinfo/gnunet-developers
