branch: externals/diff-hl
commit 5ac2255468feba461919b073f102204dffecfe80
Author: James Cherti <[email protected]>
Commit: James Cherti <[email protected]>

    Ensure commands use the user's active buffer
---
 diff-hl-show-hunk.el | 2 +-
 diff-hl.el           | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el
index 947a1eb257..c9b2178825 100644
--- a/diff-hl-show-hunk.el
+++ b/diff-hl-show-hunk.el
@@ -129,7 +129,7 @@ Then put the differences inside a special buffer and set the
 point in that buffer to the corresponding line of the original
 buffer."
   (defvar vc-sentinel-movepoint)
-  (let* ((buffer (or (buffer-base-buffer) (current-buffer)))
+  (let* ((buffer (current-buffer))
          (diff-hl-update-async nil)
          (line (line-number-at-pos))
          (dest-buffer diff-hl-show-hunk-diff-buffer-name))
diff --git a/diff-hl.el b/diff-hl.el
index 0fcb207640..81c9f0f048 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -878,7 +878,7 @@ Return a list of line overlays used."
 With double prefix argument (C-u C-u), the diff is made against the
 reference revision."
   (interactive (list current-prefix-arg))
-  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+  (with-current-buffer (current-buffer)
     (if (equal historic '(16))
         (diff-hl-diff-reference-goto-hunk)
       (diff-hl-diff-goto-hunk-1 historic nil))))
@@ -886,7 +886,7 @@ reference revision."
 (defun diff-hl-diff-reference-goto-hunk ()
   "Run VC diff command against the reference and go to the corresponding line."
   (interactive)
-  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+  (with-current-buffer (current-buffer)
     (diff-hl-diff-goto-hunk-1 nil diff-hl-reference-revision)))
 
 (defun diff-hl-root-diff-reference-goto-hunk ()
@@ -895,7 +895,7 @@ And if the current buffer is visiting a file, and it has 
changes, the diff
 buffer will show the position corresponding to its current line."
   (interactive)
   (defvar vc-sentinel-movepoint)
-  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+  (with-current-buffer (current-buffer)
     (let ((backend (vc-deduce-backend))
           (default-directory default-directory)
           rootdir fileset
@@ -1101,7 +1101,7 @@ its end position."
 (defun diff-hl-revert-hunk ()
   "Revert the diff hunk with changes at or above the point."
   (interactive)
-  (with-current-buffer (or (buffer-base-buffer) (current-buffer))
+  (with-current-buffer (current-buffer)
     (diff-hl-revert-hunk-1)))
 
 (defun diff-hl-hunk-overlay-at (pos)

Reply via email to