From patchwork Wed Jul 31 15:21:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Arsen_Arsenovi=C4=87?= X-Patchwork-Id: 1967188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=aarsen.me header.i=@aarsen.me header.a=rsa-sha256 header.s=MBO0001 header.b=NwgWKYUb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WYx4s1lnKz1yYq for ; Thu, 1 Aug 2024 01:35:41 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79E5F3858288 for ; Wed, 31 Jul 2024 15:35:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050:0:465::103]) by sourceware.org (Postfix) with ESMTPS id 7606C3858C35 for ; Wed, 31 Jul 2024 15:35:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7606C3858C35 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7606C3858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2050:0:465::103 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722440118; cv=none; b=LluEX82U18a+nAhMvdJxbfD4tgk6qvQ7ibjpJ7JygyA1EcTkg85hqnXuSyhGwuL3W0LXvLDu01642QsWW51z/M8x7JoC+QDHcxQa6LDsmy4fcBSE1i74u49x660rpMnAW2l7MV/bV7YTtbu3i4whMJ8agOg4s3611ANMRjTr6ak= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722440118; c=relaxed/simple; bh=g/SsELpJFKjYIKlNNhsAzJWCiKh0PDLl2zJW5BX5/Vk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GZHCgQA23X8pudEUXMtmaTlya6318jvghQn+szE0s9ThnyTH7nTGAOLxV++ymNRyY4rIOkNqyDVX/Q2IpACFTcuqxN0TWdopGAFQSVocr9e/WHA6oyDBP7tAhp/KWh3faAdkOVi5+mRlqJwR1lHnxHhBglUkM29PG4d4A0t972U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4WYx4J2b9Pz9sc4; Wed, 31 Jul 2024 17:35:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1722440112; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W5KZ8cK2qmkC2yOwe4YoOfm7e+/XUyu3LYW1rHUFIsM=; b=NwgWKYUbzya5f1IuPu/GRObfEsho4Ra1WlumoIQ4RVIZlrnUNiJbrSN05aY4LUWkzx2mJZ obUxjdDBNm+QCZnVzwAoFXIJjOwQUD3yoxo55luD7hjT5RZB6P6QDsUuBrsp9AMxY97G7h UrxUZPMvQqMzm3pwnzIoKGbQFKi1FNgNLKdaIsQBbZlwe4rL7QaYQiTekUNR1lDUsqiSKO BhHmOwCCl1ORac6+vR4q60KOpaLA7nKD2F+dfUmsQTJYEhifgiBBgZAr2CqoP04I5BTkbA Cik5Xo8kzwi+IvG5uHJTXB92ZFy0DyvdyAZRMj75sx0Mh1l+MGdg6F1Mog1ERg== From: =?utf-8?q?Arsen_Arsenovi=C4=87?= To: gcc-patches@gcc.gnu.org Cc: =?utf-8?q?Arsen_Arsenovi=C4=87?= Subject: [PATCH] dir-locals: apply our C settings in C++ also Date: Wed, 31 Jul 2024 17:21:49 +0200 Message-ID: <20240731153438.42540-1-arsen@aarsen.me> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4WYx4J2b9Pz9sc4 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_INFOUSMEBIZ, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org We haven't been applying our settings to our C++. This patch fixes that. Sadly, it seems that the only documented way to apply settings to multiple modes is to repeat them. I thought that we can provide a list of modes to apply, but that seems to not be the case (even thought it happened to work on my machine). As a result, C-h C-v fill-column now shows: This variable’s value is directory-local, set by the file ‘/home/arsen/gcc/pristine/.dir-locals.el’. As this could affect peoples workflows, I'm posting as a heads-up and sanity check. OK for trunk? TIA, have a lovely day. ---------- >8 ---------- This also works with Emacs 30 Tree-Sitter C and C++ modes, as they are submodes. ChangeLog: * .dir-locals.el: Change c-mode to a list of C, C++ and ObjC modes that Emacs currently provides. --- .dir-locals.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.dir-locals.el b/.dir-locals.el index fa031cbded99..2c12b3866633 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -18,6 +18,10 @@ (tcl-continued-indent-level . 4) (indent-tabs-mode . t))) (nil . ((bug-reference-url-format . "https://gcc.gnu.org/PR%s"))) + ;; Please keep C and C++ in sync. (c-mode . ((c-file-style . "GNU") (indent-tabs-mode . t) - (fill-column . 79)))) + (fill-column . 79))) + (c++-mode . ((c-file-style . "GNU") + (indent-tabs-mode . t) + (fill-column . 79))))