From 424aa97cf4398ed7844ce28b59d655603f364648 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Sun, 21 Mar 2010 14:48:27 -0700 Subject: [PATCH] [commit-patch-buffer.el] Do the old interactive stuff when the current buffer is not in diff-mode. This avoids tyring to do diff-hunk-next in autodetect-patch-directory-root and is more flexible all around. --- commit-patch-buffer.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index 3aae596..28a0273 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -56,9 +56,14 @@ "*commit*"))) (defun commit-patch-buffer () - "Commit the patch in the current buffer, applying it to the appropriate directory." + "Commit the patch in the current buffer, applying it to the +appropriate directory. If the current buffer is not in diff-mode +then it will ask interactively which buffer to commit and to which +directory to commit it." (interactive) - (commit-patch-buffer-manually (buffer-name) (autodetect-patch-directory-root))) + (if (eq major-mode 'diff-mode) + (commit-patch-buffer-manually (buffer-name) (autodetect-patch-directory-root)) + (call-interactively 'commit-patch-buffer-manually))) (defun autodetect-patch-directory-root () "Tries to autodect where a patch should be committed from using the -- 2.51.2