From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#69017: 30.0.50; [debbugs] Make compilation step optional in debbugs-gnu-apply-patch Date: Sat, 10 Feb 2024 12:52:42 -0800 Message-ID: <878r3sxcrp.fsf@ericabrahamsen.net> References: <877cjcz04e.fsf@ericabrahamsen.net> <87plx4b14w.fsf@gmx.de> <87il2wxgwd.fsf@ericabrahamsen.net> <86bk8ot8zx.fsf@gnu.org> <87eddkxf9b.fsf@ericabrahamsen.net> <867cjct6as.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2639"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: michael.albinus@gmx.de, 69017@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 10 21:53:56 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 1rYuMG-0000Uh-Kz for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Feb 2024 21:53:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rYuM7-0007zu-A6; Sat, 10 Feb 2024 15:53:47 -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 1rYuM6-0007zl-IN for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:53:46 -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 1rYuM6-0004EN-AK for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:53:46 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rYuMM-0003Zi-2S for bug-gnu-emacs@gnu.org; Sat, 10 Feb 2024 15:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Feb 2024 20:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69017 X-GNU-PR-Package: emacs Original-Received: via spool by 69017-submit@debbugs.gnu.org id=B69017.170759838913601 (code B ref 69017); Sat, 10 Feb 2024 20:54:02 +0000 Original-Received: (at 69017) by debbugs.gnu.org; 10 Feb 2024 20:53:09 +0000 Original-Received: from localhost ([127.0.0.1]:40704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYuLU-0003XH-O7 for submit@debbugs.gnu.org; Sat, 10 Feb 2024 15:53:09 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:59240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rYuLS-0003Wb-8P for 69017@debbugs.gnu.org; Sat, 10 Feb 2024 15:53:07 -0500 Original-Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 5A2C7FA0B2; Sat, 10 Feb 2024 20:52:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1707598363; bh=UYZKwQycsxxzqH7TfBejX3h1wVrLITIwwLV17tcWyx0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=LqhM5HAcAL3e1k6UhtGNWCqBmGxKLpx/sFhS7jGgMBvH2P/2C50u7Sh10mK2KswtF 3cg/v7QN6aPnqyvMpxwBL7sHiwxeLQNcmsY6cAWR6Asajf4X/KbGqChMZOBYXomVDw ZOfrkiQltE6rh2ZJJLsw2YsfVK8h2ZMZuU1qU8uY= In-Reply-To: <867cjct6as.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 10 Feb 2024 22:26:03 +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:279798 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Eric Abrahamsen >> Cc: michael.albinus@gmx.de, 69017@debbugs.gnu.org >> Date: Sat, 10 Feb 2024 11:58:56 -0800 >> >> Eli Zaretskii writes: >> >> >> Cc: 69017@debbugs.gnu.org >> >> From: Eric Abrahamsen >> >> Date: Sat, 10 Feb 2024 11:23:30 -0800 >> >> >> >> Out of curiosity, do you use any convenience functions for applying >> >> patches from email->repository? >> > >> > I use M-|, FWIW. >> >> That's what I was trying to avoid! You're the one who has to handle >> attachments vs inline, type out the directory location, decide between >> "git am" and "git apply", etc... >> >> If you're doing it 50 times a day, maybe the muscle memory (or command >> history) means it's not a big deal. > > Emacs remembers the command history, so all I have to do is press > a few times, after I type M-|, then type RET. > > And some figuring out is still up to you, because patches could be for > the release branch or for the master (and maybe for a few more > branches), so you'd need some "cd foo" before "git am". I have a > command for master and for the release branch, and I need to decide > which one to use in each case. That cannot be automated. Yup, that makes plenty of sense. Your situation is more complicated than mine, no surprise there! I've attached the minimum workable approach, which just lets the user set the compile command to nil to skip compilation, and the relevant window rearrangements afterwards. A fuller solution might be a "after-apply-patch-actions" option, that takes a list like '(compile vc). That could obviate `debbugs-gnu-apply-patch-prefers-magit' because you could just set the list to '(compile magit) instead. But that would require a pretty thorough reworking of the window munging code that comes at the end, and I'd like to just keep this simple. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Don-t-compile-after-applying-a-patch-if-compile-comm.patch >From 861d000d35f8ed90ed47ce7cff980157d1329408 Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Sat, 10 Feb 2024 12:38:31 -0800 Subject: [PATCH] Don't compile after applying a patch, if compile command is nil * debbugs-gnu.el (debbugs-gnu-apply-patch): Allow the user to set debbugs-gnu-compile-command to nil to skip the compile step. --- debbugs-gnu.el | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/debbugs-gnu.el b/debbugs-gnu.el index a5453334cd..f4f1fce7da 100644 --- a/debbugs-gnu.el +++ b/debbugs-gnu.el @@ -2612,12 +2612,13 @@ If SELECTIVELY, query the user before applying the patch." (insert-file-contents-literally rej)) (goto-char (point-max)) (save-some-buffers t) - (require 'compile) - (mapc #'kill-process compilation-in-progress) - (compile - (format "cd %s; %s" - debbugs-gnu-current-directory - debbugs-gnu-compile-command)) + (when debbugs-gnu-compile-command + (require 'compile) + (mapc #'kill-process compilation-in-progress) + (compile + (format "cd %s; %s" + debbugs-gnu-current-directory + debbugs-gnu-compile-command))) (let (buf) (if (debbugs-gnu-apply-patch-prefers-magit) (progn @@ -2637,11 +2638,12 @@ If SELECTIVELY, query the user before applying the patch." (delete-other-windows) (switch-to-buffer output-buffer) (split-window) - (split-window) - (other-window 1) - (switch-to-buffer "*compilation*") - (goto-char (point-max)) - (other-window 1) + (when debbugs-gnu-compile-command + (split-window) + (other-window 1) + (switch-to-buffer "*compilation*") + (goto-char (point-max)) + (other-window 1)) (switch-to-buffer buf) (goto-char (point-min))))) -- 2.43.0 --=-=-=--