unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: michael.albinus@gmx.de, 69017@debbugs.gnu.org
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	[thread overview]
Message-ID: <878r3sxcrp.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <867cjct6as.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 10 Feb 2024 22:26:03 +0200")

[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Cc: michael.albinus@gmx.de,  69017@debbugs.gnu.org
>> Date: Sat, 10 Feb 2024 11:58:56 -0800
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> Cc: 69017@debbugs.gnu.org
>> >> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> >> 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 <UP>
> 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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Don-t-compile-after-applying-a-patch-if-compile-comm.patch --]
[-- Type: text/x-patch, Size: 1877 bytes --]

From 861d000d35f8ed90ed47ce7cff980157d1329408 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
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


  reply	other threads:[~2024-02-10 20:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-10 17:42 bug#69017: 30.0.50; [debbugs] Make compilation step optional in debbugs-gnu-apply-patch Eric Abrahamsen
2024-02-10 18:54 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-10 19:23   ` Eric Abrahamsen
2024-02-10 19:27     ` Eli Zaretskii
2024-02-10 19:58       ` Eric Abrahamsen
2024-02-10 20:26         ` Eli Zaretskii
2024-02-10 20:52           ` Eric Abrahamsen [this message]
2024-02-11  8:18             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-11 15:05               ` Eric Abrahamsen
2024-02-11 15:43                 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-16  5:50                   ` Eric Abrahamsen
2024-02-11  8:11     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-11 15:05       ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878r3sxcrp.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=69017@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).