emms-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emms-patches] Re: [PATCH] emms-player-mpd: Only allow full second steps


From: David Engster
Subject: [Emms-patches] Re: [PATCH] emms-player-mpd: Only allow full second steps when seeking in file.
Date: Mon, 01 Mar 2010 21:59:59 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.92 (gnu/linux)

Lucas Bonnet <address@hidden> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]