[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and
From: |
ELPA Syncer |
Subject: |
[elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and remove the ugly hack |
Date: |
Thu, 9 Sep 2021 15:58:46 -0400 (EDT) |
branch: externals/vc-got
commit 1b2afa91b18f06f6ad3df88bc45c9176d2d3f9b8
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>
rework the vc-dir handling and remove the ugly hack
With this our *vc-dir* looks more like the others. Instead of showing
something like stage:edit we only add `M', `D' or `A' (the got status
flags), and so we don't need the ugly hack too.
---
vc-got.el | 70 ++++++++++++++++++++++++---------------------------------------
1 file changed, 27 insertions(+), 43 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 54a9930..0ef924d 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -248,9 +248,11 @@ files)."
collect (let* ((file-status (prog1 (vc-got--parse-status-char
(char-after))
(forward-char)))
- (stage-status (prog1 (vc-got--parse-stage-char
- (char-after))
- (forward-char)))
+ (stage-status (let* ((c (char-after)))
+ (prog1
+ (when (member c '(?M ?A
?D))
+ c)
+ (forward-char))))
(filename (progn
(forward-char)
(buffer-substring (point)
@@ -274,13 +276,6 @@ files)."
(?m 'edited) ; modified file modes
(?N nil)))
-(defun vc-got--parse-stage-char (c)
- "Parse the stage status char C into a symbol."
- (cl-case c
- (?M 'edit)
- (?A 'add)
- (?D 'remove)))
-
(defun vc-got--tree-parse ()
"Parse into an alist the output of got tree -i in the current buffer."
(goto-char (point-min))
@@ -514,36 +509,37 @@ FILES is nil, consider all the files in DIR."
(stage-state (vc-dir-fileinfo->extra info))
(filename (vc-dir-fileinfo->name info)))
(insert
+ " "
(propertize
(format "%c" (if (vc-dir-fileinfo->marked info) ?* ? ))
'face 'font-lock-type-face)
- " "
+ " "
(propertize
- (if stage-state
- (format "staged:%-6s" stage-state)
- (format "%-13s" ""))
- 'face (cond ((memq stage-state '(add edit)) 'font-lock-constant-face)
- ((eq stage-state 'remove) 'font-lock-warning-face)
- (t 'font-lock-variable-name-face)))
- " "
- (propertize
- (format "%-14s" state)
+ (format "%-12s" state)
'face (cond ((eq state 'up-to-date) 'font-lock-builtin-face)
((memq state '(missing conflict)) 'font-lock-warning-face)
((eq state 'edited) 'font-lock-constant-face)
(t 'font-lock-variable-name-face))
- 'mouse-face 'highlight)
- " "
- (propertize
- (format "%s" filename)
- 'face
- (if isdir 'font-lock-comment-delimiter-face
'font-lock-function-name-face)
- 'help-echo
- (if isdir
- "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu"
- "File\nmouse-3: Pop-up menu")
'mouse-face 'highlight
- 'keymap vc-dir-filename-mouse-map))))
+ 'keymap vc-dir-status-mouse-map)
+
+ " " (propertize
+ (if stage-state
+ (format "%c" stage-state)
+ " ")
+ 'face (cond ((memq stage-state '(?A ?E)) 'font-lock-constant-face)
+ ((eq stage-state ?R) 'font-lock-warning-face)
+ (t 'font-lock-variable-name-face)))
+ " "
+ (propertize filename
+ 'face (if isdir 'font-lock-comment-delimiter-face
+ 'font-lock-function-name-face)
+ 'help-echo
+ (if isdir
+ "Directory\nVC operations can be applied to it\nmouse-3:
Pop-up menu"
+ "File\nmouse-3: Pop-up menu")
+ 'mouse-face 'highlight
+ 'keymap vc-dir-filename-mouse-map))))
(defun vc-got-working-revision (file)
"Return the id of the last commit that touched the FILE or \"0\" for a new
(but added) file."
@@ -932,17 +928,5 @@ true, NAME should create a new branch otherwise it will
pop-up a
(forward-line))
found)))))
-
-;; hacks
-(defun vc-got-fix-dir-move-to-goal-column (fn)
- "Move the cursor on the file column.
-Adviced around `vc-dir-move-to-goal-column' (FN) because it hardcodes column
25."
- (if (not (vc-find-root default-directory ".got"))
- (funcall fn)
- (beginning-of-line)
- (unless (eolp)
- (forward-char 31))))
-(advice-add 'vc-dir-move-to-goal-column :around
#'vc-got-fix-dir-move-to-goal-column)
-
(provide 'vc-got)
;;; vc-got.el ends here
- [elpa] externals/vc-got b2721e8 080/145: set status to 'staged if a file has all its modification staged, (continued)
- [elpa] externals/vc-got b2721e8 080/145: set status to 'staged if a file has all its modification staged, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got dec54a7 088/145: improve vc-got-{push, pull}, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 424f515 100/145: don't need annotate-current-time; split the sections, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ad36649 092/145: due piccoli errori di battitura corretti, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 6a973a7 106/145: simplify vc-got-root, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got e7747ce 109/145: use log-edit-extract-headers instead of the ugly workaround, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 26362bf 110/145: improve error message reporting for vc-got-checkin, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 5212464 115/145: there is no need to require cl-seq, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 83559c7 108/145: add a TODO for the files handling in vc-got-diff, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 186da17 126/145: add a short description under commentary, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 1b2afa9 121/145: rework the vc-dir handling and remove the ugly hack,
ELPA Syncer <=
- [elpa] externals/vc-got 2552a6c 104/145: mark find-ignore-file as done and move it to the right place, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 26b39de 135/145: remove debug macroexpand, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 84beb0d 129/145: add docstring for vc-got-update-on-retrieve-tag, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got a1839dc 131/145: don't include the common commit in log-outgoing, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 74b0000 138/145: install a custom process filter for `got send', ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 3efc759 141/145: cleanup, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f457868 024/145: typo, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got 06d4d37 031/145: add Makefile, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got ddc59a0 057/145: remove extra parens from vc-got-unregister and fix pcase matchall, ELPA Syncer, 2021/09/09
- [elpa] externals/vc-got f8a9db5 060/145: fix vc-got-repository-url for checkout of non-bare repos, ELPA Syncer, 2021/09/09