From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Mendler via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74631: 30.0.92; [PATCH] autoload project-recompile and set default-directory Date: Tue, 10 Dec 2024 16:38:21 +0100 Message-ID: <87frmvh7ki.fsf@daniel-mendler.de> References: <87zflffzp5.fsf@daniel-mendler.de> <02c71b77-433c-4dae-baa0-13376dee75f2@gutov.dev> Reply-To: Daniel Mendler Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19822"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74631-done@debbugs.gnu.org, Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 10 16:39:49 2024 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 1tL2Kz-00051n-Ck for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 Dec 2024 16:39:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL2KU-0001a0-S3; Tue, 10 Dec 2024 10:39:26 -0500 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 1tL2KH-0001Z7-7S for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:39:05 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2KE-0001P1-Md for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:39:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=oRmYcwG3+Yh2Fc+tf/e9YojsgTaY+fYClq4kNx4zdDw=; b=GRJLNi6zVj5TSiWbRDL39nx/fjPVV0jW9NFYIYfuEnXj13Yc+/lRw2iRoX6iXIMpPV38vtuAV8g5VEyu+f3pXtKNdPjKgVI66ONI7hiz1cOpu7TdXxX3HrvCq6twCMp4BTuvrydBP81cWDi7GI/H4R9pOecJHMzi4VYX8ke62aV/cVEE/Prb8oqZ8iVyCSVVl2p078hsApCWMtCM3K84MMGewGhxb7ReFqHaBXFFISirk6B8oObmXCMbjVKs70pkNS7PUk1IIlTpX3VtCb0+PTQfdifowPfWf4VBl8bn+YtySnUky/Rp3rBoPvxsbO0DaUHecmIZ1hHyyBLTqCC76g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tL2KE-0007eE-HE for bug-gnu-emacs@gnu.org; Tue, 10 Dec 2024 10:39:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Mendler Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 Dec 2024 15:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74631 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74631-done@debbugs.gnu.org id=D74631.173384511129285 (code D ref 74631); Tue, 10 Dec 2024 15:39:02 +0000 Original-Received: (at 74631-done) by debbugs.gnu.org; 10 Dec 2024 15:38:31 +0000 Original-Received: from localhost ([127.0.0.1]:59133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2Jj-0007cG-1z for submit@debbugs.gnu.org; Tue, 10 Dec 2024 10:38:31 -0500 Original-Received: from server.qxqx.de ([49.12.34.165]:58173 helo=mail.qxqx.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tL2Jh-0007bb-20 for 74631-done@debbugs.gnu.org; Tue, 10 Dec 2024 10:38:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=daniel-mendler.de; s=key; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=oRmYcwG3+Yh2Fc+tf/e9YojsgTaY+fYClq4kNx4zdDw=; b=METXdzy/uGYBfboz4i4Deo0LiT bFoEKKKWgR4CBhoVg21GNAwnRM1AiF9bznLJxBkE+eiPaboydyL3bl9RAmlqdd80bwUXUoXR/5fnR i4cYSJpBXNUaxuh9XgmPs0RdECLv64yCO4mr9M0ULKwHZAHalRh+Erj8L7EpjYzVbaic=; In-Reply-To: <02c71b77-433c-4dae-baa0-13376dee75f2@gutov.dev> (Dmitry Gutov's message of "Tue, 10 Dec 2024 04:10:08 +0200") 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:296759 Archived-At: Dmitry Gutov writes: > Hi Daniel, > > On 01/12/2024 12:46, Daniel Mendler wrote: >> In order to make `project-recompile' symmetric to `recompile' it should >> be autoloaded and it should run in the project root. This makes it >> possible to call `project-recompile' directly without calling `compile' >> first. >> ;;;###autoload >> (defun project-recompile (&optional edit-command) >> "Run `recompile' with appropriate buffer." >> (declare (interactive-only recompile)) >> (interactive "P") >> (let ((default-directory (project-root (project-current t))) >> (compilation-buffer-name-function >> (or project-compilation-buffer-name-function >> compilation-buffer-name-function))) >> (recompile edit-command))) >> This change also resolves the comment in project-recompile: >> ;; Should we error instead? When there's no >> ;; project-specific naming, there is no point in using >> ;; this command. > > Thanks, I've pushed this to master. > > The comment is related to the previous thread (bug#68570), and it's still > unresolved, but IIUC this doesn't make things worse, at least. > > Cc'ing Juri just in case. Thanks for installing the patch! I just saw that the docstring should probably also updated accordingly. Maybe like this: "Run `recompile' in the project root with an appropriate buffer." Daniel