From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Question about dir-locals c-mode. Date: Sun, 08 Nov 2020 12:58:53 -0500 Message-ID: References: <20201107235056.5lwabkhbflx2gc6o.ref@Ergus> <20201107235056.5lwabkhbflx2gc6o@Ergus> <20201108161635.xri5oez4zarynl3b@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11422"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Ergus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 08 18:59:29 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kboyO-0002rg-Iz for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 18:59:28 +0100 Original-Received: from localhost ([::1]:58198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kboyK-0003wT-0y for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 08 Nov 2020 12:59:27 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kboxx-0003vu-5D for help-gnu-emacs@gnu.org; Sun, 08 Nov 2020 12:59:01 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kboxu-0007bi-50 for help-gnu-emacs@gnu.org; Sun, 08 Nov 2020 12:59:00 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 11FEA10025D; Sun, 8 Nov 2020 12:58:56 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9759110023D; Sun, 8 Nov 2020 12:58:54 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1604858334; bh=0wBbv45btC7Eje3rHfh+KiJl6NtFIYOcwmC4LrouXX0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=pGMCRMYIpfNHY7hPyuVhLziYZwl8WDS+E5FZ6i1CB4p9JUTskkU+MY+7GylBqgrSo iZmRb+7zPSrD/n6wUkLwA6tJXvAhUCVCOe1/9oCVHy823qC76K2fLRJT3jwB48z4tx 4hTwN2zLbZq14jfp/FDe0qEslfUA4giEaQvWpM4GGJf/gZ+igs0Eqhc2DbPUMVxfeU y4QHoWD9QgWNE9l289KPiUaZ/CZChQ6+KuwH5GxhfKj/auV2TzjSPikFtH7XxVjyJW 95uSI6lXGWAMi9e8Uvb3sCjwe0Jn7qUSZ2hS1bxqrwIVuBSWZH2lJCd1/KOgyP4h0n 6+X981lmQ/QdA== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 6CCF4120315; Sun, 8 Nov 2020 12:58:54 -0500 (EST) In-Reply-To: <20201108161635.xri5oez4zarynl3b@Ergus> (Ergus's message of "Sun, 8 Nov 2020 17:16:35 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/08 12:58:56 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125105 Archived-At: >>> (c++-mode . (...Long...)) >>> (c-mode . (...Long...)) >>FWIW, I had sent a patch to CC-mode to introduce a parent mode shared by >>c-mode, c++-mode, and objc-mode, but Alan didn't like the idea. > :( There is the c-mode-common-hook I was actually expecting that there > should be something like c-mode-common. Somehow it seems intuitive for > me. Some packages like irony have actually some hacks to go around this > too. Note that `c-mode-common-hook` is not just common to C-like languages but applies to all modes using the CC-mode framework, which includes java-mode, awk-mode, php-mode, sieve-mode, and various others. So it risks being "too common" for the kind of usage you describe (and yes, my patch had two parent modes: one common to C, C++, and ObjC, and another one on top common to all CC-mode derivatives). Stefan