[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/agitate f91849b996 1/6: Add completion table to disable
From: |
ELPA Syncer |
Subject: |
[elpa] externals/agitate f91849b996 1/6: Add completion table to disable sorting of commits |
Date: |
Thu, 29 Sep 2022 07:57:18 -0400 (EDT) |
branch: externals/agitate
commit f91849b996e3cf2929560dd7c027b7dc23a4cf4d
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Add completion table to disable sorting of commits
This is important as we want the list of commits to be in the order
they appear in the logs. Otherwise it is impossible to find what we
are looking for.
---
agitate.el | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/agitate.el b/agitate.el
index 37cfa363fb..4ccabeb357 100644
--- a/agitate.el
+++ b/agitate.el
@@ -70,6 +70,18 @@ will render those as their corresponding graphical emoji."
:type '(repeat string)
:group 'agitate)
+(defun agitate--completion-table-no-sort (candidates &optional category
annotation)
+ "Make completion table for CANDIDATES with sorting disabled.
+CATEGORY is the completion category.
+ANNOTATION is an annotation function."
+ (lambda (str pred action)
+ (if (eq action 'metadata)
+ `(metadata (display-sort-function . identity)
+ (cycle-sort-function . identity)
+ (annotation-function . ,annotation)
+ (category . ,category))
+ (complete-with-action action candidates str pred))))
+
;;;; Commands for diff-mode
(defvar-local agitate--refine-diff-state nil
@@ -278,11 +290,17 @@ With optional LONG do not abbreviate commit hashes."
(default-directory (vc-root-dir)))
(completing-read
prompt
- (process-lines
- vc-git-program "log"
- (format "-n %d" vc-log-show-limit)
- (if long "--pretty=oneline" "--oneline")
- (or file "--"))
+ ;; TODO 2022-09-29: Define a completion category that can work
+ ;; with `consult', `embark', `marginalia', and friends?
+ ;;
+ ;; TODO 2022-09-29: Define an annotation function? Though we can
+ ;; just tweak the git arguments.
+ (agitate--completion-table-no-sort
+ (process-lines
+ vc-git-program "log"
+ (format "-n %d" vc-log-show-limit)
+ (if long "--pretty=oneline" "--oneline")
+ (or file "--")))
nil t)))
(defvar agitate-vc-git-show-buffer "*agitate-vc-git-show*"
- [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, 2022/09/29
- [elpa] externals/agitate f91849b996 1/6: Add completion table to disable sorting of commits,
ELPA Syncer <=
- [elpa] externals/agitate 723c9b072b 6/6: Add agitate--log-view-on-revision-p and use it, ELPA Syncer, 2022/09/29