Hello,

On Wed, Feb 07 2024, Josselin Poiret wrote:

> With a properly configured b4, one
> could simply run `b4 shazam some-msg-id` and it would automatically
> apply the corresponding patchset.

Note that you can do the same with one Emacs command while browsing Gnus
mailing lists:

--8<---------------cut here---------------start------------->8---
(defun my-apply-patch-or-abort ()
  (interactive)
  (my-apply-patch-internal "git am || git am --abort"))

(defun my-apply-patch ()
  (interactive)
  (my-apply-patch-internal "git am -3"))

(defun my-apply-patch-or-abort-attachment (n)
  (interactive "P")
  (my-apply-patch-attachment-internal "git am || git am --abort" n))

(defun my-apply-patch-attachment (n)
  (interactive "P")
  (my-apply-patch-attachment-internal "git am -3" n))

(defun my-apply-patch-attachment-internal (cmd n)
  "C-u <attachment number> M-x my-apply-..."
  (let ((git-dir "~/src/guix"))
    (save-window-excursion
      (gnus-article-part-wrapper
       n
       (lambda (handle)
         (let ((default-directory git-dir))
           (mm-pipe-part handle cmd)))))))

(defun my-apply-patch-internal (cmd)
  "Works with a selection of articles too."
  (let ((git-dir "~/src/guix")
        (articles (gnus-summary-work-articles nil)))
    (save-window-excursion
      (while articles
        (gnus-summary-goto-subject (pop articles))
        (with-current-buffer gnus-summary-buffer
          (let ((default-directory git-dir))
            (gnus-summary-save-in-pipe cmd))
          (gnus-article-hide-headers))))))
--8<---------------cut here---------------end--------------->8---

Cheers,
Clément

    • Re: Guix Day... Development of GNU Guix and the GNU System distribution.
      • Re: Guix... Clément Lassieur
        • Re: ... Development of GNU Guix and the GNU System distribution.
          • ... Clément Lassieur
      • Re: Guix... Josselin Poiret
        • Re: ... Clément Lassieur
        • Re: ... Development of GNU Guix and the GNU System distribution.
          • ... Josselin Poiret
          • ... Development of GNU Guix and the GNU System distribution.
          • ... Josselin Poiret
  • Re: Guix Days: Pa... Clément Lassieur
  • Re: Guix Days: Pa... Ricardo Wurmus

Reply via email to