From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <andrew.burgess@embecosm.com>
Subject: [PATCHv2] gdbserver: Add .dir-locals.el file
Date: Mon, 02 Mar 2020 12:31:00 -0000 [thread overview]
Message-ID: <20200302123123.13921-1-andrew.burgess@embecosm.com> (raw)
In-Reply-To: <BYAPR11MB3030F2DF420DBF609C29D890C4E70@BYAPR11MB3030.namprd11.prod.outlook.com>
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 <http://www.gnu.org/licenses/>.
+
+(
+ (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))
+ ))
+)
next prev parent reply other threads:[~2020-03-02 12:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 9:53 [PATCH] " Andrew Burgess
2020-03-02 10:17 ` Aktemur, Tankut Baris
2020-03-02 12:31 ` Andrew Burgess [this message]
2020-03-02 14:06 ` [PATCHv2] " Pedro Alves
2020-03-02 17:08 ` Andrew Burgess
2020-03-02 17:34 ` Pedro Alves
2020-03-02 17:58 ` Eli Zaretskii
2020-03-02 18:13 ` Pedro Alves
2020-03-02 19:19 ` Eli Zaretskii
[not found] ` <20200305151232.GB3317@embecosm.com>
2020-03-05 15:26 ` Eli Zaretskii
2020-03-05 16:00 ` Pedro Alves
[not found] ` <BYAPR11MB3030342645BFA8E7610CF862C4E70@BYAPR11MB3030.namprd11.prod.outlook.com>
2020-03-02 12:02 ` [PATCH] " Andrew Burgess
2020-03-02 14:05 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200302123123.13921-1-andrew.burgess@embecosm.com \
--to=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox