From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12345 invoked by alias); 5 Mar 2020 15:12:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 12320 invoked by uid 89); 5 Mar 2020 15:12:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Zaretskii, zaretskii, HX-Languages-Length:2104, H*Ad:U*palves X-HELO: mail-wm1-f53.google.com Received: from mail-wm1-f53.google.com (HELO mail-wm1-f53.google.com) (209.85.128.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Mar 2020 15:12:36 +0000 Received: by mail-wm1-f53.google.com with SMTP id 6so6751009wmi.5 for ; Thu, 05 Mar 2020 07:12:35 -0800 (PST) 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:user-agent; bh=TnAzMlGOsxALfYm2VvBbUDEKa9vsMq2UygJTTW8y0cA=; b=PVRIiwYdIT0eyfG1gGEkEueZqdUSZ2Cyvr5Dz312Uk91lyJyP+0OGZ8gOSjxQvhA6w kdQddgJbzm9zZptWkMPWLkYuYg96gLmNqaBeUsT1T/krLa1SqoPNvbqs4rDsyz6MNxGy +f1HmBVx51B2/CkES7E0d4xqUcQLSm07b8vKohzS9pgfM3rOEOum0emKyXps68AZ53tx oEbn5s4EAZn6e6Sqlh4hTzCGBPmoV/8wsHCDgfI+imEAdDph42E/VoBzzF8SVOPY4+HL ggBssFlLsAOhbC1z1rL+b3nVCQ4DPgUTLw57oysZskLJRqPjMEflm9PfFmr+qldMjIM1 Xw9w== Return-Path: Received: from localhost (host109-151-1-93.range109-151.btcentralplus.com. [109.151.1.93]) by smtp.gmail.com with ESMTPSA id b12sm17359895wro.66.2020.03.05.07.12.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Mar 2020 07:12:33 -0800 (PST) Date: Thu, 05 Mar 2020 15:12:00 -0000 From: Andrew Burgess To: Eli Zaretskii Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCHv2] gdbserver: Add .dir-locals.el file Message-ID: <20200305151232.GB3317@embecosm.com> References: <20200302123123.13921-1-andrew.burgess@embecosm.com> <20200302170801.GR3317@embecosm.com> <83k142y6za.fsf@gnu.org> <752d5ea0-4c7b-ca63-e1f3-b03364c53a7f@redhat.com> <83imjmy37t.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83imjmy37t.fsf@gnu.org> X-Fortune: Vests are to suits as seat-belts are to cars. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00116.txt * Eli Zaretskii [2020-03-02 21:19:18 +0200]: > > Cc: andrew.burgess@embecosm.com, gdb-patches@sourceware.org > > From: Pedro Alves > > Date: Mon, 2 Mar 2020 18:12:53 +0000 > > > > > Put a single file in the parent directory of those 3, I think. > > > > Good point. This would affect all projects in the top level, > > though perhaps the file is right for all of them. > > You can arrange for the settings to affect only some of the > subdirectories, the Emacs manual shows an example of that. I took a look at the examples, and, if I understand correctly I would need to do something like: (("gdb/" . ((tcl-mode . (... settings ...)) (nil . (... settings ...)) (c-mode . (... settings ...)) (c++-mode . (... settings ...)))) ("gdbserver/" . ((tcl-mode . (... settings ...)) (nil . (... settings ...)) (c-mode . (... settings ...)) (c++-mode . (... settings ...)))) ("gdbsupport/" . ((tcl-mode . (... settings ...)) (nil . (... settings ...)) (c-mode . (... settings ...)) (c++-mode . (... settings ...))))) As there's no easy way (I think) to define a list of settings then apply them to multiple directories. Given how rarely the .dir-locals files change, my instinct is to just add two new copies, and possibly ensure that all three versions of the file have a big comment saying "remember to update the other versions of this file located in ......". Thoughts welcome, thanks, Andrew > > > OOC, if we wanted to say, source "../gdb/.dir-locals.el" from > > a gdbserver/.dir-locals.el file, would it be possible? > > .dir-locals.el supports 'eval' forms, so you could in principle do > anything there. But my advice is to stick to simplicity, for reasons > of speed of visiting files, if nothing else. Also, maintaining such a > tricky file would need an Emacs expert, something that is not > guaranteed (although currently we have several on board). > > > I guess a symlink would do too. Except that might not work > > as nicely on Windows filesystems. > > IME, symlinks in versioned directories are a PITA.