From patchwork Fri Jan 13 19:35:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tremblay X-Patchwork-Id: 18899 Received: (qmail 5987 invoked by alias); 13 Jan 2017 19:35:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 5978 invoked by uid 89); 13 Jan 2017 19:35:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:Security, H*r:Symantec, H*r:Unknown_Domain, H*F:D*ericsson.com X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Jan 2017 19:35:38 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by (Symantec Mail Security) with SMTP id B7.94.29529.D8239785; Fri, 13 Jan 2017 21:03:27 +0100 (CET) Received: from elxa4wqvvz1.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.93) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 13 Jan 2017 14:35:33 -0500 From: Antoine Tremblay To: CC: Antoine Tremblay Subject: [PATCH] Change arglist-intro default indentation in GDB .dir-locals.el Date: Fri, 13 Jan 2017 14:35:22 -0500 Message-ID: <1484336122-3804-1-git-send-email-antoine.tremblay@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes This changes the first line in an argument list indentation so that it is indented one level rather than being aligned with the opening parens. Before you would have: function ( int a); Now you will get: function ( int a); This is done to accomodate situations where the line is very long and that writing arguments aligned with the parens can't be done in 80 chars, like in gdb/gdbserver/tracepoint.c:get_get_tsv_func_addr CORE_ADDR get_get_tsv_func_addr (void) { CORE_ADDR res; if (read_inferior_data_pointer ( ipa_sym_addrs.addr_get_trace_state_variable_value_ptr, &res)) { error ("error extracting get_trace_state_variable_value_ptr"); return 0; } return res; } There's multiple places were formatting like that is used already. I think we can make this a global policy. Note that this does not affect the other arguments so writing a multiple argument function call like: void function (int a, int b, int c) keeps the parens alignment. Unless you start with an empty line which gives: void function ( int a, int b, int c) gdb/ChangeLog: * .dir-locals.el: Add arg-list-intro indentation. * gdb-code-style.el (safe-local-variables-values): Add arg-list-intro +. --- gdb/.dir-locals.el | 1 + gdb/gdb-code-style.el | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el index a2aa196..8e0503a 100644 --- a/gdb/.dir-locals.el +++ b/gdb/.dir-locals.el @@ -25,5 +25,6 @@ (tab-width . 8) (c-basic-offset . 2) (eval . (c-set-offset 'innamespace 0)) + (eval . (c-set-offset 'arglist-intro '+)) )) ) diff --git a/gdb/gdb-code-style.el b/gdb/gdb-code-style.el index 8cdec77..bd1c8d3 100644 --- a/gdb/gdb-code-style.el +++ b/gdb/gdb-code-style.el @@ -78,5 +78,8 @@ (setq safe-local-variable-values (cons safe-local-variable-values '((eval c-set-offset 'innamespace 0) - (c-offsets-alist (innamespace . 0))))) + (c-offsets-alist (innamespace . 0)) + (eval c-set-offset 'arglist-intro '+) + (c-offsets-alist (arglist-intro . '+)) + ))) ;;; gdb-code-style.el ends here