From patchwork Mon Mar 2 12:31:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 38368 Received: (qmail 30241 invoked by alias); 2 Mar 2020 12:31:32 -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 30229 invoked by uid 89); 2 Mar 2020 12:31:32 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=*h X-HELO: mail-wr1-f51.google.com Received: from mail-wr1-f51.google.com (HELO mail-wr1-f51.google.com) (209.85.221.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Mar 2020 12:31:31 +0000 Received: by mail-wr1-f51.google.com with SMTP id v4so12332296wrs.8 for ; Mon, 02 Mar 2020 04:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ySIfTpDMyGOE69jY96xycOFMsM+jxagHo0IHM704pbQ=; b=akz5ibv+h7nuCYLlJ3UGMoumVD1QJeBZlJG2AOQ5iVZBIEW9HEx46oWd7QP7Uv0hdi aKKyzxDPk2xU6ecMCTwXFVi7cHX8+4HfsbaLK3UsbYFvpFGEI2svqUcthDw7Jb5hEPNn umu6ddyk40DWxVqgKNaVV2bsVG6M5jQaD0hPAA2BZ3sI1k7D8g22Jlqbz4D1wg632wkm 0AXnQbNVDWpQGjM/l0hzG0st2k2aScIAKE6+lhHHIGKLtW21VhVP0NvZrwAoR1qNClVk UXH18j2rDu9tq7pNSiU20hd6CemDr3gCrDFKnbJ4PcSKbWswif6OHKNSQQPuTRbiwGRF DQUw== Return-Path: Received: from localhost ([212.69.42.53]) by smtp.gmail.com with ESMTPSA id i4sm15183632wmd.23.2020.03.02.04.31.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Mar 2020 04:31:26 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2] gdbserver: Add .dir-locals.el file Date: Mon, 2 Mar 2020 12:31:23 +0000 Message-Id: <20200302123123.13921-1-andrew.burgess@embecosm.com> In-Reply-To: References: X-IsSubscribed: yes Baris, Good spot on the *.h files, I hadn't considered them. I did look breifly at how I might change the mode only for *.h files, but couldn't see anything obvious, and as we don't currently have any *.c files I just restored the c-mode to c++-mode setting. Thanks, Andrew --- Copy the .dir-locls.el file from gdb/ to gdbserver/ so that we get the GNU style when editing these files in Emacs. I initially wanted to remove the (c-mode . ((mode . c++))) that switches c-mode files into c++-mode as we store C++ code in *.cc files in the gdbserver/ directory, unlike gdb/ where we use *.c, however, I was forgetting about the header files - we still use *.h for our C++ header files, so for now I left the settings in place to open all C files in c++-mode. The copyright date in the new file is left as for gdb/.dir-locals.el, as the new file is a copy of the old with just one new comment added, this is inline with this rule: https://sourceware.org/gdb/wiki/ContributionChecklist#Copyright_Header gdbserver/ChangeLog: * .dir-locals.el: New file. --- gdbserver/.dir-locals.el | 39 +++++++++++++++++++++++++++++++++++++++ gdbserver/ChangeLog | 4 ++++ 2 files changed, 43 insertions(+) create mode 100644 gdbserver/.dir-locals.el diff --git a/gdbserver/.dir-locals.el b/gdbserver/.dir-locals.el new file mode 100644 index 00000000000..29c3d69869e --- /dev/null +++ b/gdbserver/.dir-locals.el @@ -0,0 +1,39 @@ +;; Emacs settings. +;; Copyright (C) 2012-2020 Free Software Foundation, Inc. + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +( + (tcl-mode . ((tcl-indent-level . 4) + (tcl-continued-indent-level . 4) + (indent-tabs-mode . t))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s"))) + ;; We store C++ headers in files matching *.h, which is usually for C + ;; headers, so here we arrange to switch all c-mode files into c++-mode. + (c-mode . ((c-file-style . "GNU") + (mode . c++) + (indent-tabs-mode . t) + (tab-width . 8) + (c-basic-offset . 2) + (eval . (c-set-offset 'innamespace 0)) + )) + (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) + (c-toggle-comment-style 1))) + (indent-tabs-mode . t) + (tab-width . 8) + (c-file-style . "GNU") + (c-basic-offset . 2) + (eval . (c-set-offset 'innamespace 0)) + )) +)