[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate 629423345e 3/6: Add revert-buffer-function to a
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate 629423345e 3/6: Add revert-buffer-function to agitate-vc-git-show |
Date: |
Thu, 29 Sep 2022 07:57:18 -0400 (EDT) |
branch: externals/agitate
commit 629423345e743061c8374332c19048345e8a436b
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add revert-buffer-function to agitate-vc-git-show
---
agitate.el | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
diff --git a/agitate.el b/agitate.el
index 39de35dc02..bfd0c76f79 100644
--- a/agitate.el
+++ b/agitate.el
@@ -318,18 +318,25 @@ The number of completion candidates is limited to the
value of
`vc-log-show-limit'."
(declare (interactive-only t))
(interactive "P")
- (when-let* ((file (caadr (vc-deduce-fileset))) ; FIXME 2022-09-27: Better
way to get current file?
- (revision (agitate--vc-git-get-hash-from-string
- (agitate--vc-git-commit-prompt
- (when current-file file))))
- (buf "*agitate-vc-git-show*"))
- (apply 'vc-git-command (get-buffer-create buf) nil (when current-file file)
- (list "show" "--patch-with-stat" revision))
- ;; TODO 2022-09-27: What else do we need to set up in such a
- ;; buffer?
- (with-current-buffer (pop-to-buffer buf)
- (diff-mode)
- (goto-char (point-min)))))
+ (when-let ((file (caadr (vc-deduce-fileset))))
+ (let* ((f (when current-file file))
+ (revision (agitate--vc-git-get-hash-from-string
+ (agitate--vc-git-commit-prompt
+ f)))
+ (buf "*agitate-vc-git-show*")
+ (args (list "show" "--patch-with-stat" revision)))
+ (apply 'vc-git-command (get-buffer-create buf) nil f args)
+ ;; TODO 2022-09-27: What else do we need to set up in such a
+ ;; buffer?
+ (with-current-buffer (pop-to-buffer buf)
+ (diff-mode)
+ (setq-local revert-buffer-function
+ (lambda (_ignore-auto _noconfirm)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (apply 'vc-git-command (get-buffer buf) nil f args)
+ (goto-char (point-min)))))
+ (goto-char (point-min))))))
(defun agitate--vc-git-format-patch-single-commit ()
"Help `agitate-vc-git-format-patch-single' with its COMMIT."
- [elpa] externals/agitate updated (905e921029 -> 723c9b072b), ELPA Syncer, 2022/09/29
- [elpa] externals/agitate 5fbe6e3f85 2/6: Always go to point-min in agitate-vc-git-show, ELPA Syncer, 2022/09/29
- [elpa] externals/agitate a04f65e8bc 4/6: Remove unused variable, ELPA Syncer, 2022/09/29
- [elpa] externals/agitate 73299258f4 5/6: Make agitate-diff-refine-cycle NONE state explicit, ELPA Syncer, 2022/09/29
- [elpa] externals/agitate 629423345e 3/6: Add revert-buffer-function to agitate-vc-git-show,
ELPA Syncer <=
- [elpa] externals/agitate f91849b996 1/6: Add completion table to disable sorting of commits, ELPA Syncer, 2022/09/29
- [elpa] externals/agitate 723c9b072b 6/6: Add agitate--log-view-on-revision-p and use it, ELPA Syncer, 2022/09/29