From 36f9475776d13c27e1aa7f5763e4a3be45c32820 Mon Sep 17 00:00:00 2001 From: David Caldwell Date: Wed, 26 Aug 2015 10:09:45 -0700 Subject: [PATCH] [commit-patch-buffer.el] Only use local commit-patch executable if it exists. Normally the exe goes in /usr/bin and the .el files go in /usr/share/site-lisp (or the /usr/local versions of those if you aren't installing a package). Fixes #11. --- commit-patch-buffer.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commit-patch-buffer.el b/commit-patch-buffer.el index aaa1ff7..a247300 100644 --- a/commit-patch-buffer.el +++ b/commit-patch-buffer.el @@ -30,9 +30,11 @@ (require 'vc) (require 'log-edit) +;; Prefer a locally installed commit patch over one installed in the PATH. (defvar commit-patch-program - (let ((current (or load-file-name (buffer-file-name)))) - (expand-file-name "commit-patch" (file-name-directory current)))) + (let* ((this-path (or load-file-name (buffer-file-name))) + (local-path (expand-file-name "commit-patch" (file-name-directory this-path)))) + (if (file-executable-p local-path) local-path "commit-patch"))) ;; Based on vc-git-expanded-log-entry, but don't indent and only grab the full comment using --pretty (defun commit-patch-git-log-comment (revision) -- 2.51.2