From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries Date: Thu, 25 May 2023 19:14:36 +0300 Message-ID: References: <83sfbvxkj3.fsf@gnu.org> <3d97111e-794d-eeef-73b0-ee3f6f5f15d5@gutov.dev> <83jzx6w2bg.fsf@gnu.org> <6a3eed52-3248-74f9-bcaf-bf12660ae0ed@gutov.dev> <83h6savsz4.fsf@gnu.org> <83mt21vfgl.fsf@gnu.org> <86mt211vk3.fsf@mail.linkov.net> <0ce4532f-03aa-6afe-bd8f-8ef1df6615de@gutov.dev> <86ilco7qbs.fsf@mail.linkov.net> <83r0rctxbc.fsf@gnu.org> <867ct4b4ds.fsf@mail.linkov.net> <835y8otbub.fsf@gnu.org> <86o7mccl5z.fsf@mail.linkov.net> <63854a1a-8178-d039-288c-34b1e67e5b06@gutov.dev> <86ttw3blc6.fsf@mail.linkov.net> <86sfbm6hp5.fsf@mail.linkov.net> <86jzwyw8j5.fsf@mail.linkov.net> <6a5c2251-52a8-e389-f2ab-08da775fab82@gutov.dev> <867csw53fm.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10492"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Cc: sbaugh@janestreet.com, Eli Zaretskii , 63469@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 25 18:15:29 2023 Return-path: Envelope-to: geb-bug-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 1q2Dcd-0002ST-S3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 May 2023 18:15:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2DcH-0006Q6-QW; Thu, 25 May 2023 12:15:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2DcF-0006Pc-Lx for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 12:15:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2DcE-0005Dk-OS for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 12:15:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q2DcE-0002BO-9G for bug-gnu-emacs@gnu.org; Thu, 25 May 2023 12:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 May 2023 16:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63469 X-GNU-PR-Package: emacs Original-Received: via spool by 63469-submit@debbugs.gnu.org id=B63469.16850312878352 (code B ref 63469); Thu, 25 May 2023 16:15:02 +0000 Original-Received: (at 63469) by debbugs.gnu.org; 25 May 2023 16:14:47 +0000 Original-Received: from localhost ([127.0.0.1]:47941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Dbz-0002Ad-FG for submit@debbugs.gnu.org; Thu, 25 May 2023 12:14:47 -0400 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:40207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q2Dbx-0002AR-Vq for 63469@debbugs.gnu.org; Thu, 25 May 2023 12:14:46 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 11FF8320090F; Thu, 25 May 2023 12:14:40 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 25 May 2023 12:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1685031279; x=1685117679; bh=E+qBiSK5ZMSV7mVQahV1qfDNSKThGvMcR5Z aCRGPbDo=; b=jryUmoZBMwKSLhUb9lMJHL+ahzD/oVtb1kDVy5lpSg/P5uzUJpX G0V8qSKgLAZc77Vu/8Vf8/l+/CWKWvuJPmZRz1pLskZ6eKIJgXc+/0B/3gUHL2kx YNyoWzDAAXMRdK9YbehF69meNdQJfb8+CEQ3LeF1ZktsGzI3tKBXNT/fVXAX/wDV SGwWT0sw3JGdO2LwP55AVk1WPkIc2garaLLd5y9s3YdzCmVP3PC5s738V0YtyXZN ZkwOpjN2v5ewJPGZW9PhttZCawAjhElBuS1mxkX2kZsF1If2uf37VpHfEHQqNg3Q cwPo7B5I2gnkhVjRQFcSD6NRzdJMrwR2tXQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1685031279; x=1685117679; bh=E+qBiSK5ZMSV7mVQahV1qfDNSKThGvMcR5Z aCRGPbDo=; b=yuSB+QNWXr/S5E2FMiNkQKuCcyGvupORUBAN9YZDfnVW1cCq6is 70sCvLHYjDBR82wNxsY0e5xFZvg7hE8TU3mc2dwEgc3SEclgWlga1bt8V0TcU6Hc +Yu+BYVZ+nFIzxHnDD1a6qecBW1PQJJgRBi1MoR2zh3yhELMjQqMSdNh9nGk1+ix lEewLQMnAlVtB/yEL/ylD3iwqFqvp82AGG05BKTKP0dZK+/4FmwcqUTXb2F2lYHP 64Uj83kWLfstxU9IVR2VvByUHo0/tDkJGZiEUMbKbZKC8nxtKTFmgDVm6OfLT+uA TQTFMFtWDENzOwFKOSJD7tfwovYbKcsWk7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejjedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 May 2023 12:14:38 -0400 (EDT) Content-Language: en-US In-Reply-To: <867csw53fm.fsf@mail.linkov.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:262378 Archived-At: On 25/05/2023 09:29, Juri Linkov wrote: >>> I see no way to set the same project name both for >>> non-file and file buffers. >> >> Please try the patch below. It might have non-negligible effect on >> performance though. Please try and report back. >> >> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el >> index 7c51778d5d4..1494665d565 100644 >> --- a/lisp/progmodes/project.el >> +++ b/lisp/progmodes/project.el >> @@ -816,8 +816,8 @@ project-buffers >> (push buf bufs))) >> (nreverse bufs))) >> >> -(cl-defmethod project-name ((_project (head vc))) >> - (or project-vc-name >> +(cl-defmethod project-name ((project (head vc))) >> + (or (project--value-in-dir 'project-vc-name (project-root project)) >> (cl-call-next-method))) > > Thanks, I confirm this uses project-vc-name from dir-locals in non-file buffers. If you had a chance to verify that the performance is good enough (for using the result in the mode-line), that would be great. Either way... >>> The standard solution is just to use e.g.: >>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp) >> >> Huh, so the attribute :safe only makes proper sense for preloaded packages >> and autoloaded defcustom forms (which are discouraged anyway). >> >> Do you want to write a patch for all those vars in project.el? It will >> probably make sense to push it to emacs-29. > > With this patch the problem is solved. I can push it to emacs-29. ...this patch LGTM too. Please go ahead and install it, or even both patches.