From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by sourceware.org (Postfix) with ESMTPS id 404BC3853818 for ; Mon, 17 May 2021 18:52:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 404BC3853818 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wm1-x32f.google.com with SMTP id t206so4152229wmf.0 for ; Mon, 17 May 2021 11:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=wIR5aqrWinZEzsoUWodj+EOtGL3hrPVcsKaMk6g6zek=; b=hsFlHTJdb3hkR0rnxyxJMGxTgua4bdn9RkyCLB6BP8wahnW5w+17176kw9ldPtoTG7 nuE0IBKOENvpjqLwSPBrpVKDfcRc9MH+fFJ3EeMqwDiEqC15bzqWDh2zOgbrCaosCZ5B jdpObLov8NUHqscVD7QDUA/qAEn34S8cyJWWAh/d0BgEA71pY/n/05AulgAcp9EbEhqB blBbLqvdFzLskpHki4f+6UTdmOUwQ/ramXpSQN4/dUOiMNT3ZGxDAcbQ4ljXuF4faKLH /sL814wjBb851ewdWEoqWfYEZzfFKsotTOk18qSIAkk6pHQPytB9czIJm/j+TnJ+XmKo 0U4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=wIR5aqrWinZEzsoUWodj+EOtGL3hrPVcsKaMk6g6zek=; b=r3OC3i1zLmHtPOZcxTpDZ7seWQ5q+BgwAhunb+P4fWk2U6JuFcxrcKB/F1rNjNvXGX 0dvggqWeDgPAeHVpnKznL5uAA3eGoG+Rt1PGi6Jmo1HJrDx/pAVtjLDqMRpyxRG92MpZ 6kDzKCvdjOMuDqD5Ig0kqoxGho7coEwGoX8POODZ9L5Ag8N+C38uyFfoK6jhe3OZQhc8 REEzH1nIvk8okNfpIcoDQuBj7Etowd7oSHHJzncej056XnmJzKnIYFxUlS4IO94ch607 9WqYdGB3/MMi3NyhmlIcXCOUmT2kYhi+zCwoW9PqzDN5nOFzvtujbfFNbpBZUOq66tkq 7ccQ== X-Gm-Message-State: AOAM532s09xJYywit0xvi31xglyZNMN0i2SAuh+dWuxn2ekWaA7QPO2x zc5oYqjkOzksMj7FUA7Oy1iFOUY65SvW4A== X-Google-Smtp-Source: ABdhPJzVEfxJbeMHNNLRfRWip044Yc8ht8jZvRz8+gFtlICLwqq0rJAAw1Ctq8dEnmRc/m77roMZlw== X-Received: by 2002:a1c:9a53:: with SMTP id c80mr1018867wme.49.1621277538241; Mon, 17 May 2021 11:52:18 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id s6sm388497wms.0.2021.05.17.11.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 May 2021 11:52:17 -0700 (PDT) Date: Mon, 17 May 2021 19:52:16 +0100 From: Andrew Burgess To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb: additional settings for emacs in .dir-locals.el Message-ID: <20210517185216.GN3067949@embecosm.com> References: <20210517145715.1923081-1-andrew.burgess@embecosm.com> <87h7j12pk6.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h7j12pk6.fsf@tromey.com> X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 19:50:58 up 14 days, 7:45, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2021 18:52:21 -0000 * Tom Tromey [2021-05-17 12:16:57 -0600]: > >>>>> "Andrew" == Andrew Burgess writes: > > Andrew> Two additional settings for developers who use emacs: > Andrew> 1. Set brace-list-open to 0 for C and C++ modes, this ensures we > Andrew> format things like: > > I didn't understand the diff here, since it seems like this is already > done? I'm having some sort of "special" day today. Here's the _actual_ patch I'm proposing. Thanks, Andrew --- commit 43abbec1c3a4de080029e6643a4de87434608d59 Author: Andrew Burgess Date: Mon May 17 13:09:22 2021 +0100 gdb: additional settings for emacs in .dir-locals.el Two additional settings for developers who use emacs: 1. Set brace-list-open to 0 for C and C++ modes, this ensures we format things like: enum blah { .... }; Instead of the default for the emacs GNU style: enum blah { ... }; The former seems to be the GDB style. 2. Set sentence-end-double-space to t. This is actually the default value for this setting, but if anyone has customised this to nil in general, then forcing this back to t for GDB files will give a better behaviour for the paragraph filling. gdb/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. gdbserver/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. gdbsupport/ChangeLog: * .dir-locals.el: Set sentence-end-double-space for all modes, and set brace-list-open to 0 for C and C++ modes. diff --git a/gdb/.dir-locals.el b/gdb/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdb/.dir-locals.el +++ b/gdb/.dir-locals.el @@ -22,12 +22,14 @@ (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"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) ) diff --git a/gdbserver/.dir-locals.el b/gdbserver/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdbserver/.dir-locals.el +++ b/gdbserver/.dir-locals.el @@ -22,12 +22,14 @@ (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"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) ) diff --git a/gdbsupport/.dir-locals.el b/gdbsupport/.dir-locals.el index 94c07dc6850..16641bb8831 100644 --- a/gdbsupport/.dir-locals.el +++ b/gdbsupport/.dir-locals.el @@ -22,12 +22,14 @@ (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"))) + (nil . ((bug-reference-url-format . "http://sourceware.org/bugzilla/show_bug.cgi?id=%s") + (sentence-end-double-space . t))) (c-mode . ((c-file-style . "GNU") (mode . c++) (indent-tabs-mode . t) (tab-width . 8) (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) (c++-mode . ((eval . (when (fboundp 'c-toggle-comment-style) @@ -36,6 +38,7 @@ (tab-width . 8) (c-file-style . "GNU") (c-basic-offset . 2) + (eval . (c-set-offset 'brace-list-open 0)) (eval . (c-set-offset 'innamespace 0)) )) )