Lucas Bonnet <[email protected]> writes:
> BTW, does anybody have a macro to automatically apply patches from Gnus?
> Right now I'm saving the patch to disk, and then git apply, commit,
Haven't used the following in a while, but should still work:
(defvar DE-gnus-git-directories
'(("emms" "~/emacs-packages/emms"))
"Name and directory for git projects.")
(defvar DE-gnus-git-last-dir nil)
(defun DE-gnus-apply-git-patch ()
"Run git-am on currently visible mail or posting."
(interactive)
(when (null gnus-article-buffer)
(error "No opened article buffer."))
(with-current-buffer gnus-article-buffer
(let* ((project
(completing-read
"Choose project: "
(mapcar 'car DE-gnus-git-directories)
nil t DE-gnus-git-last-dir))
(output (get-buffer-create "*git output*"))
(default-directory (file-name-as-directory
(expand-file-name
(cadr (assoc project
DE-gnus-git-directories))))))
(setq DE-gnus-git-last-dir project)
(if (zerop
(shell-command-on-region
(point-min) (point-max)
(format "git am")
output))
(message "Patch(es) applied. See *git output* for details.")
(message "There was an error running git.")
(switch-to-buffer output)))))
Regards,
David
_______________________________________________
Emms-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emms-patches