[nongnu] elpa/tuareg a50304d 1/3: tuareg-site-file: Enable lexical-binding

2021-09-09 Thread ELPA Syncer
branch: elpa/tuareg
commit a50304d97b0d1af113c7c2d2fcd0670e82569cee
Author: Stefan Monnier 
Commit: Christophe Troestler 

tuareg-site-file: Enable lexical-binding
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 3313665..7993c72 100644
--- a/Makefile
+++ b/Makefile
@@ -85,7 +85,7 @@ check:
 indent-test: indent-test.ml.test
 
 tuareg-site-file.el: $(SOURCES)
-   (echo ";;; $@ --- Automatically extracted autoloads.";\
+   (echo ";;; $@ --- Automatically extracted autoloads.  -*- 
lexical-binding: t; -*-";\
 echo ";;; Code:";\
 echo "(add-to-list 'load-path";\
 echo " (or (file-name-directory load-file-name) (car 
load-path)))";\



[nongnu] elpa/tuareg 2618ad7 2/3: Use add-function to adapt blink-matching-check-function to comments

2021-09-09 Thread ELPA Syncer
branch: elpa/tuareg
commit 2618ad738a75a67ddb07ed7c9c246ffe546b85e3
Author: Stefan Monnier 
Commit: Christophe Troestler 

Use add-function to adapt blink-matching-check-function to comments
---
 tuareg.el | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tuareg.el b/tuareg.el
index d041c5b..b6fa95c 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3087,19 +3087,19 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
 (forward-comment 1)
 (eq (point) pt))
 
-(defun tuareg--blink-matching-check (start end)
+(defun tuareg--blink-matching-check (orig-fun &rest args)
+  ;; FIXME: Should we merge this with `tuareg--show-paren'?
   (if (tuareg--point-after-comment-p)
   ;; Immediately after a comment-ending "*)" -- no mismatch error.
   nil
-(smie-blink-matching-check start end)))
+(apply orig-fun args)))
 
 (defvar show-paren-data-function); Silence the byte-compiler
-(declare-function show-paren--default "paren" ())
 
-(defun tuareg--show-paren ()
+(defun tuareg--show-paren (orig-fun)
   (if (or (tuareg--point-before-comment-p) (tuareg--point-after-comment-p))
   nil
-(show-paren--default)))
+(funcall orig-fun)))
 
 (defun tuareg--common-mode-setup ()
   (setq-local syntax-propertize-function #'tuareg-syntax-propertize)
@@ -3107,7 +3107,8 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
   (smie-setup tuareg-smie-grammar #'tuareg-smie-rules
   :forward-token #'tuareg-smie-forward-token
   :backward-token #'tuareg-smie-backward-token)
-  (setq-local blink-matching-check-function #'tuareg--blink-matching-check)
+  (add-function :around (local 'blink-matching-check-function)
+#'tuareg--blink-matching-check)
   (tuareg--eval-when-macrop add-function
 (when (boundp 'smie--hanging-eolp-function)
   ;; FIXME: As its name implies, smie--hanging-eolp-function
@@ -3118,7 +3119,8 @@ expansion at run-time, if the run-time version of Emacs 
does know this macro."
   (add-hook 'smie-indent-functions #'tuareg-smie--args nil t)
   (add-hook 'smie-indent-functions #'tuareg-smie--inside-string nil t)
   (setq-local add-log-current-defun-function #'tuareg-current-fun-name)
-  (setq-local show-paren-data-function #'tuareg--show-paren)
+  (add-function :around (local 'show-paren-data-function)
+#'tuareg--show-paren)
   (setq prettify-symbols-alist
 (if tuareg-prettify-symbols-full
 (append tuareg-prettify-symbols-basic-alist



[nongnu] elpa/tuareg updated (eb0bff8 -> 85d626f)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch elpa/tuareg.

  from  eb0bff8   Ignore the automatically generated tuareg-site-file.el
   new  a50304d   tuareg-site-file: Enable lexical-binding
   new  2618ad7   Use add-function to adapt blink-matching-check-function 
to comments
   new  85d626f   Apply only locally the hook to generate the interface


Summary of changes:
 Makefile  |  2 +-
 tuareg.el | 18 ++
 2 files changed, 11 insertions(+), 9 deletions(-)



[nongnu] elpa/tuareg 85d626f 3/3: Apply only locally the hook to generate the interface

2021-09-09 Thread ELPA Syncer
branch: elpa/tuareg
commit 85d626f6c0b75ca086e7717c2146bad6f37a3fb8
Author: Stefan Monnier 
Commit: Christophe Troestler 

Apply only locally the hook to generate the interface
---
 tuareg.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuareg.el b/tuareg.el
index b6fa95c..a7217f0 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -3204,7 +3204,7 @@ Short cuts for interactions with the REPL:
 (setq indent-tabs-mode nil)
 (setq ff-search-directories '(".")
   ff-other-file-alist tuareg-other-file-alist)
-(add-hook 'ff-file-created-hook #'tuareg--ff-file-created-hook)
+(add-hook 'ff-file-created-hook #'tuareg--ff-file-created-hook nil t)
 (tuareg--common-mode-setup)
 (tuareg--install-font-lock)
 (setq-local beginning-of-defun-function #'tuareg-beginning-of-defun)



[elpa] externals/taxy updated (f2f2a60 -> 233f94c)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/taxy.

  from  f2f2a60   Example: Update diredy
   new  9069b97   Add: (taxy-sort, taxy-sort*)
   new  4c9c92c   Docs: Clarify example
   new  2d2b5f6   Docs: Fix example
   new  233f94c   Docs: Encromulate examples


Summary of changes:
 README.org |  30 
 taxy.el|  25 +++
 taxy.info  | 249 +++--
 3 files changed, 164 insertions(+), 140 deletions(-)



[elpa] externals/taxy 2d2b5f6 3/4: Docs: Fix example

2021-09-09 Thread ELPA Syncer
branch: externals/taxy
commit 2d2b5f684e8c9183da5c10040923ee8583c0733f
Author: Adam Porter 
Commit: Adam Porter 

Docs: Fix example
---
 README.org |  3 +--
 taxy.info  | 63 +++---
 2 files changed, 32 insertions(+), 34 deletions(-)

diff --git a/README.org b/README.org
index 9389e25..2a08935 100644
--- a/README.org
+++ b/README.org
@@ -202,8 +202,7 @@ Oh, they're out of order, now.  That won't do.  Let's fix 
that:
 
 #+BEGIN_SRC elisp :exports code :results code
   (taxy-plain
-   (taxy-sort #'string< #'identity)
-   taxy)
+   (taxy-sort #'string< #'identity lettery))
 #+END_SRC
 
 That's better:
diff --git a/taxy.info b/taxy.info
index 0f6d301..eebd424 100644
--- a/taxy.info
+++ b/taxy.info
@@ -273,8 +273,7 @@ first taxy, i.e.  non-vowels.
Oh, they’re out of order, now.  That won’t do.  Let’s fix that:
 
  (taxy-plain
-  (taxy-sort #'string< #'identity)
-  taxy)
+  (taxy-sort #'string< #'identity lettery))
 
That’s better:
 
@@ -1120,36 +1119,36 @@ Node: Top218
 Node: Examples1761
 Node: Numbery (starting basically)2080
 Node: Lettery (filling incrementally)7841
-Node: Sporty (understanding completely)10361
-Node: Applications16348
-Node: Installation16748
-Node: Usage17061
-Node: Dynamic taxys19198
-Node: Multi-level dynamic taxys21758
-Node: "Chains" of independent multi-level dynamic taxys23951
-Node: Reusable taxys26823
-Node: Threading macros30998
-Node: Modifying filled taxys31537
-Node: Magit section32355
-Node: Changelog33043
-Node: 06-pre33235
-Node: Additions33347
-Node: 0533671
-Node: Additions (1)33810
-Node: Fixes34916
-Node: 0435070
-Node: 0335292
-Node: Changes35421
-Node: Fixes (1)35784
-Node: 0236219
-Node: Changes (1)36388
-Node: Additions (2)36680
-Node: Fixes (2)37539
-Node: 0137793
-Node: Development37892
-Node: Copyright assignment38098
-Node: Credits38686
-Node: License38876
+Node: Sporty (understanding completely)10358
+Node: Applications16345
+Node: Installation16745
+Node: Usage17058
+Node: Dynamic taxys19195
+Node: Multi-level dynamic taxys21755
+Node: "Chains" of independent multi-level dynamic taxys23948
+Node: Reusable taxys26820
+Node: Threading macros30995
+Node: Modifying filled taxys31534
+Node: Magit section32352
+Node: Changelog33040
+Node: 06-pre33232
+Node: Additions33344
+Node: 0533668
+Node: Additions (1)33807
+Node: Fixes34913
+Node: 0435067
+Node: 0335289
+Node: Changes35418
+Node: Fixes (1)35781
+Node: 0236216
+Node: Changes (1)36385
+Node: Additions (2)36677
+Node: Fixes (2)37536
+Node: 0137790
+Node: Development37889
+Node: Copyright assignment38095
+Node: Credits38683
+Node: License38873
 
 End Tag Table
 



[elpa] externals/taxy 9069b97 1/4: Add: (taxy-sort, taxy-sort*)

2021-09-09 Thread ELPA Syncer
branch: externals/taxy
commit 9069b975fc42d232fa746f6885ca5d66f4d05b92
Author: Adam Porter 
Commit: Adam Porter 

Add: (taxy-sort, taxy-sort*)
---
 README.org |  25 +++
 taxy.el|  25 +++
 taxy.info  | 244 +++--
 3 files changed, 160 insertions(+), 134 deletions(-)

diff --git a/README.org b/README.org
index 69e5130..534086e 100644
--- a/README.org
+++ b/README.org
@@ -202,11 +202,8 @@ Oh, they're out of order, now.  That won't do.  Let's fix 
that:
 
 #+BEGIN_SRC elisp :exports code :results code
   (taxy-plain
-   (taxy-mapc* (lambda (taxy)
- (setf (taxy-items taxy)
-   (cl-sort (taxy-items taxy) #'<
-:key #'string-to-char)))
- lettery))
+   (taxy-sort #'< #'string-to-char)
+   taxy)
 #+END_SRC
 
 That's better:
@@ -738,14 +735,10 @@ Sometimes it's necessary to modify a taxy after filling 
it with objects, e.g. to
 (thread-last musicy-taxy
   taxy-emptied
   (taxy-fill files)
-  (taxy-mapc* (lambda (taxy)
-;; Sort sub-taxys by their name.
-(setf (taxy-taxys taxy)
-  (cl-sort (taxy-taxys taxy) #'string<
-   :key #'taxy-name))
-;; Sort sub-taxys' items by name.
-(setf (taxy-items taxy)
-  (cl-sort (taxy-items taxy) #'string<
+  ;; Sort sub-taxys by their name.
+  (taxy-sort* #'string< #'taxy-name)
+  ;; Sort sub-taxys' items by name.
+  (taxy-sort #'string< #'identity)
   taxy-magit-section-pp))
 #+END_SRC
 
@@ -776,7 +769,11 @@ Note that while =taxy-magit-section.el= is installed with 
the =taxy= package, th
 
 ** 0.6-pre
 
-Nothing new yet.
+*** Additions
+
++ Sorting functions:
+  + ~taxy-sort-items~ (alias: ~taxy-sort~) sorts the items in a taxy and its 
sub-taxys.
+  + ~taxy-sort-taxys~ (alias: ~taxy-sort*~) sorts a taxy's sub-taxys.
 
 ** 0.5
 
diff --git a/taxy.el b/taxy.el
index b0ec701..b161c3b 100644
--- a/taxy.el
+++ b/taxy.el
@@ -238,6 +238,31 @@ Includes items in TAXY's sub-taxys."
sum (taxy-size sub-taxy) into total
finally return (+ total (length (taxy-items taxy)
 
+(defun taxy-sort-items (pred key taxy)
+  "Sort TAXY's items by PRED and KEY.
+Sorts items in TAXY and its sub-taxys.  KEY is passed to
+`cl-sort', which see."
+  (declare (indent defun))
+  (taxy-mapc* (lambda (taxy)
+   (setf (taxy-items taxy)
+ (cl-sort (taxy-items taxy)
+  pred :key key)))
+taxy))
+
+(defalias 'taxy-sort #'taxy-sort-items)
+
+(defun taxy-sort-taxys (pred key taxy)
+  "Sort TAXY's sub-taxys by PRED and KEY.
+KEY is passed to `cl-sort', which see."
+  (declare (indent defun))
+  (taxy-mapc* (lambda (taxy)
+   (setf (taxy-taxys taxy)
+ (cl-sort (taxy-taxys taxy)
+  pred :key key)))
+taxy))
+
+(defalias 'taxy-sort* #'taxy-sort-taxys)
+
  Footer
 
 (provide 'taxy)
diff --git a/taxy.info b/taxy.info
index 239d299..28fbf93 100644
--- a/taxy.info
+++ b/taxy.info
@@ -1,4 +1,4 @@
-This is README.info, produced by makeinfo version 5.2 from README.texi.
+This is README.info, produced by makeinfo version 6.5 from README.texi.
 
 INFO-DIR-SECTION Emacs
 START-INFO-DIR-ENTRY
@@ -11,6 +11,24 @@ File: README.info,  Node: Top,  Next: Examples,  Up: (dir)
 taxy.el
 ***
 
+https://elpa.gnu.org/packages/taxy.svg
+(https://elpa.gnu.org/packages/taxy.html)
+
+   _Now, where did I put that..._
+
+   This library provides a programmable way to classify arbitrary
+objects into a hierarchical taxonomy.  (That’s a lot of fancy words to
+say that this lets you automatically put things in nested groups.)
+
+   Helpful features include:
+
+Dynamic taxonomies
+ Objects may be classified into hierarchies automatically defined at
+ runtime based on their attributes.
+Reusable taxonomies
+ Taxonomy definitions may be stored in variables and reused in other
+ taxonomies’ descendant groups.
+
 * Menu:
 
 * Examples::
@@ -30,9 +48,6 @@ Examples
 * Sporty (understanding completely)::
 * Applications::
 
-
-
-
 Usage
 
 * Dynamic taxys::
@@ -44,60 +59,41 @@ Usage
 Dynamic taxys
 
 * Multi-level dynamic taxys::
-* "Chains" of independent, multi-level dynamic taxys: "Chains" of independent 
multi-level dynamic taxys. 
+* "Chains" of independent, multi-level dynamic taxys: "Chains" of independent 
multi-level dynamic taxys.
 
 Changelog
 
-* 0.6-pre: 06-pre. 
-* 0.5: 05. 
-* 0.4: 04. 
-* 0.3: 03. 
-* 0.2: 02. 
-* 0.1: 01. 
-
+* 0.6-pre: 06-pre.
+* 0.5: 05.
+* 0.4: 04.
+* 0.3: 03.
+* 0.2: 02.
+* 0.1: 01.
 
-0.5
+0.6-pre
 
 * Additions::
-* Fixes::
-
 
+0.5
 
+* Additions: Additions (1).
+* Fixes::
 
 0.3
 
 * Changes::
-* Fixes: Fixesx. 
-
-
+* Fixes: Fixes (1).
 
 0.2
 
-* Changes: Changesx. 
-* Additions: Additionsx. 
-* Fixes: Fixesxx.

[elpa] externals/taxy 4c9c92c 2/4: Docs: Clarify example

2021-09-09 Thread ELPA Syncer
branch: externals/taxy
commit 4c9c92cd54268cb8c15e8a9d370521e67d92f9d6
Author: Adam Porter 
Commit: Adam Porter 

Docs: Clarify example
---
 README.org | 2 +-
 taxy.info  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 534086e..9389e25 100644
--- a/README.org
+++ b/README.org
@@ -202,7 +202,7 @@ Oh, they're out of order, now.  That won't do.  Let's fix 
that:
 
 #+BEGIN_SRC elisp :exports code :results code
   (taxy-plain
-   (taxy-sort #'< #'string-to-char)
+   (taxy-sort #'string< #'identity)
taxy)
 #+END_SRC
 
diff --git a/taxy.info b/taxy.info
index 28fbf93..0f6d301 100644
--- a/taxy.info
+++ b/taxy.info
@@ -273,7 +273,7 @@ first taxy, i.e.  non-vowels.
Oh, they’re out of order, now.  That won’t do.  Let’s fix that:
 
  (taxy-plain
-  (taxy-sort #'< #'string-to-char)
+  (taxy-sort #'string< #'identity)
   taxy)
 
That’s better:



[elpa] externals/taxy 233f94c 4/4: Docs: Encromulate examples

2021-09-09 Thread ELPA Syncer
branch: externals/taxy
commit 233f94c6b22a8568243058397fd6ad4e2e48702c
Author: Adam Porter 
Commit: Adam Porter 

Docs: Encromulate examples
---
 README.org |  6 +++---
 taxy.info  | 66 +++---
 2 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/README.org b/README.org
index 2a08935..c5ed5f3 100644
--- a/README.org
+++ b/README.org
@@ -174,7 +174,7 @@ That produces:
   ("Lettery" "A comprehensive taxonomy of letters."
(("Vowels" "You know what those are."
  ("A" "E" "I"))
-("Consonants" "Well, if they aren't a vowel..."
+("Consonants" "Well, if they aren't vowels..."
  ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N"
 #+END_SRC
 
@@ -194,7 +194,7 @@ Which gives us:
   ("Lettery" "A comprehensive taxonomy of letters."
(("Vowels" "You know what those are."
  ("O" "U" "A" "E" "I"))
-("Consonants" "Well, if they aren't a vowel..."
+("Consonants" "Well, if they aren't vowels..."
  ("N" "P" "Q" "R" "S" "T" "V" "W" "X" "Y" "Z" "B" "C" "D" "F" "G" "H" "J" 
"K" "L" "M" "N"
 #+END_SRC
 
@@ -211,7 +211,7 @@ That's better:
   ("Lettery" "A comprehensive taxonomy of letters."
(("Vowels" "You know what those are."
  ("A" "E" "I" "O" "U"))
-("Consonants" "Well, if they aren't a vowel..."
+("Consonants" "Well, if they aren't vowels..."
  ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" "V" 
"W" "X" "Y" "Z"
 #+END_SRC
 
diff --git a/taxy.info b/taxy.info
index eebd424..bc57bf4 100644
--- a/taxy.info
+++ b/taxy.info
@@ -251,7 +251,7 @@ first taxy, i.e.  non-vowels.
  ("Lettery" "A comprehensive taxonomy of letters."
   (("Vowels" "You know what those are."
 ("A" "E" "I"))
-   ("Consonants" "Well, if they aren't a vowel..."
+   ("Consonants" "Well, if they aren't vowels..."
 ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N"
 
Oops, we forgot the letters after N!  Let’s add them, too:
@@ -267,7 +267,7 @@ first taxy, i.e.  non-vowels.
  ("Lettery" "A comprehensive taxonomy of letters."
   (("Vowels" "You know what those are."
 ("O" "U" "A" "E" "I"))
-   ("Consonants" "Well, if they aren't a vowel..."
+   ("Consonants" "Well, if they aren't vowels..."
 ("N" "P" "Q" "R" "S" "T" "V" "W" "X" "Y" "Z" "B" "C" "D" "F" "G" "H" 
"J" "K" "L" "M" "N"
 
Oh, they’re out of order, now.  That won’t do.  Let’s fix that:
@@ -280,7 +280,7 @@ first taxy, i.e.  non-vowels.
  ("Lettery" "A comprehensive taxonomy of letters."
   (("Vowels" "You know what those are."
 ("A" "E" "I" "O" "U"))
-   ("Consonants" "Well, if they aren't a vowel..."
+   ("Consonants" "Well, if they aren't vowels..."
 ("B" "C" "D" "F" "G" "H" "J" "K" "L" "M" "N" "N" "P" "Q" "R" "S" "T" 
"V" "W" "X" "Y" "Z"
 
 
@@ -1119,36 +1119,36 @@ Node: Top218
 Node: Examples1761
 Node: Numbery (starting basically)2080
 Node: Lettery (filling incrementally)7841
-Node: Sporty (understanding completely)10358
-Node: Applications16345
-Node: Installation16745
-Node: Usage17058
-Node: Dynamic taxys19195
-Node: Multi-level dynamic taxys21755
-Node: "Chains" of independent multi-level dynamic taxys23948
-Node: Reusable taxys26820
-Node: Threading macros30995
-Node: Modifying filled taxys31534
-Node: Magit section32352
-Node: Changelog33040
-Node: 06-pre33232
-Node: Additions33344
-Node: 0533668
-Node: Additions (1)33807
-Node: Fixes34913
-Node: 0435067
-Node: 0335289
-Node: Changes35418
-Node: Fixes (1)35781
-Node: 0236216
-Node: Changes (1)36385
-Node: Additions (2)36677
-Node: Fixes (2)37536
-Node: 0137790
-Node: Development37889
-Node: Copyright assignment38095
-Node: Credits38683
-Node: License38873
+Node: Sporty (understanding completely)10355
+Node: Applications16342
+Node: Installation16742
+Node: Usage17055
+Node: Dynamic taxys19192
+Node: Multi-level dynamic taxys21752
+Node: "Chains" of independent multi-level dynamic taxys23945
+Node: Reusable taxys26817
+Node: Threading macros30992
+Node: Modifying filled taxys31531
+Node: Magit section32349
+Node: Changelog33037
+Node: 06-pre33229
+Node: Additions33341
+Node: 0533665
+Node: Additions (1)33804
+Node: Fixes34910
+Node: 0435064
+Node: 0335286
+Node: Changes35415
+Node: Fixes (1)35778
+Node: 0236213
+Node: Changes (1)36382
+Node: Additions (2)36674
+Node: Fixes (2)37533
+Node: 0137787
+Node: Development37886
+Node: Copyright assignment38092
+Node: Credits38680
+Node: License38870
 
 End Tag Table
 



[nongnu] elpa/git-commit e404aa7: magit-wip-commit-worktree: Filter out directories

2021-09-09 Thread ELPA Syncer
branch: elpa/git-commit
commit e404aa75a791fa577973176a7eb2f2da3b572b87
Author: Kyle Meyer 
Commit: Kyle Meyer 

magit-wip-commit-worktree: Filter out directories

When magit-wip-commit-worktree receives a non-nil FILES argument, it
feeds the result to update-index.  If triggered by operating on items
in the untracked section, FILES may contain directories.  In this
case, the update-index call ignores directories but succeeds:

  $ git status -s
  ?? d/
  ?? f1
  $ git update-index --add -- f1 d/
  Ignoring path d/
  $ git status -s
  A  f1
  ?? d/

Ignoring directories seems acceptable because 1) when staging with the
composite wip modes, directory files are subsequently captured by the
post-stage magit-wip-commit-index call and 2) the documentation
explicitly says untracked files are not covered by wip modes (which is
particularly relevant when discarding untracked changes).

However, as of Git v2.32.0, specifically 6e773527b6 (sparse-index:
convert from full to sparse, 2021-03-30), update-index errors instead:

  $ git update-index --add -- f1 d/
  error: d/: is a directory - add files inside instead
  fatal: Unable to process path d/
  $ git status -s
  ?? d/
  ?? f1

One solution would be to go back to `git add', but that would bring
back the issue resolved by the switch to update-index in 57f2d0f8
(magit-wip-commit-worktree: Avoid failing git call on file deletion,
2020-02-08).

Instead restore the pre Git v2.32 behavior by removing directories
from FILES.  The only functional difference is that, when the FILES
argument passed to magit-wip-commit-worktree includes both directories
and non-directories, the message created downstream by
magit-wip-update-wipref is now more accurate because its FILES
argument includes only non-directories.
---
 lisp/magit-wip.el | 53 +
 1 file changed, 29 insertions(+), 24 deletions(-)

diff --git a/lisp/magit-wip.el b/lisp/magit-wip.el
index 3f90af0..091f2c8 100644
--- a/lisp/magit-wip.el
+++ b/lisp/magit-wip.el
@@ -287,30 +287,35 @@ commit message."
 (magit-wip-update-wipref ref wipref tree parent files msg "index")))
 
 (defun magit-wip-commit-worktree (ref files msg)
-  (let* ((wipref (magit--wip-wtree-ref ref))
- (parent (magit-wip-get-parent ref wipref))
- (tree (magit-with-temp-index parent (list "--reset" "-i")
- (if files
- ;; Note: `update-index' is used instead of `add'
- ;; because `add' will fail if a file is already
- ;; deleted in the temporary index.
- (magit-call-git
-  "update-index" "--add" "--remove"
-  (and (pcase (magit-repository-local-get
-   'update-index-has-ignore-sw-p 'unset)
- (`unset
-  (let ((val (version<= "2.25.0"
-(magit-git-version
-(magit-repository-local-set
- 'update-index-has-ignore-sw-p val)
-val))
- (val val))
-   "--ignore-skip-worktree-entries")
-  "--" files)
-   (magit-with-toplevel
- (magit-call-git "add" "-u" ".")))
- (magit-git-string "write-tree"
-(magit-wip-update-wipref ref wipref tree parent files msg "worktree")))
+  (when (or (not files)
+;; `update-index' will either ignore (before Git v2.32.0)
+;; or fail when passed directories (relevant for the
+;; untracked files code paths).
+(setq files (seq-remove #'file-directory-p files)))
+(let* ((wipref (magit--wip-wtree-ref ref))
+   (parent (magit-wip-get-parent ref wipref))
+   (tree (magit-with-temp-index parent (list "--reset" "-i")
+   (if files
+   ;; Note: `update-index' is used instead of `add'
+   ;; because `add' will fail if a file is already
+   ;; deleted in the temporary index.
+   (magit-call-git
+"update-index" "--add" "--remove"
+(and (pcase (magit-repository-local-get
+ 'update-index-has-ignore-sw-p 'unset)
+   (`unset
+(let ((val (version<= "2.25.0"
+  (magit-git-version
+  (magit-repository-local-set
+   'update-index-has-ignore-sw-p val)
+  val))
+   

[nongnu] elpa/magit updated (9866049 -> e404aa7)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit.

  from  9866049   magit-dired-am-apply-patches: Make compatible with Emacs 
< 27
  adds  e404aa7   magit-wip-commit-worktree: Filter out directories

No new revisions were added by this update.

Summary of changes:
 lisp/magit-wip.el | 53 +
 1 file changed, 29 insertions(+), 24 deletions(-)



[nongnu] elpa/magit-section updated (9866049 -> e404aa7)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit-section.

  from  9866049   magit-dired-am-apply-patches: Make compatible with Emacs 
< 27
  adds  e404aa7   magit-wip-commit-worktree: Filter out directories

No new revisions were added by this update.

Summary of changes:
 lisp/magit-wip.el | 53 +
 1 file changed, 29 insertions(+), 24 deletions(-)



[elpa] externals/debbugs 72c15aa: Release debbugs 0.29

2021-09-09 Thread Michael Albinus
branch: externals/debbugs
commit 72c15aa5d220df74cf89b195cea526e109833f20
Author: Michael Albinus 
Commit: Michael Albinus 

Release debbugs 0.29
---
 debbugs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debbugs.el b/debbugs.el
index 6aa98a1..60885c5 100644
--- a/debbugs.el
+++ b/debbugs.el
@@ -5,7 +5,7 @@
 ;; Author: Michael Albinus 
 ;; Keywords: comm, hypermedia
 ;; Package: debbugs
-;; Version: 0.28
+;; Version: 0.29
 ;; Package-Requires: ((emacs "25.1") (soap-client "3.1.5"))
 
 ;; This file is not part of GNU Emacs.



[elpa] externals/company 1887974: Fix search in the first LEN(company-prefix) chars of completions

2021-09-09 Thread ELPA Syncer
branch: externals/company
commit 1887974e7ad50cb4884fbec27985078bba754b60
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Fix search in the first LEN(company-prefix) chars of completions

Reported in 
https://github.com/company-mode/company-mode/discussions/1211#discussioncomment-1298541.
---
 company.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/company.el b/company.el
index 1fffe96..9704a73 100644
--- a/company.el
+++ b/company.el
@@ -2256,7 +2256,7 @@ each one wraps a part of the input string."
   (let ((re (funcall company-search-regexp-function text))
 (i 0))
 (cl-dolist (line lines)
-  (when (string-match-p re line (length company-prefix))
+  (when (string-match-p re line)
 (cl-return i))
   (cl-incf i
 
@@ -3028,7 +3028,7 @@ If SHOW-VERSION is non-nil, show the version in the echo 
area."
 (when (let ((re (funcall company-search-regexp-function
  company-search-string)))
 (and (not (string= re ""))
- (string-match re value (length company-prefix
+ (string-match re value)))
   (pcase-dolist (`(,mbeg . ,mend) (company--search-chunks))
 (let ((beg (+ margin mbeg))
   (end (+ margin mend))



[elpa] externals/crdt updated (4797413 -> c1378c5)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/crdt.

  from  4797413   bump version number
   new  f9a7ec9   update header
   new  dcf1dd5   Update version number
   new  b6bcc8b   Merge branch 'master' into development
   new  cc37dcd   add description of bridge protocol
   new  38476da   Merge branch 'fix' into development
   new  c08e21d   Refactors and remote command
   new  605d8fa   initial experiment of xscheme.el integration
   new  e175d65   Remote command
   new  bf1dc5d   typo
   new  6b85d8a   refactor, replace cl-generic with hashtable of handlers
   new  3f6f566   lots of changes
   new  d7bc982   update README
   new  e4493e5   bug fix for comint integration
   new  936418c   Synchronize text property on changes
   new  52cbf50   autoload; fix bug for cmuscheme
   new  40bd5d4   document
   new  b11bbc0   some more autoloads
   new  c1378c5   Merge branch 'development'


Summary of changes:
 HACKING.org |  170 +++-
 README.org  |   13 +-
 crdt.el | 1312 ++-
 3 files changed, 1117 insertions(+), 378 deletions(-)



[elpa] externals/crdt f9a7ec9 01/18: update header

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit f9a7ec91ae09387838f9f698991ab6576080a06e
Author: Qiantan Hong 
Commit: Qiantan Hong 

update header
---
 crdt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crdt.el b/crdt.el
index f2a6c04..e78a8c9 100644
--- a/crdt.el
+++ b/crdt.el
@@ -1,4 +1,4 @@
-;;; crdt.el --- collaborative editing using Conflict-free Replicated Data 
Types  -*- lexical-binding: t; -*-
+;;; crdt.el --- Collaborative editing using Conflict-free Replicated Data 
Types  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2021 Free Software Foundation, Inc.
 
@@ -6,7 +6,7 @@
 ;; Maintainer: Qiantan Hong 
 ;; URL: https://code.librehq.com/qhong/crdt.el
 ;; Keywords: collaboration crdt
-;; Version: 0.1.1
+;; Version: 0.1.2
 
 ;; This file is part of GNU Emacs.
 



[elpa] externals/crdt cc37dcd 04/18: add description of bridge protocol

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit cc37dcd9378e69b56dff839102f3b880660bcf50
Author: Qiantan Hong 
Commit: Qiantan Hong 

add description of bridge protocol
---
 HACKING.org | 49 -
 1 file changed, 48 insertions(+), 1 deletion(-)

diff --git a/HACKING.org b/HACKING.org
index eab1b13..5ad8093 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -142,7 +142,7 @@ By implementing synchronization primitives for all 
components in a buffer,
 pretty much everything can be made collaborative.
 Synchronize arbitrary buffer-local-variable reasonably is hard, but user 
annotations can help.
 
-** TODO list
+** TODO task list
- [X] synchronize buffer text (insert/delete)
- [X] synchronize overlays
- [-] synchronize major/minor modes
@@ -154,3 +154,50 @@ Synchronize arbitrary buffer-local-variable reasonably is 
hard, but user annotat
  + [ ] a library of CRDTs
- [ ] synchronize text properties (any use case for this?)
- [ ] synchronize markers (any use case for this?)
+
+* TODO Cross-editor support
+
+The current plan is to reuse the Emacs implementation as a local server for 
any other editor, aka Emacs as a service. 
+The benefit is that we don't need to reimplement the sophiscated CRDT 
algorithm in other +uncivilized+ environments. 
+We then just need to design a thin protocol that communicate between local 
Emacs and the other editor.
+Since this protocol communicate only locally, the latency should be 
negligible, 
+therefore we use a blocking reader/writer lock based synchronization scheme.
+
+** Bridge protocol
+
+   - Reader/writer lock
+ + aquire :: body takes the form =()=
+ + release :: body takes the form =()=
+
+   The rest is mostly analogue to the primary protocol for Emacsen, 
+   except that CRDT IDs are replaced by explicit integer position (start from 
1, as in Emacs).
+
+  - Text Editing
++ insert :: body takes the form =(buffer-name position content)=
++ delete :: body takes the form =(buffer-name position length)=
+
+  - Peer State
++ cursor :: body takes the form =(buffer-name site-id point-position 
mark-position)=
+  =*-position= can be either an integer, or
+- =nil=, which means clear the point/mark
+
++ contact :: same as primary protocol.
+
++ focus :: same as primary protocol.
+
+  - Login
+Note that we don't include challenge/response authentication mecahnism.
+
++ hello :: same as primary protocol.
++ leave :: same as primary protocol.
+
++ login :: same as primary protocol.
+
+  - Initial Synchronization
++ sync :: body takes the form =(buffer-name content-string)=
++ ready :: same as primary protocol.
+
+  - Buffer Service
++ add :: same as primary protocol.
++ remove :: same as primary protocol.
++ get :: same as primary protocol.



[elpa] externals/crdt e4493e5 13/18: bug fix for comint integration

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit e4493e5a0d8a9ccfd091dc33c7a649caa15bc525
Author: Qiantan Hong 
Commit: Qiantan Hong 

bug fix for comint integration

input ring history
---
 crdt.el | 39 +--
 1 file changed, 25 insertions(+), 14 deletions(-)

diff --git a/crdt.el b/crdt.el
index f5c12c0..a8f8ecb 100644
--- a/crdt.el
+++ b/crdt.el
@@ -2335,7 +2335,7 @@ Stop allowing remote calls to FUNCTION-SYMBOL."
 
 ;;; Buffer local variables
 
-(defvar crdt-variables nil)
+(defvar-local crdt-variables nil)
 
 (cl-defun crdt--send-variables-maybe (&optional (incremental t))
   (dolist (var crdt-variables)
@@ -2464,17 +2464,22 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 
 (defvar crdt-variable-scheme-diff-server (cons 
#'crdt--diff-server-variable-sender #'crdt--diff-server-variable-receiver))
 
+(defun crdt-register-variable (variable scheme)
+  (add-to-list 'crdt-variables variable)
+  (put variable 'crdt-variable-scheme
+   (if (symbolp scheme) (symbol-value scheme) scheme)))
+
+(defun crdt-unregister-variable (variable)
+  (delq variable crdt-variables)
+  (cl-remprop variable 'crdt-variable-scheme))
+
 (defun crdt-register-variables (variable-entries)
   (dolist (entry variable-entries)
-(cl-destructuring-bind (var scheme) entry
-  (cl-pushnew var crdt-variables)
-  (put var 'crdt-variable-scheme (symbol-value scheme)
+(apply #'crdt-register-variable entry)))
 
 (defun crdt-unregister-variables (variable-entries)
   (dolist (entry variable-entries)
-(cl-destructuring-bind (var _scheme) entry
-  (delq var crdt-variables)
-  (cl-remprop var 'crdt-variable-scheme
+(crdt-unregister-variable (car entry
 
 ;;; Built-in package integrations
 
@@ -2518,12 +2523,7 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
   '((comint-send-input (point) (point))
 (comint-send-region (region) (region
 
-;; We also synchronize some buffer local variables to improve client side 
completion.
-(defvar crdt-comint-variable-entries
-  '((comint-input-ring crdt-variable-scheme-diff-server)))
-
 (crdt-register-remote-commands crdt-comint-command-entries)
-(crdt-register-variables crdt-comint-variable-entries)
 
 (defcustom crdt-comint-share-input-history 'censor
   "Share comint input history.
@@ -2535,6 +2535,9 @@ Merge with history generated before the session after the 
buffer is no longer sh
 (defvar-local crdt--comint-saved-input-ring nil)
 
 (defun crdt--merge-ring (old-ring delta-ring nodups)
+  "Construct a new ring by merging OLD-RING and DELTA-RING.
+If NODUPS is non-nil, don't duplicate existing items in OLD-RING.
+This procedure is non-destructive."
   (if delta-ring
   (let ((old-ring (copy-tree old-ring t)))
 (cl-loop for i from (1- (ring-length delta-ring)) downto 0
@@ -2544,7 +2547,8 @@ Merge with history generated before the session after the 
buffer is no longer sh
(when index
  (ring-remove old-ring index))
(ring-insert old-ring item))
-   (ring-insert old-ring item
+   (ring-insert old-ring item)))
+old-ring)
 old-ring))
 
 (defsubst crdt--comint-effective-ring ()
@@ -2559,7 +2563,14 @@ Merge with history generated before the session after 
the buffer is no longer sh
   (add-to-list 'crdt--enabled-text-properties 'field)
   (add-to-list 'crdt--enabled-text-properties 'front-sticky)
   (add-to-list 'crdt--enabled-text-properties 'rear-nonsticky)
-  (cl-shiftf crdt--comint-saved-input-ring comint-input-ring 
(make-ring comint-input-ring-size)))
+  (if (crdt--server-p)
+  (when crdt-comint-share-input-history
+(crdt-register-variable 'comint-input-ring 
crdt-variable-scheme-diff-server)
+(when (eq crdt-comint-share-input-history 'censor)
+  (cl-shiftf crdt--comint-saved-input-ring comint-input-ring
+ (make-ring comint-input-ring-size
+(crdt-register-variable 'comint-input-ring 
crdt-variable-scheme-diff-server)
+(setq comint-input-ring-file-name nil)))
   (setq comint-input-ring (crdt--comint-effective-ring)
 crdt--comint-saved-input-ring nil
 



[elpa] externals/crdt 3f6f566 11/18: lots of changes

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 3f6f566a674e73313bf4e87ab4bf8069ca8369f8
Author: Qiantan Hong 
Commit: Qiantan Hong 

lots of changes

- better error recovery
- synchronize buffer local variable
- synchronize text property (only at text insertion time)
- comint integration
- follow user
---
 HACKING.org |  31 +++-
 crdt.el | 604 +---
 2 files changed, 484 insertions(+), 151 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index d5d2d66..996577a 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -157,7 +157,17 @@ and second last two bytes represent site ID.
 #+END_SRC
 
 + return ::
-  body takes the form =(site-id logical-clock success-p . return-values)=
+  body takes the form =(site-id logical-clock state-list success-p . 
return-values)=
+
+  - Buffer local variables
++ var :: body takes the form =(buffer-name variable-symbol . args)=
+  =args= is passed to the variable receiver =(get variable-symbol 
'crdt-variable-receiver)=
+  to calculate an updated value.
+  The actual format of =args= depends on the variable sender and receiver 
+  (which supposed implement some CRDT).
+
+  All peer must make sure they install the same kind of variable sender 
and receiver
+  for =variable-symbol=.
 
   - Remote Buffer Process
 + process ::
@@ -239,10 +249,15 @@ Development of the facility is still on-going.
  + [X] initial synchronization of major modes
  + [ ] toggle minor modes on the fly
  + [X] change major modes on the fly
-   - [ ] set of synchronization primitives for buffer local variables
- + [ ] server dictated
+   - [-] set of synchronization primitives for buffer local variables
+ + [-] server dictated
+   + [ ] non incremental
+   + [X] naive incremental
+   + [ ] state-of-the-art level tree diff
  + [ ] a library of CRDTs
-   - [ ] synchronize text properties (any use case for this?)
+   - [-] synchronize text properties (any use case for this?)
+ + [X] synchronize when new text is inserted
+ + [ ] synchronize when changed
- [ ] synchronize markers (any use case for this?)
- [-] remote command
  + [X] basic remote command (only possibly use =(point)=)
@@ -250,6 +265,14 @@ Development of the facility is still on-going.
  + [ ] correctly handle command that uses buffer content
  + [ ] handle arbitrary =interactive= form (firstly, what's the right 
thing to do?)
- [-] remote buffer process
+ + [X] process mark
+ + [X] send to process
+ + [ ] make sure "pseudo process" really looks like process 
+   (define complete set of advices)
+
+** Notes and examples of CRDTize built-in packages
+
+Search for =;;; Built-in package integrations= in ~crdt.el~
 
 * TODO Cross-editor support
 
diff --git a/crdt.el b/crdt.el
index 8261418..f5c12c0 100644
--- a/crdt.el
+++ b/crdt.el
@@ -291,7 +291,8 @@ Must be used inside CRDT--WITH-INSERTION-INFORMATION."
   network-process
   network-clients
   next-client-id
-  buffer-table)
+  buffer-table
+  follow-site-id)
 
 (defvar crdt--inhibit-update nil "When set, don't call CRDT--LOCAL-* on change.
 This is useful for functions that apply remote change to local buffer,
@@ -326,11 +327,7 @@ Each element is of the form (CURSOR-OVERLAY . 
REGION-OVERLAY).")
   lamport-timestamp species front-advance rear-advance plist)
 
 (crdt--defvar-permanent-local crdt--overlay-table nil
-  "A hash table that maps CONSes of the form 
(SITE-ID . LOGICAL-CLOCK) to overlays.")
-
-(defvar crdt--track-overlay-species nil)
-
-(crdt--defvar-permanent-local crdt--enabled-overlay-species nil)
+  "A hash table that maps CONSes of the form (SITE-ID . LOGICAL-CLOCK) to 
overlays.")
 
 (crdt--defvar-permanent-local crdt--buffer-network-name)
 
@@ -338,6 +335,25 @@ Each element is of the form (CURSOR-OVERLAY . 
REGION-OVERLAY).")
 
 (crdt--defvar-permanent-local crdt--buffer-pseudo-process)
 
+(defvar crdt--track-overlay-species nil
+  "Label any newly created overlay with its value as their ``species''.
+You usually want to dynamically bound this variable,
+so that overlays created during a dynamic extent
+are categorized into the same ``species''.
+You can then enable synchronizing those overlays using
+function CRDT--ENABLE-OVERLAY-SPECIES.")
+
+(defvar-local crdt--enabled-overlay-species nil
+  "A list of ``species'' of overlays that are tracked and synchronized.
+See CRDT--TRACK-OVERLAY-SPECIES.
+You should always use CRDT--ENABLE-OVERLAY-SPECIES
+and CRDT--DISABLE-OVERLAY-SPECIES to modify this variable
+as those functions handle bookkeeping of
+adding/removing actively tracked overlays.")
+
+(defvar-local crdt--enabled-text-properties nil
+  "A list of text properties that are tracked and synchronized.")
+
 ;;; Global variables
 
 (defvar crdt--session-list nil)
@@ -463,6 +479,26 @@ This will hopefully trigger error recovery mechanism when 
further 

[elpa] externals/crdt 52cbf50 15/18: autoload; fix bug for cmuscheme

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 52cbf50ed7b6dc268ef92598053d14f8df6bc09b
Author: Qiantan Hong 
Commit: Qiantan Hong 

autoload; fix bug for cmuscheme
---
 crdt.el | 69 +++--
 1 file changed, 41 insertions(+), 28 deletions(-)

diff --git a/crdt.el b/crdt.el
index d690a04..52d8f73 100644
--- a/crdt.el
+++ b/crdt.el
@@ -459,15 +459,7 @@ Also set CRDT--PSEUDO-CURSOR-TABLE to NIL."
   (widen)
   (remove-overlays (point-min) (point-max) 'category 
'crdt-visualize-author
 
-;;; Shared buffer utils
-
-(defsubst crdt--server-p (&optional session)
-  "Tell if SESSION is running as a server.
-If SESSION is nil, use current CRDT--SESSION."
-  (process-contact
-   (crdt--session-network-process
-(or session crdt--session))
-   :server))
+;;; Error recovery
 
 (define-error 'crdt-sync-error "CRDT synchronization error")
 
@@ -497,6 +489,30 @@ NAME is included in the report."
   (message "Killing the buffer because of error.")
   (kill-buffer))
 
+(defun crdt--recover (&optional err)
+  "Try to recover from a synchronization failure.
+Current buffer is assmuned to be the one with synchronization error.
+If we are the server, ERR is the error we shall report to client."
+  (if (crdt--server-p)
+  (progn
+(let ((message (crdt--format-message `(error 
,crdt--buffer-network-name ,(car err) ,(crdt--readable-encode (cdr err))
+  (process-send-string crdt--process message)))
+(ding)
+(read-only-mode)
+(message "Synchronization error detected, try recovering...")
+(crdt--broadcast-maybe
+ (crdt--format-message `(get ,crdt--buffer-network-name)
+
+;;; Shared buffer utils
+
+(defsubst crdt--server-p (&optional session)
+  "Tell if SESSION is running as a server.
+If SESSION is nil, use current CRDT--SESSION."
+  (process-contact
+   (crdt--session-network-process
+(or session crdt--session))
+   :server))
+
 (defmacro crdt--with-buffer-name (name &rest body)
   "Find CRDT shared buffer associated with NAME and evaluate BODY in it.
 Any narrowing is temporarily disabled during evaluation of BODY.
@@ -1236,22 +1252,6 @@ Verify that CRDT IDs in a document follows ascending 
order."
   (setq pos next-pos)
   (setq id next-id))
 
-;;; Recovery
-
-(defun crdt--recover (&optional err)
-  "Try to recover from a synchronization failure.
-Current buffer is assmuned to be the one with synchronization error.
-If we are the server, ERR is the error we shall report to client."
-  (if (crdt--server-p)
-  (progn
-(let ((message (crdt--format-message `(error 
,crdt--buffer-network-name ,(car err) ,(crdt--readable-encode (cdr err))
-  (process-send-string crdt--process message)))
-(ding)
-(read-only-mode)
-(message "Synchronization error detected, try recovering...")
-(crdt--broadcast-maybe
- (crdt--format-message `(get ,crdt--buffer-network-name)
-
 ;;; Network protocol
 
 (defun crdt--format-message (args)
@@ -1514,9 +1514,12 @@ CRDT--PROCESS should be bound to The network process for 
the client connection."
 (define-crdt-message-handler ready (buffer-name mode)
   (unless (crdt--server-p)   ; server shouldn't receive this
 (crdt--with-buffer-name buffer-name
+  (unless (fboundp mode)
+(when (get mode 'crdt-autoload)
+  (require (get mode 'crdt-autoload) nil t)))
   (if (fboundp mode)
   (unless (eq major-mode mode)
-(funcall mode); trust your server...
+(funcall mode)  ; trust your server...
 (crdt-mode))
 (message "Server uses %s, but not available locally." mode))
   (when crdt--buffer-sync-callback
@@ -2181,6 +2184,12 @@ Join with DISPLAY-NAME."
 (cl-loop for command in '(org-cycle org-shifttab)
   do (advice-add command :around #'crdt--org-overlay-advice))
 
+;;; Auxillary autoload
+
+(defun crdt-register-autoload (mode feature)
+  "Register for autoloading FEATURE before CRDT enforce major MODE."
+  (put mode 'crdt-autoload feature))
+
 ;;; Remote Command
 
 (defun crdt--assemble-state-list (states)
@@ -2470,8 +2479,7 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
(if (symbolp scheme) (symbol-value scheme) scheme)))
 
 (defun crdt-unregister-variable (variable)
-  (delq variable crdt-variables)
-  (cl-remprop variable 'crdt-variable-scheme))
+  (delq variable crdt-variables))
 
 (defun crdt-register-variables (variable-entries)
   (dolist (entry variable-entries)
@@ -2526,6 +2534,11 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 
 (crdt-register-remote-commands crdt-comint-command-entries)
 
+(crdt-register-autoload 'shell-mode 'shell)
+(crdt-register-autoload 'inferior-scheme-mode 'cmuscheme)
+
+(put 'comint-input-ring 'crdt-variable-scheme crdt-variable-scheme-diff-server)
+
 (defcustom crdt-comint-share-input-history 'censor

[elpa] externals/crdt b6bcc8b 03/18: Merge branch 'master' into development

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit b6bcc8b0c14bcd8e27dad5385051e048e9d21eaf
Merge: dcf1dd5 70ae7ba
Author: Qiantan Hong 
Commit: Qiantan Hong 

Merge branch 'master' into development
---
 HACKING.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/HACKING.org b/HACKING.org
index 6214588..eab1b13 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -148,7 +148,7 @@ Synchronize arbitrary buffer-local-variable reasonably is 
hard, but user annotat
- [-] synchronize major/minor modes
  + [X] initial synchronization of major modes
  + [ ] toggle minor modes on the fly
- + [ ] change major modes on the fly
+ + [X] change major modes on the fly
- [ ] set of synchronization primitives for buffer local variables
  + [ ] server dictated
  + [ ] a library of CRDTs



[elpa] externals/crdt c08e21d 06/18: Refactors and remote command

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit c08e21d0dc77ec0ef7a812e5ee2bb9df72f7
Author: Qiantan Hong 
Commit: Qiantan Hong 

Refactors and remote command

- change generic function interface crdt-process-message
- added crdt--readable-encode and crdt--readable-decode
- initial work for remote command
---
 HACKING.org |  10 +++-
 crdt.el | 189 
 2 files changed, 134 insertions(+), 65 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index d04064b..f8e5b12 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -30,7 +30,8 @@ and second last two bytes represent site ID.
   - =content= is the string to be inserted
 
 + delete ::
-  body takes the form =(buffer-name position-hint (crdt-id . length)*)=
+  body takes the form =(buffer-name position-hint . crdt-id-list)=
+  - =crdt-id-list= is generated from =CRDT--DUMP-IDS= from the deleted text
 
   - Peer State
 + cursor ::
@@ -130,6 +131,13 @@ and second last two bytes represent site ID.
 + overlay-remove ::
   body takes the form =(buffer-name site-id logical-clock)=
 
+  - Remote Command
++ command ::
+  body takes the form =(buffer-name site-id logical-clock command-symbol . 
args)=
+
++ return ::
+  body takes the form =(site-id logical-clock success-p . return-values)=
+
   - Remote Buffer Process
 + process ::
   body takes the form =(buffer-name string)=
diff --git a/crdt.el b/crdt.el
index cec2b21..ab71a1b 100644
--- a/crdt.el
+++ b/crdt.el
@@ -1024,7 +1024,7 @@ If POINT-CRDT-ID is NIL, remove the pseudo cursor and 
region
 overlays for this site.
 The mark for that site is at MARK-CRDT-ID,
 whose search starts around MARK-POSITION-HINT.
-If MARK-CRDT-ID, deactivate the pseudo region overlay."
+If MARK-CRDT-ID is NIL, deactivate the pseudo region overlay."
   (when (and site-id (not (eq site-id (crdt--session-local-id crdt--session
 (let ((ov-pair (gethash site-id crdt--pseudo-cursor-table)))
   (if point-crdt-id
@@ -1144,14 +1144,7 @@ Verify that CRDT IDs in a document follows ascending 
order."
 Current buffer is assmuned to be the one with synchronization error."
   (if (crdt--server-p)
   (progn
-(let ((message (crdt--format-message `(error 
,crdt--buffer-network-name ,@err
-  (condition-case nil
-  (read-from-string message)
-(invalid-read-syntax
- ;; (cdr err) must be unprintable, omit it for now
- ;; maybe handle some objects in the future
- ;; (e.g. represent buffer object with its name)
- (setq message (crdt--format-message `(error 
,crdt--buffer-network-name ,(car err))
+(let ((message (crdt--format-message `(error 
,crdt--buffer-network-name ,(car err) ,(crdt--readable-encode (cdr err))
   (process-send-string crdt--process message)))
 (ding)
 (read-only-mode)
@@ -1168,6 +1161,30 @@ Return the string."
 (print-length nil))
 (prin1-to-string args)))
 
+(defun crdt--readable-encode (object)
+  "Return an object ``similar'' to OBJECT at best effort,
+but whose printed representation can be read back.
+The symbol CRDT-EVAL is used as an special marker in the encoding
+and the behavior is undefined if OBJECT itself contains this symbol."
+  (cl-typecase object
+((or symbol string number character) object)
+(cons (cons (crdt--ensure-readable (car object)) (crdt--ensure-readable 
(cdr object
+(buffer (list 'crdt-eval 'buffer
+  (buffer-local-value 'crdt--buffer-network-name buffer)))
+(t (list 'crdt-eval 'unreadable
+ (prin1-to-string object)
+
+(defun crdt--readable-decode (object)
+  "Reconstruct the original object from
+CRDT--READABLE-ENCODEd OBJECT at best effort."
+  (if (consp object)
+  (if (eq (car object) 'crdt-eval)
+  (cl-case (cadr object)
+((buffer) (crdt--with-buffer-name (caddr object) (current-buffer)))
+((unreadable) (caddr object)))
+object)
+  object))
+
 (cl-defun crdt--broadcast-maybe (message-string &optional (without t))
   "Broadcast or send MESSAGE-STRING.
 If (CRDT--SESSION-NETWORK-PROCESS CRDT--SESSION) is a server process,
@@ -1307,30 +1324,36 @@ The network process for the client connection is 
PROCESS."
 ,(crdt--session-focused-buffer-name 
crdt--session
   (let ((contact-message `(contact ,client-id ,(process-get process 
'client-name)
,(process-contact process :host)
-   ,(process-contact process :service
-(crdt-process-message contact-message process)
+   ,(process-contact process :service)))
+(crdt--process process))
+(crdt-process-message-1 contact-message)
+
+(cl-defgeneric crdt-process-message (message string) "Handle MESSAGE read from 
STRING.
+We 

[elpa] externals/crdt dcf1dd5 02/18: Update version number

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit dcf1dd54ad0d0080dad3971eb8f9c486bdfe5dd2
Author: Qiantan Hong 
Commit: Qiantan Hong 

Update version number
---
 crdt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crdt.el b/crdt.el
index e78a8c9..99fde16 100644
--- a/crdt.el
+++ b/crdt.el
@@ -6,7 +6,7 @@
 ;; Maintainer: Qiantan Hong 
 ;; URL: https://code.librehq.com/qhong/crdt.el
 ;; Keywords: collaboration crdt
-;; Version: 0.1.2
+;; Version: 0.2.0
 
 ;; This file is part of GNU Emacs.
 



[elpa] externals/crdt bf1dc5d 09/18: typo

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit bf1dc5d045f3d977c9302b4c9fe4164c96eeacaf
Author: Qiantan Hong 
Commit: Qiantan Hong 

typo
---
 crdt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crdt.el b/crdt.el
index a04d338..e67534e 100644
--- a/crdt.el
+++ b/crdt.el
@@ -2256,7 +2256,7 @@ Stop allowing remote calls to FUNCTION-SYMBOL."
   (let ((major-mode 'scheme-debugger-mode-initialize))
 (crdt--after-change-major-mode
 ;; I can't get input prompt from debugger to pop up at the right place.
-;; Because it's doen asynchronously in process filter,
+;; Because it's done asynchronously in process filter,
 ;; and there seems to be no way to know the correct SPAWN-SITE-ID.
 
 ;;; pseudo process



[elpa] externals/crdt 40bd5d4 16/18: document

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 40bd5d4bc022231db2047895f826d15647666cb5
Author: Qiantan Hong 
Commit: Qiantan Hong 

document
---
 README.org | 7 +++
 crdt.el| 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 733173e..0a3d681 100644
--- a/README.org
+++ b/README.org
@@ -118,3 +118,10 @@ based on which user authored it.
 
 Turn on =crdt-org-sync-overlay-mode=. All peers that have this enabled have 
their
 folding status synchronized. Peers without enabling this minor mode are 
unaffected.
+
+** Comint integration
+
+Just go ahead and share you comint REPL buffer! Tested: ~shell~ and 
~cmuscheme~.
+By default, when sharing a comint buffer, ~crdt.el~ temporarily reset input 
history (as in =M-n= =M-p=)
+so others don't spy into your =.bash_history= and alike.
+You can customize this behavior using variable 
=crdt-comint-share-input-history=.
diff --git a/crdt.el b/crdt.el
index 52d8f73..36fa2fe 100644
--- a/crdt.el
+++ b/crdt.el
@@ -2541,7 +2541,7 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 
 (defcustom crdt-comint-share-input-history 'censor
   "Share comint input history.
-If the value is censor,
+If the value is 'censor,
 show only input history generated during a CRDT session to its peers,
 Merge with history generated before the session after the buffer is no longer 
shared."
   :type '(choice boolean (const censor)))



[elpa] externals/crdt e175d65 08/18: Remote command

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit e175d6502eba5aa3bc754fc6df75d381c16b00dd
Author: Qiantan Hong 
Commit: Qiantan Hong 

Remote command

- improve error recovery mechanism
- improve support for xscheme.el
- revised remote command protocol, add spawn-site-id
---
 HACKING.org |  31 +-
 crdt.el | 330 ++--
 2 files changed, 257 insertions(+), 104 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index 2ed748b..d5d2d66 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -5,8 +5,12 @@ Background reading: 
[[https://en.wikipedia.org/wiki/Conflict-free_replicated_dat
 This packages implements the Logoot split algorithm
 ~André, Luc, et al. "Supporting adaptable granularity of changes for 
massive-scale collaborative editing." 9th IEEE International Conference on 
Collaborative Computing: Networking, Applications and Worksharing. IEEE, 2013.~
 
-The CRDT-ID blocks are implemented by text property ='crdt-id=. A continous 
range of text with the same ='crdt-id'= property represent a CRDT-ID block. The 
='crdt-id= is a a cons of =(ID-STRING . END-OF-BLOCK-P)=, where
-=ID-STRING= represent the CRDT-ID of the leftmost character in the block. If 
=END-OF-BLOCK-P= is =NIL=, the block is a non-rightmost segment splitted from a 
larger block, so insertion at the right of this block shouldn't be merged into 
the block by sharing the base CRDT-ID and increasing offset.
+The CRDT-ID blocks are implemented by text property ='crdt-id=. 
+A continous range of text with the same ='crdt-id'= property represent a 
CRDT-ID block. 
+The ='crdt-id= is a a cons of =(ID-STRING . END-OF-BLOCK-P)=, 
+where =ID-STRING= represent the CRDT-ID of the leftmost character in the block.
+If =END-OF-BLOCK-P= is =NIL=, the block is a non-rightmost segment splitted 
from a larger block,
+so insertion at the right of this block shouldn't be merged into the block by 
sharing the base CRDT-ID and increasing offset.
 
 =ID-STRING= is a unibyte string representing a CRDT-ID (for efficient 
comparison).
 Every two bytes represent a big endian encoded integer.
@@ -133,7 +137,24 @@ and second last two bytes represent site ID.
 
   - Remote Command
 + command ::
-  body takes the form =(buffer-name site-id logical-clock command-symbol . 
args)=
+  body takes the form
+  #+BEGIN_SRC
+  (buffer-name spawn-site-id
+   site-id logical-clock state-list
+   command-symbol . args)
+  #+END_SRC
+   - =spawn-site-id= represents the site where the interactive command is 
originally invoked
+ + It can be different from =site-id= because a remote command can 
call a remote command!
+   This is especially useful when client makes a remote call, 
+   but the call on the server request some interactive input,
+   and such interactive call are remote-called back into the client.
+   - =state-list= is an alist of bindings.
+(except that we use 1 element list for the CDRs, to save a dot in the 
serialized string)
+(CDRs can also be 2 element list of the form =(crdt-id pos-hint)=)
+Allowed symbols are 
+#+BEGIN_SRC
+point mark mark-active transient-mark-mode last-command-event
+#+END_SRC
 
 + return ::
   body takes the form =(site-id logical-clock success-p . return-values)=
@@ -160,7 +181,7 @@ By implementing synchronization primitives for all 
components in a buffer,
 pretty much everything can be made collaborative.
 Synchronize arbitrary buffer-local-variable reasonably is hard, but user 
annotations can help.
 
-** How to implement collaboration support to an package
+** How to implement collaboration support for a package
 
 ~crdt.el~ provides two sets of facilities for adding collaboration support, a 
command-based one and a state-based one. 
 Package hackers are free to combine them to provide desired behavior.
@@ -225,7 +246,7 @@ Development of the facility is still on-going.
- [ ] synchronize markers (any use case for this?)
- [-] remote command
  + [X] basic remote command (only possibly use =(point)=)
- + [ ] command that uses region
+ + [X] command that uses region
  + [ ] correctly handle command that uses buffer content
  + [ ] handle arbitrary =interactive= form (firstly, what's the right 
thing to do?)
- [-] remote buffer process
diff --git a/crdt.el b/crdt.el
index 1c0afe5..a04d338 100644
--- a/crdt.el
+++ b/crdt.el
@@ -453,6 +453,16 @@ If SESSION is nil, use current CRDT--SESSION."
 (or session crdt--session))
:server))
 
+(define-error 'crdt-sync-error "CRDT synchronization error")
+
+(defmacro crdt--with-recover (&rest body)
+  "When any error in BODY occur, signal a CRDT-SYNC-ERROR instead.
+This will hopefully trigger error recovery mechanism when further unwinding 
the stack."
+  (declare (indent 1) (debug (sexp def-body)))
+  `(condition-case nil
+   (progn ,@ body)
+ (error (signal 'crdt-sync-error n

[elpa] externals/crdt 936418c 14/18: Synchronize text property on changes

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 936418ced9e4259f984f8f49e461251c8201c71f
Author: Qiantan Hong 
Commit: Qiantan Hong 

Synchronize text property on changes

and bug fix
---
 HACKING.org |  4 ++--
 crdt.el | 13 +++--
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index 996577a..57fde18 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -255,9 +255,9 @@ Development of the facility is still on-going.
+ [X] naive incremental
+ [ ] state-of-the-art level tree diff
  + [ ] a library of CRDTs
-   - [-] synchronize text properties (any use case for this?)
+   - [X] synchronize text properties (any use case for this?)
  + [X] synchronize when new text is inserted
- + [ ] synchronize when changed
+ + [X] synchronize when changed
- [ ] synchronize markers (any use case for this?)
- [-] remote command
  + [X] basic remote command (only possibly use =(point)=)
diff --git a/crdt.el b/crdt.el
index a8f8ecb..d690a04 100644
--- a/crdt.el
+++ b/crdt.el
@@ -487,10 +487,8 @@ NAME is included in the report."
(progn ,@ body)
  (error
   (ding)
-  (message "Error happens inside %s. This should never happen, please 
submit an issue to crdt.el maintainers." ',name)
+  (message "Error happens inside %s. This should never happen, please file 
a report to crdt.el maintainers." ',name)
   (message " Error: %s" err)
-  (message " Backtrace: ")
-  (backtrace)
   (if (crdt--server-p)
   (progn
 (message "Stop sharing the buffer because of error.")
@@ -1043,7 +1041,9 @@ Start the search for those ID-ITEMs around POSITION-HINT."
   "Before change hook used by CRDT-MODE.
 It saves the content to be changed (between BEG and END) into 
CRDT--CHANGED-STRING."
   (unless crdt--inhibit-update
-(setq crdt--changed-string (buffer-substring beg end))
+(setq crdt--changed-string (crdt--buffer-substring beg end))
+(crdt--text-property-assimilate nil beg end 0
+'crdt-id crdt--changed-string)
 (setq crdt--changed-start beg)))
 
 (defsubst crdt--crdt-id-assimilate (template beg &optional object)
@@ -1075,8 +1075,8 @@ update the CRDT-ID for any newly inserted text, and send 
message to other peers
 (save-restriction
   (goto-char beg)
   (if (and (= length (- end beg))
-   (string-equal (crdt--changed-string beg length)
- (buffer-substring-no-properties beg end)))
+   (equal-including-properties (crdt--changed-string beg 
length)
+   (crdt--buffer-substring beg 
end)))
   (crdt--crdt-id-assimilate (crdt--changed-string beg length) 
beg)
 (widen)
 (with-silent-modifications
@@ -2518,6 +2518,7 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 (defvar comint-input-ring)
 (defvar comint-input-ignoredups)
 (defvar comint-input-ring-size)
+(defvar comint-input-ring-file-name)
 
 (defvar crdt-comint-command-entries
   '((comint-send-input (point) (point))



[elpa] externals/crdt b11bbc0 17/18: some more autoloads

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit b11bbc0e50dc27abfea368406db6855d3b8f8326
Author: Qiantan Hong 
Commit: Qiantan Hong 

some more autoloads
---
 crdt.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/crdt.el b/crdt.el
index 36fa2fe..6031c3f 100644
--- a/crdt.el
+++ b/crdt.el
@@ -2536,6 +2536,9 @@ The result DIFF can be used in (CRDT--NAPPLY-DIFF OLD 
DIFF) to reproduce NEW."
 
 (crdt-register-autoload 'shell-mode 'shell)
 (crdt-register-autoload 'inferior-scheme-mode 'cmuscheme)
+(crdt-register-autoload 'inferior-python-mode 'python)
+(crdt-register-autoload 'prolog-inferior-mode 'prolog)
+(crdt-register-autoload 'inferior-lisp-mode 'inf-lisp)
 
 (put 'comint-input-ring 'crdt-variable-scheme crdt-variable-scheme-diff-server)
 



[elpa] externals/crdt 38476da 05/18: Merge branch 'fix' into development

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 38476dac4630b18bbf3199ee6ab26a9e95c96fc0
Merge: cc37dcd a4a07fb
Author: Qiantan Hong 
Commit: Qiantan Hong 

Merge branch 'fix' into development
---
 HACKING.org |  12 ++-
 crdt.el | 354 ++--
 2 files changed, 211 insertions(+), 155 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index 5ad8093..d04064b 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -69,7 +69,7 @@ and second last two bytes represent site ID.
   - Initial Synchronization
 + sync ::
   This message is sent from server to client to get it sync to the state 
on the server.
-  Might be used for error recovery or other optimization in the future.
+  Might be used for other optimization in the future.
   One optimization I have in mind is let server try to merge all CRDT item 
into a single
   one and try to synchronize this state to clients at best effort.
   body takes the form =(buffer-name . crdt-id-list)=
@@ -83,6 +83,16 @@ and second last two bytes represent site ID.
   The client should now try to enable =major-mode-symbol= in the
   synchronized buffer.
 
+  - Error Recovery
+Note: when a client side error happens, it just sends a =get= message and
+follow initial synchronization procedure to reinitialize the buffer.
+
++ error ::
+  body takes the form =(buffer-name error-symbol . error-datum)=.
+  This message is sent from server to client to notice that some messages 
from the
+  client is not processed due to error =(error-symbol . error-datum)=.
+  Normally client should follow initial synchronization procedure to 
reinitialize the buffer.
+
   - Buffer Service
 + add ::
   Indicates that the server has started sharing some buffers.
diff --git a/crdt.el b/crdt.el
index 99fde16..cec2b21 100644
--- a/crdt.el
+++ b/crdt.el
@@ -30,12 +30,10 @@
 
 ;;; Customs
 
-(require 'xdg)
+(require 'xdg nil t)
 (require 'cl-lib)
-(require 'subr-x)
 (require 'url)
 (require 'color)
-(require 'files)
 
 (defgroup crdt nil
   "Collaborative editing using Conflict-free Replicated Data Types."
@@ -65,7 +63,7 @@
   "Path to the tuntox binary."
   :type 'file)
 
-(defcustom crdt-tuntox-key-path (xdg-data-home)
+(defcustom crdt-tuntox-key-path (if (featurep 'xdg) (xdg-data-home) "~/")
   "Path to save tuntox's private key."
   :type 'directory)
 
@@ -346,23 +344,29 @@ Each element is of the form (CURSOR-OVERLAY . 
REGION-OVERLAY).")
 
 (defvar crdt--session-menu-buffer nil)
 
+(defvar crdt--process nil
+  "Temporarily bound to the current network process when processing messages 
inside CRDT--NETWORK-FILTER.")
+
 ;;; crdt-mode
 
+(defvar crdt--hooks-alist
+  '((after-change-functions . crdt--after-change)
+(before-change-functions . crdt--before-change)
+(post-command-hook . crdt--post-command)
+(deactivate-mark-hook . crdt--post-command)
+(kill-buffer-hook . crdt--kill-buffer-hook)
+(clone-buffer-hook . crdt--clone-buffer-hook)
+(clone-indirect-buffer-hook . crdt--clone-buffer-hook)))
+
 (defun crdt--install-hooks ()
   "Install the hooks used by CRDT-MODE."
-  (add-hook 'after-change-functions #'crdt--after-change nil t)
-  (add-hook 'before-change-functions #'crdt--before-change nil t)
-  (add-hook 'post-command-hook #'crdt--post-command nil t)
-  (add-hook 'deactivate-mark-hook #'crdt--post-command nil t)
-  (add-hook 'kill-buffer-hook #'crdt--kill-buffer-hook nil t))
+  (dolist (pair crdt--hooks-alist)
+(add-hook (car pair) (cdr pair) nil t)))
 
 (defun crdt--uninstall-hooks ()
   "Uninstall the hooks used by CRDT-MODE."
-  (remove-hook 'after-change-functions #'crdt--after-change t)
-  (remove-hook 'before-change-functions #'crdt--before-change t)
-  (remove-hook 'post-command-hook #'crdt--post-command t)
-  (remove-hook 'deactivate-mark-hook #'crdt--post-command t)
-  (remove-hook 'kill-buffer-hook #'crdt--kill-buffer-hook t))
+  (dolist (pair crdt--hooks-alist)
+(remove-hook (car pair) (cdr pair) t)))
 
 (defsubst crdt--clear-pseudo-cursor-table ()
   "Remove all overlays in CRDT--PSEUDO-CURSOR-TABLE.
@@ -400,20 +404,35 @@ Also set CRDT--PSEUDO-CURSOR-TABLE to NIL."
 (crdt--clear-pseudo-cursor-table)
 (setq crdt--overlay-table nil)))
 
+(defun crdt--clone-buffer-hook ()
+  (crdt-mode -1))
+
 ;;; Author visualization
 
 (defsubst crdt--visualize-author-1 (beg end site)
-  (put-text-property beg end
- 'font-lock-face `(:underline ,(crdt--get-cursor-color 
site
+  (remove-overlays beg end 'category 'crdt-visualize-author)
+  (cl-flet ((ov-alike-p (ov)
+  (and (eq (overlay-get ov 'category) 'crdt-visualize-author)
+   (eq (overlay-get ov 'crdt-site) site
+(or
+ (let ((ov-front (cl-find-if #'ov-alike-p (overlays-at (1- beg)
+   (when ov-front (move-overlay ov-front (overlay-start ov-front) end) t))
+ (let ((ov-rear (cl-find-if #'ov-alike-p (overlays-at end
+   (when o

[elpa] externals/crdt 605d8fa 07/18: initial experiment of xscheme.el integration

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 605d8fa10092c39cde2a7b880f168e224de5d1c2
Author: Qiantan Hong 
Commit: Qiantan Hong 

initial experiment of xscheme.el integration
---
 HACKING.org |  59 -
 crdt.el | 108 ++--
 2 files changed, 126 insertions(+), 41 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index f8e5b12..2ed748b 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -160,7 +160,58 @@ By implementing synchronization primitives for all 
components in a buffer,
 pretty much everything can be made collaborative.
 Synchronize arbitrary buffer-local-variable reasonably is hard, but user 
annotations can help.
 
-** TODO task list
+** How to implement collaboration support to an package
+
+~crdt.el~ provides two sets of facilities for adding collaboration support, a 
command-based one and a state-based one. 
+Package hackers are free to combine them to provide desired behavior.
+
+*** Command-based collaboration
+
+This is a simple method to add collaboration support. 
+After registering a command with =crdt-register-remote-command=, 
+an =:around= advice is added such that when a client invoke this command,
+an request is sent to the server instead of running the command locally.
+
+Hackers must make sure that they declare what sets of buffer state the command 
uses 
+to fully preserve user intent.
+
+Although relatively simple, collaboration command implemented using this method
+must go through a round trip to the server and will incur latency.
+
+ Why we need used-state-set annotations
+
+Suppose Alyssa P. Hacker does =(crdt-register-remote-command 'eval-last-sexp)=,
+but didn't declare that =eval-last-sexp= uses content of the buffer.
+Now the hackers are conspiring in an ~crdt.el~ session. 
+Ben Bitdiddle places cursor after =(+ 1 1)= and run =eval-last-sexp=.
+However, the moment Ben Bitdiddle's request arrives at the server, 
+Cy D. Fect has changed =(+ 1 1)= to =(+ 1 2)= (their message arrives first!).
+Now the server does what it sees and return =3=, instead of =2=.
+
+The correct solution is to let the server roll-back to the state when Ben 
Bitdiddle invoked the command.
+It is relatively expensive thus we don't want to do this for every command,
+thus we require package hackers to annotate explicitly.
+
+/The above mechanism haven't been implemented yet!/ 
+But adding annotations now will help adding it in the future.
+To implement this mechanism we need to add lamport timestamp to every messages 
+(which may corresponds to mutation of interesting states),
+and send a vector clock in =command= messages which depend on buffer content.
+
+*** State-based collaboration
+
+We can also synchronize the underlying state of the packages 
+rather than proxying user-level commands.
+If there're good CRDT candidates to be used for the state 
+(hackers need to understand what concurrency semantics their state need to 
have!),
+then the commands can have real-time effect without needing to be acknowledged 
from the server.
+
+=crdt-org-sync-overlay-mode= is an example of this approach.
+
+Overall, this method is much more complicated than command-base method. 
+Development of the facility is still on-going.
+
+** TODO Task list for ~crdt.el~ facility
- [X] synchronize buffer text (insert/delete)
- [X] synchronize overlays
- [-] synchronize major/minor modes
@@ -172,6 +223,12 @@ Synchronize arbitrary buffer-local-variable reasonably is 
hard, but user annotat
  + [ ] a library of CRDTs
- [ ] synchronize text properties (any use case for this?)
- [ ] synchronize markers (any use case for this?)
+   - [-] remote command
+ + [X] basic remote command (only possibly use =(point)=)
+ + [ ] command that uses region
+ + [ ] correctly handle command that uses buffer content
+ + [ ] handle arbitrary =interactive= form (firstly, what's the right 
thing to do?)
+   - [-] remote buffer process
 
 * TODO Cross-editor support
 
diff --git a/crdt.el b/crdt.el
index ab71a1b..1c0afe5 100644
--- a/crdt.el
+++ b/crdt.el
@@ -1168,9 +1168,9 @@ The symbol CRDT-EVAL is used as an special marker in the 
encoding
 and the behavior is undefined if OBJECT itself contains this symbol."
   (cl-typecase object
 ((or symbol string number character) object)
-(cons (cons (crdt--ensure-readable (car object)) (crdt--ensure-readable 
(cdr object
+(cons (cons (crdt--readable-encode (car object)) (crdt--readable-encode 
(cdr object
 (buffer (list 'crdt-eval 'buffer
-  (buffer-local-value 'crdt--buffer-network-name buffer)))
+  (buffer-local-value 'crdt--buffer-network-name object)))
 (t (list 'crdt-eval 'unreadable
  (prin1-to-string object)
 
@@ -1225,18 +1225,18 @@ The overlay is FRONT-ADVANCE and REAR-ADVANCE, and lies 
between BEG and END."
   "Generate a challenge string for authentication."
   (apply #'unibyte-string (cl-loop for i bel

[elpa] externals/crdt 6b85d8a 10/18: refactor, replace cl-generic with hashtable of handlers

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit 6b85d8a2b340e8f5b3774cd62e6c6c719cdde692
Author: Qiantan Hong 
Commit: Qiantan Hong 

refactor, replace cl-generic with hashtable of handlers
---
 crdt.el | 507 +---
 1 file changed, 261 insertions(+), 246 deletions(-)

diff --git a/crdt.el b/crdt.el
index e67534e..8261418 100644
--- a/crdt.el
+++ b/crdt.el
@@ -1009,13 +1009,13 @@ update the CRDT-ID for any newly inserted text, and 
send message to other peers
   (dolist (message (crdt--local-insert beg end))
 (crdt--broadcast-maybe
  (crdt--format-message message
-;; process-mark synchronization is dependent on correct CRDT-ID
-;; therefore we must do it after the insert/change stuff is done
-(crdt--send-process-mark-maybe)
 ;; see if region stuff changed
 (let ((cursor-message (crdt--local-cursor)))
   (when cursor-message
-(crdt--broadcast-maybe (crdt--format-message cursor-message
+(crdt--broadcast-maybe (crdt--format-message cursor-message
+;; process-mark synchronization is dependent on correct CRDT-ID
+;; therefore we must do it after the insert/change stuff is done
+(crdt--send-process-mark-maybe)
 
 ;;; CRDT point/mark synchronization
 
@@ -1092,7 +1092,10 @@ Send message to other peers about any changes."
 (crdt--refresh-users-maybe))
   (let ((cursor-message (crdt--local-cursor)))
 (when cursor-message
-  (crdt--broadcast-maybe (crdt--format-message cursor-message)
+  (crdt--broadcast-maybe (crdt--format-message cursor-message
+  ;; process-mark synchronization is dependent on correct CRDT-ID
+  ;; therefore we must do it after the insert/change stuff is done
+  (crdt--send-process-mark-maybe))
 
 ;;; CRDT ID (de)serialization
 
@@ -1195,6 +1198,10 @@ and the behavior is undefined if OBJECT itself contains 
this symbol."
 object)
   object))
 
+(defsubst crdt--log-network-traffic (message-string)
+  (when crdt--log-network-traffic
+(message "Send %s" message-string)))
+
 (cl-defun crdt--broadcast-maybe (message-string &optional (without t))
   "Broadcast or send MESSAGE-STRING.
 If (CRDT--SESSION-NETWORK-PROCESS CRDT--SESSION) is a server process,
@@ -1202,21 +1209,56 @@ broadcast MESSAGE-STRING to clients except the one of 
which CLIENT-ID
 property is EQ to WITHOUT.
 If (CRDT--SESSION-NETWORK-PROCESS CRDT--SESSION) is a client process,
 send MESSAGE-STRING to server when WITHOUT is non-nil."
-  (when crdt--log-network-traffic
-(message "Send %s" message-string))
   (if (process-contact (crdt--session-network-process crdt--session) :server)
   (dolist (client (crdt--session-network-clients crdt--session))
 (when (and (eq (process-status client) 'open)
(not (eq (process-get client 'client-id) without)))
+  (crdt--log-network-traffic message-string)
   (process-send-string client message-string)
   ;; (run-at-time 1 nil #'process-send-string client message-string)
   ;; ^ quick dirty way to simulate network latency, for debugging
   ))
 (when without
+  (crdt--log-network-traffic message-string)
   (process-send-string (crdt--session-network-process crdt--session) 
message-string)
   ;; (run-at-time 1 nil #'process-send-string 
(crdt--session-network-process crdt--session) message-string)
   )))
 
+(defvar crdt--message-handler-table (make-hash-table)
+  "Map CRDT message type to handler function.")
+
+(cl-defmacro define-crdt-message-handler (type arglist &body body)
+  "Define a crdt message handler.
+Define a function CRDT--HANDLE-MESSAGE-[TYPE] with ARGLIST and BODY and
+use it to handle message TYPE."
+  (declare (debug
+(&define name cl-lambda-list cl-declarations-or-string def-body))
+   (doc-string 3)
+   (indent 2))
+  (let ((function-name (intern (concat "crdt--handle-message-" (symbol-name 
type)
+`(progn
+   (cl-defun ,function-name ,arglist ,@body)
+   (puthash ',type ',function-name crdt--message-handler-table
+
+(defvar crdt--message-string nil
+  "Bound to the string representation of the message inside message handler.
+So that we don't need to convert MESSAGE to string again
+when we need to broadcast it.")
+
+(define-error 'crdt-unrecognized-message "Unhandled 
crdt-unrecognized-message.")
+
+(defsubst crdt-process-message (message string)
+  (let ((crdt--message-string string))
+(let ((handler (gethash (car message) crdt--message-handler-table)))
+  (if handler
+  (apply handler (cdr message))
+(message "Unrecognized message %S from %s:%s."
+ message (process-contact crdt--process :host) 
(process-contact crdt--process :service))
+(signal 'crdt-unrecognized-message nil)
+
+(defsubst crdt-process-message-1 (message)
+  (crdt-proces

[elpa] externals/crdt d7bc982 12/18: update README

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit d7bc98285437bdb482357308acafbddd93920d2f
Author: Qiantan Hong 
Commit: Qiantan Hong 

update README
---
 README.org | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 9a4e68f..733173e 100644
--- a/README.org
+++ b/README.org
@@ -6,8 +6,9 @@ Highlights:
 - [[https://en.wikipedia.org/wiki/Conflict-free_replicated_data_type][CRDT]], 
darling child of collaborative editing researches...
 - Share multiple buffer in one session
 - See other users' cursor and region
-- (experimental) synchronize Org mode folding status
-- Should work with all of Org mode. (If not please submit an issue)
+- Synchronize Org mode folding status
+- Org mode integration
+- Comint derivatives integration (experimental)
 
 * Usage
 
@@ -81,6 +82,7 @@ GatewayPorts yes
 In a CRDT shared buffer (either server or client), =M-x crdt-list-users=.
 
 In the displayed user list, press ~RET~ on an entry to goto that user's cursor 
position.
+Press ~f~ to follow that user, and press ~f~ again or =M-x crdt-stop-follow= 
to stop following.
 
 ** List all sessions, and buffer in current session
 



[elpa] externals/crdt c1378c5 18/18: Merge branch 'development'

2021-09-09 Thread ELPA Syncer
branch: externals/crdt
commit c1378c5e23e4ad8fe22860be805d918d1dec3a86
Merge: 4797413 b11bbc0
Author: Qiantan Hong 
Commit: Qiantan Hong 

Merge branch 'development'
---
 HACKING.org |  170 +++-
 README.org  |   13 +-
 crdt.el | 1312 ++-
 3 files changed, 1117 insertions(+), 378 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index e066ddb..57fde18 100644
--- a/HACKING.org
+++ b/HACKING.org
@@ -5,8 +5,12 @@ Background reading: 
[[https://en.wikipedia.org/wiki/Conflict-free_replicated_dat
 This packages implements the Logoot split algorithm
 ~André, Luc, et al. "Supporting adaptable granularity of changes for 
massive-scale collaborative editing." 9th IEEE International Conference on 
Collaborative Computing: Networking, Applications and Worksharing. IEEE, 2013.~
 
-The CRDT-ID blocks are implemented by text property ='crdt-id=. A continous 
range of text with the same ='crdt-id'= property represent a CRDT-ID block. The 
='crdt-id= is a a cons of =(ID-STRING . END-OF-BLOCK-P)=, where
-=ID-STRING= represent the CRDT-ID of the leftmost character in the block. If 
=END-OF-BLOCK-P= is =NIL=, the block is a non-rightmost segment splitted from a 
larger block, so insertion at the right of this block shouldn't be merged into 
the block by sharing the base CRDT-ID and increasing offset.
+The CRDT-ID blocks are implemented by text property ='crdt-id=. 
+A continous range of text with the same ='crdt-id'= property represent a 
CRDT-ID block. 
+The ='crdt-id= is a a cons of =(ID-STRING . END-OF-BLOCK-P)=, 
+where =ID-STRING= represent the CRDT-ID of the leftmost character in the block.
+If =END-OF-BLOCK-P= is =NIL=, the block is a non-rightmost segment splitted 
from a larger block,
+so insertion at the right of this block shouldn't be merged into the block by 
sharing the base CRDT-ID and increasing offset.
 
 =ID-STRING= is a unibyte string representing a CRDT-ID (for efficient 
comparison).
 Every two bytes represent a big endian encoded integer.
@@ -30,7 +34,8 @@ and second last two bytes represent site ID.
   - =content= is the string to be inserted
 
 + delete ::
-  body takes the form =(buffer-name position-hint (crdt-id . length)*)=
+  body takes the form =(buffer-name position-hint . crdt-id-list)=
+  - =crdt-id-list= is generated from =CRDT--DUMP-IDS= from the deleted text
 
   - Peer State
 + cursor ::
@@ -130,6 +135,40 @@ and second last two bytes represent site ID.
 + overlay-remove ::
   body takes the form =(buffer-name site-id logical-clock)=
 
+  - Remote Command
++ command ::
+  body takes the form
+  #+BEGIN_SRC
+  (buffer-name spawn-site-id
+   site-id logical-clock state-list
+   command-symbol . args)
+  #+END_SRC
+   - =spawn-site-id= represents the site where the interactive command is 
originally invoked
+ + It can be different from =site-id= because a remote command can 
call a remote command!
+   This is especially useful when client makes a remote call, 
+   but the call on the server request some interactive input,
+   and such interactive call are remote-called back into the client.
+   - =state-list= is an alist of bindings.
+(except that we use 1 element list for the CDRs, to save a dot in the 
serialized string)
+(CDRs can also be 2 element list of the form =(crdt-id pos-hint)=)
+Allowed symbols are 
+#+BEGIN_SRC
+point mark mark-active transient-mark-mode last-command-event
+#+END_SRC
+
++ return ::
+  body takes the form =(site-id logical-clock state-list success-p . 
return-values)=
+
+  - Buffer local variables
++ var :: body takes the form =(buffer-name variable-symbol . args)=
+  =args= is passed to the variable receiver =(get variable-symbol 
'crdt-variable-receiver)=
+  to calculate an updated value.
+  The actual format of =args= depends on the variable sender and receiver 
+  (which supposed implement some CRDT).
+
+  All peer must make sure they install the same kind of variable sender 
and receiver
+  for =variable-symbol=.
+
   - Remote Buffer Process
 + process ::
   body takes the form =(buffer-name string)=
@@ -152,15 +191,132 @@ By implementing synchronization primitives for all 
components in a buffer,
 pretty much everything can be made collaborative.
 Synchronize arbitrary buffer-local-variable reasonably is hard, but user 
annotations can help.
 
-** TODO list
+** How to implement collaboration support for a package
+
+~crdt.el~ provides two sets of facilities for adding collaboration support, a 
command-based one and a state-based one. 
+Package hackers are free to combine them to provide desired behavior.
+
+*** Command-based collaboration
+
+This is a simple method to add collaboration support. 
+After registering a command with =crdt-register-remote-command=, 
+an =:around= advice is added such th

[elpa] main 6d8c396: * elpa-packages (vc-got): Add package

2021-09-09 Thread Philip Kaludercic
branch: main
commit 6d8c39676e004c33c6c8caa1f8ca4b95a02d8baf
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

* elpa-packages (vc-got): Add package
---
 elpa-packages | 4 
 1 file changed, 4 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index 69dd6e3..18be905 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -397,6 +397,10 @@
  ("url-http-ntlm"  :url nil)
  ("validate"   :url "https://github.com/Malabarba/validate.el";)
  ("valign" :url "https://github.com/casouri/valign";)
+ ("vc-got" :url "https://git.omarpolo.com/vc-got";
+  ;; Mirror: https://github.com/omar-polo/vc-got/
+  :ignored-files ("targets")
+  :auto-sync t)
  ("vc-hgcmd"   :url "https://github.com/muffinmad/emacs-vc-hgcmd";
   :auto-sync t)
  ("vc-backup"  :url "https://git.sr.ht/~pkal/vc-backup";



[elpa] externals/vc-got f6e414a 003/145: typo

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit f6e414a6f4f628dd1f935d30165880abaed1d847
Author: Omar Polo 
Commit: Omar Polo 

typo
---
 vc-got.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index ab672dc..553917a 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -81,8 +81,8 @@
 
 (defun vc-got-root (file)
   "Return the work tree root for FILE, or nil."
-  (or (vc-file-getprop file 'git-root)
-  (vc-file-setprop file 'git-root (vc-find-root file ".got"
+  (or (vc-file-getprop file 'got-root)
+  (vc-file-setprop file 'got-root (vc-find-root file ".got"
 
 (defmacro vc-got-with-worktree (file &rest body)
   "Evaluate BODY in the work tree directory of FILE."



[elpa] externals/vc-got 23a0b46 002/145: implemented some state-changing functions

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 23a0b465c39b4a1717ef71fc45bb57d7edca358e
Author: Omar Polo 
Commit: Omar Polo 

implemented some state-changing functions

vc-got-create-repo is un-implemented: should we run got init?
---
 vc-got.el | 79 +--
 1 file changed, 77 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 89c6e9b..ab672dc 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -46,6 +46,19 @@
 ;; * working-revision   DONE
 ;; * checkout-model DONE
 ;; - mode-line-string   NOT IMPLEMENTED
+;;
+;; STATE-CHANGING FUNCTIONS:
+;; * create-repoNOT IMPLEMENTED
+;;   I don't think got init does
+;;   what this function is supposed
+;;   to do.
+;; * register   DONE
+;; - responsible-p  DONE
+;; - receive-file   NOT IMPLEMENTED
+;; - unregister NOT IMPLEMENTED
+;;   use remove?
+;; * checkinDONE
+;; * find-revision  DONE
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)
@@ -59,6 +72,7 @@
 
 (require 'cl-lib)
 (require 'seq)
+(require 'vc)
 
 (defvar vc-got-cmd "got"
   "The got command.")
@@ -80,10 +94,20 @@
   "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output 
in the current buffer."
   (apply #'process-file vc-got-cmd nil (current-buffer) nil args))
 
+(defun vc-got--add (files)
+  "Add FILES to got, passing `vc-register-switches' to the command invocation."
+  (with-temp-buffer
+(apply #'vc-got--call "add" (append vc-register-switches files
+
 (defun vc-got--log (limit path)
-  "Execute the log command in the worktree of PATH, with LIMIT commits, and 
put the output in the current buffer.
+  "Execute the log command in the worktree of PATH.
+
+The output of the command will be put in the current-buffer.
+
+LIMIT limits the maximum number of commit returned.
 
-Return nil if the command failed or if PATH isn't included in any worktree."
+Return nil if the command failed or if PATH isn't included in any
+worktree."
   (vc-got-with-worktree path
 (zerop (vc-got--call "log" "-l" (format "%s" limit) path
 
@@ -125,6 +149,33 @@ DIR-OR-FILE."
collect (cl-destructuring-bind (status file) (split-string line " " 
t " ")
  `(,file . ,(vc-got--parse-status-flag status)
 
+(defun vc-got--tree-parse ()
+  "Parse into an alist the output of got tree -i in the current buffer."
+  (goto-char (point-min))
+  (cl-loop
+   until (= (point) (point-max))
+   collect (let* ((obj-start (point))
+  (_ (forward-word))
+  (obj (buffer-substring obj-start (point)))
+  (_ (forward-char)) ;skip the space
+  (filename-start (point))
+  (_ (move-end-of-line nil))
+  (filename (buffer-substring filename-start (point
+ ;; goto the start of the next line
+ (forward-line)
+ (move-beginning-of-line nil)
+ `(,filename . ,obj
+
+(defun vc-got--tree (commit path)
+  (vc-got-with-worktree path
+(with-temp-buffer
+  (vc-got--call "tree" "-c" commit "-i" path)
+  (vc-got--tree-parse
+
+(defun vc-got--cat (commit obj-id)
+  "Execute got cat -c COMMIT OBJ-ID in the current buffer."
+  (vc-got--call "cat" "-c" commit obj-id))
+
 
 ;; Backend properties
 
@@ -224,5 +275,29 @@ Return \"0\" for a file added but not yet committed."
 (defun vc-got-checkout-model (_files)
   'implicit)
 
+
+;; state-changing functions
+
+(defun vc-got-create-repo (_backend)
+  (error "vc got: create-repo not implemented"))
+
+(defun vc-got-register (files &optional _comment)
+  "Register FILES, passing `vc-register-switches' to the backend command."
+  (vc-got--add files))
+
+(defun vc-got-responsible-p (file)
+  (vc-find-root file ".got"))
+
+(defun vc-got-checkin (files comment &optional _rev)
+  "Commit FILES with COMMENT as commit message."
+  (with-temp-buffer
+(apply #'vc-got--call "commit" "-m" comment files)))
+
+(defun vc-got-find-revision (file rev buffer)
+  (when-let (obj-id (assoc file (vc-got--tree rev file) #'string=))
+(with-current-buffer buffer
+  (vc-got-with-worktree file
+(vc-got--cat rev obj-id)
+
 (provide 'vc-got)
 ;;; vc-got.el ends here



[elpa] externals/vc-got 9e805da 004/145: defalias vc-got-responsible-p to vc-got-root

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 9e805da80d3097d153cb3b73bf4f5f4341a3aad9
Author: Omar Polo 
Commit: Omar Polo 

defalias vc-got-responsible-p to vc-got-root

they had the same output, only two slightly different implementation,
and vc-got-root should be faster.
---
 vc-got.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 553917a..2d2fcfe 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -285,8 +285,7 @@ Return \"0\" for a file added but not yet committed."
   "Register FILES, passing `vc-register-switches' to the backend command."
   (vc-got--add files))
 
-(defun vc-got-responsible-p (file)
-  (vc-find-root file ".got"))
+(defalias 'vc-got-responsible-p #'vc-got-root)
 
 (defun vc-got-checkin (files comment &optional _rev)
   "Commit FILES with COMMENT as commit message."



[elpa] externals/vc-got af5ef7c 001/145: initial commit

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit af5ef7cdaa903853a7c4ec598ecfd78a354513d3
Author: Omar Polo 
Commit: Omar Polo 

initial commit

All the ``BACKEND PROPERTIES'' and ``STATE-QUERYING FUNCTIONS''
functions are implemented.  Why don't we start using them while
developing the rest? :)
---
 vc-got.el | 228 ++
 1 file changed, 228 insertions(+)

diff --git a/vc-got.el b/vc-got.el
new file mode 100644
index 000..89c6e9b
--- /dev/null
+++ b/vc-got.el
@@ -0,0 +1,228 @@
+;; vc-got.el --- Game of Tree backend for VC -*- lexical-binding: t; -*-
+
+;; Copyright © 2020 Omar Polo 
+
+;; This file is not part of GNU Emacs.
+
+;; This file is free software.
+;;
+;; Permission to use, copy, modify, and distribute this software for
+;; any purpose with or without fee is hereby granted, provided that
+;; the above copyright notice and this permission notice appear in all
+;; copies.
+;;
+;; THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+;; WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+;; WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+;; AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
+;; CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+;; OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+;; NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+;; CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+;; Author: Omar Polo 
+;; URL: https://git.omarpolo.com/vc-got
+;; Keywords: vc vc-backend
+
+;;; Commentary
+
+;; Backend implementation status
+;;
+;; Function marked with `*' are required, those with `-' are optional.
+;;
+;; FUNCTION NAMESTATUS
+;;
+;; BACKEND PROPERTIES:
+;; * revision-granularity   DONE
+;; - update-on-retrieve-tag XXX: what should this do?
+;;
+;; STATE-QUERYING FUNCTIONS:
+;; * registered DONE
+;; * state  DONE
+;; - dir-status-files   DONE
+;; - dir-extra-headers  NOT IMPLEMENTED
+;; - dir-printerNOT IMPLEMENTED
+;; - status-fileinfo-extra  NOT IMPLEMENTED
+;; * working-revision   DONE
+;; * checkout-model DONE
+;; - mode-line-string   NOT IMPLEMENTED
+
+;; TODO: use the idiom
+;;  (let (process-file-side-effects) ...)
+;; when the got command WON'T change the file.  This can enable some
+;; emacs optimizations
+
+;;; Code:
+
+(eval-when-compile
+  (require 'subr-x))
+
+(require 'cl-lib)
+(require 'seq)
+
+(defvar vc-got-cmd "got"
+  "The got command.")
+
+;; helpers
+
+(defun vc-got-root (file)
+  "Return the work tree root for FILE, or nil."
+  (or (vc-file-getprop file 'git-root)
+  (vc-file-setprop file 'git-root (vc-find-root file ".got"
+
+(defmacro vc-got-with-worktree (file &rest body)
+  "Evaluate BODY in the work tree directory of FILE."
+  (declare (indent defun))
+  `(when-let (default-directory (vc-got-root ,file))
+ ,@body))
+
+(defun vc-got--call (&rest args)
+  "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output 
in the current buffer."
+  (apply #'process-file vc-got-cmd nil (current-buffer) nil args))
+
+(defun vc-got--log (limit path)
+  "Execute the log command in the worktree of PATH, with LIMIT commits, and 
put the output in the current buffer.
+
+Return nil if the command failed or if PATH isn't included in any worktree."
+  (vc-got-with-worktree path
+(zerop (vc-got--call "log" "-l" (format "%s" limit) path
+
+(defun vc-got--status (dir-or-file &rest files)
+  "Return the output of ``got status''.
+
+DIR-OR-FILE can be either a directory or a file.  If FILES is
+given, return the status of those files, otherwise the status of
+DIR-OR-FILE."
+  (vc-got-with-worktree dir-or-file
+(with-temp-buffer
+  (if files
+  (apply #'vc-got--call "status" files)
+(vc-got--call "status" dir-or-file))
+  (buffer-string
+
+(defun vc-got--parse-status-flag (flag)
+  "Parse FLAG, see `vc-state'."
+  ;; got outputs nothing if the file is up-to-date
+  (if (string-empty-p flag)
+  'up-to-date
+;; trying to follow the order of the manpage
+(cl-case (aref flag 0)
+  (?M 'edited)
+  (?A 'added)
+  (?D 'removed)
+  (?C 'conflict)
+  (?! 'missing)
+  (?~ 'edited) ;XXX: what does it means for a file to be ``obstructed''?
+  (?? 'unregistered)
+  (?m 'edited) ;modified file modes
+  (?N nil
+
+(defun vc-got--parse-status (output)
+  "Parse the OUTPUT of got status and return an alist of (FILE . STATUS)."
+  ;; XXX: the output of got is line-oriented and will break if
+  ;; filenames contains spaces or newlines.
+  (cl-loop for line in (split-string output "\n" t)
+   collect (cl-destructuring-bind (status file) (split-string line " " 
t " ")
+ `(,file . ,(vc

[elpa] externals/vc-got 009222a 006/145: add licence

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 009222a2a8e200f526107d50f54a553aad4e185d
Author: Omar Polo 
Commit: Omar Polo 

add licence
---
 LICENCE | 13 +
 1 file changed, 13 insertions(+)

diff --git a/LICENCE b/LICENCE
new file mode 100644
index 000..3e3d9ff
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,13 @@
+ Copyright (c) 2020 Omar Polo 
+ 
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.



[elpa] branch externals/vc-got created (now 8fc127f)

2021-09-09 Thread ELPA Syncer
elpasync pushed a change to branch externals/vc-got.

at  8fc127f   bump version

This branch includes the following new commits:

   new  af5ef7c   initial commit
   new  23a0b46   implemented some state-changing functions
   new  f6e414a   typo
   new  9e805da   defalias vc-got-responsible-p to vc-got-root
   new  5682e01   add .gitignore
   new  009222a   add licence
   new  08ca3c5   added readme
   new  4093d2f   fix vc-got-registered
   new  c0c9a33   docs improvement
   new  518ede1   augment vc-got--log
   new  eb85ad2   implemented remaninig state-changing and some history 
functions
   new  f18d3e1   Summary: add todo to vc-got-diff
   new  4571b1f   Summary: got log expects a relative path
   new  1ca0183   Summary: fix use-package example
   new  30dcede   remove ``Summary'' from the commit
   new  35b3a91   correct also the other example
   new  694534b   implemented vc-got-mode-line-string
   new  5509116   implement vc-got-find-ignore-file
   new  d06f988   suggest to add .got to vc-directory-exclusion-list
   new  345290b   improve vc-got–diff and vc-got-diff
   new  52a1813   add-to-list is better at strings than cl-pushnew
   new  a8466f0   implement dir-extra-headers
   new  45b0e76   typo in vc-got-pull
   new  f457868   typo
   new  9ad1eb5   implemented vc-got-log-outgoing
   new  686eac9   implemented vc-got-push
   new  ba12390   adding vc-got-stage
   new  f2e1ddb   document vc-got-stage-mode
   new  a5e9be3   fix table
   new  cdd3e16   use vc-find-root instead of vc-got-root
   new  06d4d37   add Makefile
   new  21914ca   apply-impl should not be interactive
   new  5dec261   kill got stage/unstage buffer after utilisation and 
introduce unstage-all
   new  12ca62f   implement vc-got-diff-switches
   new  6eda2f1   vc-got-log-incoming
   new  b34e96f   Emacs upstream has fixed the documentation, comment not 
needed
   new  406d7b4   switch to GPLv3
   new  986bd9a   fix diff on multiple files
   new  0e25fbe   expand the vc function status list
   new  df20ca2   add vc-got--program-version command to return version 
number
   new  d54ceb8   make got program be customizable
   new  7c257a7   Merge pull request #1 from 
zmyrgel/feature/expand-implementation-status
   new  febb894   Add new customization group `vc-got' under vc
   new  e79563b   make got program customizable
   new  f09d635   Merge pull request #2 from 
zmyrgel/feature/add-version-command
   new  0a66694   vc-got--log: add flag for reverse and mark as no side 
effects
   new  a5c1731   drop vc-got-stage
   new  a2474a4   improve vc-got-dir-status-files
   new  8da4c01   remove debugging comments
   new  8228942   fix vc-got-dir-status-files
   new  3f25d9f   add vc-got-annotate  (#4)
   new  fab791a   vc-got--call flatten and filter arg list
   new  7bb16f7   implement conflicted-files
   new  8b635a9   implement repository-url
   new  c27df03   print more info in vc-got-dir-extra-headers
   new  a96df0e   provide unregister and delete-file commands (#7)
   new  ddc59a0   remove extra parens from vc-got-unregister and fix pcase 
matchall
   new  3cdb075   update status list a bit
   new  3d2d3c3   drop vc-got-unregister, not used
   new  f8a9db5   fix vc-got-repository-url for checkout of non-bare repos
   new  7a5ead6   vc-got-repository-url: avoid infinite loops in parsing
   new  8ed796d   vc-got-dir-status-files: show changes in subdirs
   new  43c93a8   typo
   new  6b6c8a7   fundamentals for staging changes
   new  eacbf76   don't hardcode got questions
   new  daae979   implement vc-got-stage-commit to commit staged changes
   new  ffa81a1   typo
   new  668dc8e   vc-got--status: handle stage info and filter result
   new  5b4a6b9   more docs
   new  cf4e3eb   fix vc-got-dir-status-files
   new  a323f60   show list of files when committing staged stuff
   new  0d57aba   remove the separator when showing a chunk to stage
   new  93562d9   fix default directory during stage operation
   new  2d83de2   implement vc-got-dir-printer
   new  6eea6cf   drop unnecessary `:group's directive in defcustom
   new  67332ba   docs fixes
   new  c819459   trap c-g during stage operation
   new  9e01941   improve vc-dir presentation & document vc-got-stage in 
README
   new  aea   list also staged addition/removals
   new  b2721e8   set status to 'staged if a file has all its modification 
staged
   new  6f42ede   don't create temp buffers for nothing
   new  76d978f   minor tweaks
   new  dcb5b83   extract the filtering to its own function
   new  d346ca6   ignore ignored files
   new  cb97383   ignore ignored files but not up-to-date ones
   new  2b7241a   revamp readme
  

[elpa] externals/vc-got 5682e01 005/145: add .gitignore

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 5682e01d7d31fd1b4afbecaba8325209bba887ba
Author: Omar Polo 
Commit: Omar Polo 

add .gitignore
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..c531d98
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.elc



[elpa] externals/vc-got 08ca3c5 007/145: added readme

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 08ca3c539568a65b073345fdb584ceb40920dfa1
Author: Omar Polo 
Commit: Omar Polo 

added readme
---
 README.md | 24 
 1 file changed, 24 insertions(+)

diff --git a/README.md b/README.md
new file mode 100644
index 000..ddf86cc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,24 @@
+# vc-got
+
+This is an **experimental** Emacs VC back-end for the [Game of
+Tree](http://gameoftrees.org/) version control system.
+
+Use it at your own risk.
+
+--
+
+To start using it, you need to add `Got` to `vc-handled-backends` and
+make sure that `vc-got` is within your `load-path`.  You shouldn't
+require the library.
+
+```emacs-lisp
+(push 'Got vc-handled-backends)
+```
+
+With `use-package` something like this should be enough:
+
+```emacs-lisp
+(use-package vc-got
+  :load-path "/path/to/vc-got/"
+  :init (push 'Got vc-handled-backends))
+```



[elpa] externals/vc-got c0c9a33 009/145: docs improvement

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit c0c9a33974fac7981ecdcf4ea709d269a25c930e
Author: Omar Polo 
Commit: Omar Polo 

docs improvement
---
 vc-got.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 33c544a..0208d51 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -248,9 +248,7 @@ DIR-OR-FILE."
 ;;  (message "got %s" res
 
 (defun vc-got-working-revision (file)
-  "Return the id of the last commit that touched the FILE.
-
-Return \"0\" for a file added but not yet committed."
+  "Return the id of the last commit that touched the FILE or \"0\" for a new 
(but added) file."
   (or
(with-temp-buffer
  (when (vc-got--log 1 file)
@@ -294,6 +292,7 @@ Return \"0\" for a file added but not yet committed."
 (apply #'vc-got--call "commit" "-m" comment files)))
 
 (defun vc-got-find-revision (file rev buffer)
+  "Fill BUFFER with the content of FILE in the given revision REV."
   (when-let (obj-id (assoc file (vc-got--tree rev file) #'string=))
 (with-current-buffer buffer
   (vc-got-with-worktree file



[elpa] externals/vc-got eb85ad2 011/145: implemented remaninig state-changing and some history functions

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit eb85ad27ab77a45a43fb1404857accd0b1392dda
Author: Omar Polo 
Commit: Omar Polo 

implemented remaninig state-changing and some history functions

`C-x v =' now works!
---
 vc-got.el | 140 --
 1 file changed, 136 insertions(+), 4 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 0c2a5a1..93b039a 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -49,22 +49,52 @@
 ;;
 ;; STATE-CHANGING FUNCTIONS:
 ;; * create-repoNOT IMPLEMENTED
-;;   I don't think got init does
-;;   what this function is supposed
-;;   to do.
+;;  I don't think got init does what this function is supposed to
+;;  do.
 ;; * register   DONE
 ;; - responsible-p  DONE
 ;; - receive-file   NOT IMPLEMENTED
 ;; - unregister NOT IMPLEMENTED
-;;   use remove?
+;;  use remove?
 ;; * checkinDONE
 ;; * find-revision  DONE
+;; * checkout   NOT IMPLEMENTED
+;;  I'm not sure how to properly implement this.  Does filling
+;;  FILE with the find-revision do the trick?  Or use got update?
+;; * revert DONE
+;; - merge-file NOT IMPLEMENTED
+;; - merge-branch   DONE
+;; - merge-news NOT IMPLEMENTED
+;; - pull   DONE
+;; - steal-lock NOT IMPLEMENTED
+;; - modify-change-comment  NOT IMPLEMENTED
+;;  can be implemented via histedit, if I understood correctly
+;;  what it is supposed to do.
+;; - mark-resolved  NOT IMPLEMENTED
+;; - find-admin-dir NOT IMPLEMENTED
+;;
+;; HISTORY FUNCTIONS
+;; * print-log  DONE
+;; * log-outgoing   NOT IMPLEMENTED
+;; * log-incoming   NOT IMPLEMENTED
+;; - log-search DONE
+;; - log-view-mode  NOT IMPLEMENTED
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)
 ;; when the got command WON'T change the file.  This can enable some
 ;; emacs optimizations
 
+;; TODO: vc-git has most function that starts with:
+;;
+;;(let* ((root (vc-git-root default-directory))
+;;   (buffer (format "*vc-git : %s*" (expand-file-name root)))
+;;   ...)
+;;  ...)
+;;
+;; we should 1) investigate if also other backends do something like
+;; this (or if there is a better way) and 2) try to do the same.
+
 ;;; Code:
 
 (eval-when-compile
@@ -187,6 +217,47 @@ DIR-OR-FILE."
   "Execute got cat -c COMMIT OBJ-ID in the current buffer."
   (vc-got--call "cat" "-c" commit obj-id))
 
+(defun vc-got--revert (&rest files)
+  "Execute got revert FILES..."
+  (vc-got-with-worktree (car files)
+(with-temp-buffer
+  (apply #'vc-got--call "revert" files
+
+(defun vc-got--list-branches ()
+  "Return an alist of (branch . commit)."
+  (with-temp-buffer
+(when (zerop (vc-got--call "branch" "-l"))
+  (goto-char (point-min))
+  (cl-loop
+   until (= (point) (point-max))
+   ;; parse the `* $branchname: $commit', from the end
+   collect (let* ((_ (move-end-of-line nil))
+  (end-commit (point))
+  (_ (backward-word))
+  (start-commit (point))
+  (_ (backward-char 2))
+  (end-branchname (point))
+  (_ (move-beginning-of-line nil))
+  (_ (forward-char 2))
+  (start-branchname (point))
+  (branchname (buffer-substring start-branchname 
end-branchname))
+  (commit (buffer-substring start-commit end-commit)))
+ (forward-line)
+ (move-beginning-of-line nil)
+ `(,branchname . ,commit))
+
+;; (vc-got-with-worktree "/usr/ports/mystuff/"
+;;   (vc-got--list-branches))
+
+(defun vc-got--integrate (branch)
+  "Integrate BRANCH into the current one."
+  (with-temp-buffer
+(vc-got--call "integrate" branch)))
+
+(defun vc-got--diff (&rest args)
+  "Call got diff with ARGS.  The result will be stored in the current buffer."
+  (apply #'vc-got--call "diff" args))
+
 
 ;; Backend properties
 
@@ -309,5 +380,66 @@ DIR-OR-FILE."
   (vc-got-with-worktree file
 (vc-got--cat rev obj-id)
 
+(defun vc-got-checkout (_file &optional _rev)
+  "Checkout revision REV of FILE.  If REV is t, checkout from the head."
+  (error "vc got: checkout not implemented"))
+
+(defun vc-got-revert (file &optional _content-done)
+  "Revert FILE back to working revision."
+  (vc-got--revert file))
+
+(defun vc-got-merge-branch ()
+  "Prompt for a branch and integrate it in

[elpa] externals/vc-got 35b3a91 016/145: correct also the other example

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 35b3a91ed720ad89b888fd5f7a717a69be58
Author: Omar Polo 
Commit: Omar Polo 

correct also the other example

push can add duplicate elements, and that’s not what we want as an
example.
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 3f62563..d2dbdb8 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ make sure that `vc-got` is within your `load-path`.  You 
shouldn't
 require the library.
 
 ```emacs-lisp
-(push 'Got vc-handled-backends)
+(cl-pushnew 'Got vc-handled-backends)
 ```
 
 With `use-package` something like this should be enough:



[elpa] externals/vc-got 4093d2f 008/145: fix vc-got-registered

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 4093d2f9a9b37cb58d2b733514812820462464f3
Author: Omar Polo 
Commit: Omar Polo 

fix vc-got-registered

before it didn't check if the file is into a got worktree.
---
 vc-got.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 2d2fcfe..33c544a 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -200,9 +200,10 @@ DIR-OR-FILE."
   "Return non-nil if FILE is registered with got."
   (if (file-directory-p file)
   nil   ;got doesn't track directories
-(let ((status (vc-got--status file)))
-  (not (or (string-prefix-p "?" status)
-   (string-prefix-p "N" status))
+(when (vc-find-root file ".got")
+  (let ((status (vc-got--status file)))
+(not (or (string-prefix-p "?" status)
+ (string-prefix-p "N" status)))
 
 ;; (vc-got-registered "/usr/ports/mystuff/net/td")
 ;; (vc-got-registered "/usr/ports/mystuff/net/td/Makefile")



[elpa] externals/vc-got 9ad1eb5 025/145: implemented vc-got-log-outgoing

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 9ad1eb5d84e342aa18e2520976253104d6103418
Author: Omar Polo 
Commit: Omar Polo 

implemented vc-got-log-outgoing

it shows an extra commit, but it's a start!
---
 vc-got.el | 19 ---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 5c03daa..3af9891 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -75,7 +75,7 @@
 ;;
 ;; HISTORY FUNCTIONS
 ;; * print-log  DONE
-;; * log-outgoing   NOT IMPLEMENTED
+;; * log-outgoing   DONE
 ;; * log-incoming   NOT IMPLEMENTED
 ;; - log-search DONE
 ;; - log-view-mode  NOT IMPLEMENTED
@@ -130,13 +130,14 @@
   (with-temp-buffer
 (apply #'vc-got--call "add" (append vc-register-switches files
 
-(defun vc-got--log (&optional path limit start-commit search-pattern)
+(defun vc-got--log (&optional path limit start-commit stop-commit 
search-pattern)
   "Execute the log command in the worktree of PATH.
 The output in the current buffer.
 
 LIMIT limits the maximum number of commit returned.
 
 START-COMMIT: start traversing history at the specified commit.
+STOP-COMMIT: stop traversing history at the specified commit.
 SEARCH-PATTERN: limit to log messages matched by the regexp given.
 
 Return nil if the command failed or if PATH isn't included in any
@@ -149,6 +150,7 @@ worktree."
(list "log"
  (when limit (list "-l" (format "%s" limit)))
  (when start-commit (list "-c" start-commit))
+ (when stop-commit (list "-x" stop-commit))
  (when search-pattern (list "-s" 
search-pattern))
  path)))
 
@@ -443,13 +445,24 @@ LIMIT limits the number of commits, optionally starting 
at START-REVISION."
   (cl-loop for file in files
do (vc-got--log (file-relative-name file) limit 
start-revision)
 
+;; XXX: this includes also the latest commit in REMOTE-LOCATION.
+(defun vc-got-log-outgoing (buffer remote-location)
+  "Fill BUFFER with the diff between the local worktree branch and 
REMOTE-LOCATION."
+  (vc-setup-buffer buffer)
+  (let ((rl (if (or (not remote-location) (string-empty-p remote-location))
+(concat "origin/" (vc-got--current-branch))
+  remote-location))
+(inhibit-read-only t))
+(with-current-buffer buffer
+  (vc-got--log nil nil nil rl
+
 ;; XXX: vc.el specify only pattern, but in reality this takes a buffer
 ;; and a pattern.
 (defun vc-got-log-search (buffer pattern)
   "Search commits for PATTERN and write the results found in BUFFER."
   (with-current-buffer buffer
 (let ((inhibit-read-only t))
-  (vc-got--log nil nil nil pattern
+  (vc-got--log nil nil nil nil pattern
 
 ;; TODO: async
 ;; TODO: we should append (vc-switches 'got 'diff) to the switches.



[elpa] externals/vc-got 1ca0183 014/145: Summary: fix use-package example

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 1ca0183c11f30079825dbc21fa58e34fed7062b0
Author: Omar Polo 
Commit: Omar Polo 

Summary: fix use-package example
---
 README.md | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index ddf86cc..3f62563 100644
--- a/README.md
+++ b/README.md
@@ -20,5 +20,6 @@ With `use-package` something like this should be enough:
 ```emacs-lisp
 (use-package vc-got
   :load-path "/path/to/vc-got/"
-  :init (push 'Got vc-handled-backends))
+  :init (cl-pushnew 'Got vc-handled-backends)
+  :defer t)
 ```



[elpa] externals/vc-got f18d3e1 012/145: Summary: add todo to vc-got-diff

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit f18d3e119d1fa4020afb3197d6795ee2329684a7
Author: Omar Polo 
Commit: Omar Polo 

Summary: add todo to vc-got-diff

by the way, this is the first commit done inside Emacs :)
---
 vc-got.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 93b039a..6d8b4b1 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -428,7 +428,8 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
 
 ;; TODO: async
 ;; TODO: we should append (vc-switches 'got 'diff) to the switches.
-;; This by default is ("-u") and causes an error.
+;;   This by default is ("-u") and causes an error.
+;; TODO: return 0 or 1
 (defun vc-got-diff (files &optional rev1 rev2 buffer _async)
   "Insert into BUFFER (or *vc-diff*) the diff for FILES from REV1 to REV2."
   (message "vc-got: debug: files is %s" files)



[elpa] externals/vc-got 30dcede 015/145: remove ``Summary'' from the commit

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 30dcedecffad644f77c4de56ad8817cd6ab02c03
Author: Omar Polo 
Commit: Omar Polo 

remove ``Summary'' from the commit

Emacs add this ``Summary: '' string.  it's quite annoying.  vc-git
doesn't seem to handle this specially, but maybe is git (the cli) that
trims it?  I need to check.  In the meantime, drop it.
---
 vc-got.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 1c0b612..860a9a2 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -371,7 +371,12 @@ DIR-OR-FILE."
 (defun vc-got-checkin (files comment &optional _rev)
   "Commit FILES with COMMENT as commit message."
   (with-temp-buffer
-(apply #'vc-got--call "commit" "-m" comment files)))
+(apply #'vc-got--call "commit" "-m"
+   ;; emacs add ``Summary:'' at the start of the commit
+   ;; message.  vc-git doesn't seem to treat this specially.
+   ;; Since it's annoying, remove it.
+   (string-remove-prefix "Summary: " comment)
+   files)))
 
 (defun vc-got-find-revision (file rev buffer)
   "Fill BUFFER with the content of FILE in the given revision REV."



[elpa] externals/vc-got 694534b 017/145: implemented vc-got-mode-line-string

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 694534b48d699ecab2e671833fdaf60e752bd29b
Author: Omar Polo 
Commit: Omar Polo 

implemented vc-got-mode-line-string
---
 vc-got.el | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 860a9a2..ced238f 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -45,7 +45,7 @@
 ;; - status-fileinfo-extra  NOT IMPLEMENTED
 ;; * working-revision   DONE
 ;; * checkout-model DONE
-;; - mode-line-string   NOT IMPLEMENTED
+;; - mode-line-string   DONE
 ;;
 ;; STATE-CHANGING FUNCTIONS:
 ;; * create-repoNOT IMPLEMENTED
@@ -246,8 +246,11 @@ DIR-OR-FILE."
  (move-beginning-of-line nil)
  `(,branchname . ,commit))
 
-;; (vc-got-with-worktree "/usr/ports/mystuff/"
-;;   (vc-got--list-branches))
+(defun vc-got--current-branch ()
+  "Return the current branch."
+  (with-temp-buffer
+(when (zerop (vc-got--call "branch"))
+  (string-trim (buffer-string) "" "\n"
 
 (defun vc-got--integrate (branch)
   "Integrate BRANCH into the current one."
@@ -356,6 +359,12 @@ DIR-OR-FILE."
 (defun vc-got-checkout-model (_files)
   'implicit)
 
+(defun vc-got-mode-line-string (file)
+  "Return the VC mode line string for FILE."
+  (vc-got-with-worktree file
+(let ((def (vc-default-mode-line-string 'Got file)))
+  (concat (substring def 0 4) (vc-got--current-branch)
+
 
 ;; state-changing functions
 



[elpa] externals/vc-got cdd3e16 030/145: use vc-find-root instead of vc-got-root

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit cdd3e167688467a987fc64453c1b7848a43cb2ab
Author: Omar Polo 
Commit: Omar Polo 

use vc-find-root instead of vc-got-root

I'm not entirely sure, but I don't want to cause cyclic dependencies
between vc-got and vc-got-stage (even thought they depend on each
others).
---
 vc-got-stage.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index ae553d2..4d7a3bf 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -93,7 +93,7 @@ Higher values means higher priority.  DON'T use negative 
numbers.")
 (defun vc-got-stage--apply-impl (script tmp-file)
   "Apply the stages using SCRIPT as script (TMP-FILE is the path)."
   (interactive "P")
-  (let* ((default-directory (vc-got-root default-directory))
+  (let* ((default-directory (vc-find-root default-directory ".got"))
  (stage-buf (get-buffer-create "*vc-got-stage*")))
 (unless (zerop (apply #'process-file "got" nil stage-buf nil "unstage"
   (mapcar #'file-relative-name vc-got-stage-fileset)))



[elpa] externals/vc-got f2e1ddb 028/145: document vc-got-stage-mode

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit f2e1ddb3b2513bc1f99687079cb609a133feac00
Author: Omar Polo 
Commit: Omar Polo 

document vc-got-stage-mode
---
 README.md | 25 +
 1 file changed, 25 insertions(+)

diff --git a/README.md b/README.md
index d872ab2..0afc79d 100644
--- a/README.md
+++ b/README.md
@@ -32,3 +32,28 @@ With `use-package` something like this should be enough:
   (add-to-list 'vc-handled-backends 'Got)
   (add-to-list 'vc-directory-exclusion-list ".got"))
 ```
+
+### vc-got-stage-mode
+
+`vc-got-stage-mode` is a minor mode to stage individual changes
+(currently you can't commit the staged changes).
+
+The Emacs VC system usually operates at a *fileset* level: i.e. it can
+commit/rollback/etc sets of file.  Yet, sometimes you may want to
+commit only individual changes (eventually from multiple files), and
+VC doesn't support this.  This is the motivation behind
+`vc-got-stage-mode`.
+
+The following keys are enabled by `vc-got-stage-mode`:
+
+| C-c g A | Applies (i.e. stage in got) the marked changes |
+| C-c g b | Go to beginning of change |
+| C-c g e | Go to end of change |
+| C-c g n | Go to next change |
+| C-c g p | Go to previous change |
+| C-c g t | Toggle mark |
+
+A change is a set of sequential line added/removed by the diff, it is
+a smaller unit than a *hunk*.
+
+The staged changes are indicated by an arrow in the left fringe.



[elpa] externals/vc-got f457868 024/145: typo

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit f457868bce7f6b22373758f652ff4e17528a8939
Author: Omar Polo 
Commit: Omar Polo 

typo
---
 vc-got.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index ca9dc01..5c03daa 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -458,7 +458,7 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
 (defun vc-got-diff (files &optional rev1 rev2 buffer _async)
   "Insert into BUFFER (or *vc-diff*) the diff for FILES from REV1 to REV2."
   (message "vc-got: debug: files is %s" files)
-  (let* ((buffer (get-buffer-create (or buffer "*vc-difff*")))
+  (let* ((buffer (get-buffer-create (or buffer "*vc-diff*")))
  (inhibit-read-only t))
 (with-current-buffer buffer
   (vc-got-with-worktree (car files)



[elpa] externals/vc-got 4571b1f 013/145: Summary: got log expects a relative path

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 4571b1fd33cbe57979e5cfe154d6f966825cf481
Author: Omar Polo 
Commit: Omar Polo 

Summary: got log expects a relative path
---
 vc-got.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 6d8b4b1..1c0b612 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -414,9 +414,9 @@ DIR-OR-FILE."
 LIMIT limits the number of commits, optionally starting at START-REVISION."
   (with-current-buffer buffer
 ;; the *vc-diff* may be read only
-(let ((inhibit-read-only))
+(let ((inhibit-read-only t))
   (cl-loop for file in files
-   do (vc-got--log file limit start-revision)
+   do (vc-got--log (file-relative-name file) limit 
start-revision)
 
 ;; XXX: vc.el specify only pattern, but in reality this takes a buffer
 ;; and a pattern.



[elpa] externals/vc-got 21914ca 032/145: apply-impl should not be interactive

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 21914ca959126b8333895482e7d23a4a00cb90d3
Author: Omar Polo 
Commit: Omar Polo 

apply-impl should not be interactive
---
 vc-got-stage.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index 4d7a3bf..4331ad5 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -92,7 +92,6 @@ Higher values means higher priority.  DON'T use negative 
numbers.")
 
 (defun vc-got-stage--apply-impl (script tmp-file)
   "Apply the stages using SCRIPT as script (TMP-FILE is the path)."
-  (interactive "P")
   (let* ((default-directory (vc-find-root default-directory ".got"))
  (stage-buf (get-buffer-create "*vc-got-stage*")))
 (unless (zerop (apply #'process-file "got" nil stage-buf nil "unstage"



[elpa] externals/vc-got 52a1813 021/145: add-to-list is better at strings than cl-pushnew

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 52a18138203332f613100afe02fdf3587b147926
Author: Omar Polo 
Commit: Omar Polo 

add-to-list is better at strings than cl-pushnew

cl-pushnew can add multiple copies of the same string to a list, and
add-to-list is also probably more idiomatic in elisp.
---
 README.md | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 84830bd..d872ab2 100644
--- a/README.md
+++ b/README.md
@@ -12,14 +12,14 @@ make sure that `vc-got` is within your `load-path`.  You 
shouldn't
 require the library.
 
 ```emacs-lisp
-(cl-pushnew 'Got vc-handled-backends)
+(add-to-list 'vc-handled-backends 'Got)
 ```
 
 It's highly recommended to add `".got"` to the list of
 `vc-directory-exclusion-list`.
 
 ```emacs-lisp
-(cl-pushnew ".got" vc-directory-exclusion-list)
+(add-to-list 'vc-directory-exclusion-list ".got")
 ```
 
 With `use-package` something like this should be enough:
@@ -29,6 +29,6 @@ With `use-package` something like this should be enough:
   :load-path "/path/to/vc-got/"
   :defer t
   :init
-  (cl-pushnew 'Got vc-handled-backends)
-  (cl-pushnew ".got" vc-directory-exclusion-list))
+  (add-to-list 'vc-handled-backends 'Got)
+  (add-to-list 'vc-directory-exclusion-list ".got"))
 ```



[elpa] externals/vc-got 345290b 020/145: improve vc-got–diff and vc-got-diff

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 345290bf80a604ab857cfdc69abb39d97302bfdf
Author: Omar Polo 
Commit: Omar Polo 

improve vc-got–diff and vc-got-diff

got expects arguments to diff to be relative to the worktree, it won’t
work with full path (even if those full paths are valid, i.e. inside a
worktree).

With this in place, we can also adjust vc-got-diff to process all the
files, and so now also vc-root-diff (C-x v D) works as intended.
---
 vc-got.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 134d469..05e3c02 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -259,7 +259,8 @@ DIR-OR-FILE."
 
 (defun vc-got--diff (&rest args)
   "Call got diff with ARGS.  The result will be stored in the current buffer."
-  (apply #'vc-got--call "diff" args))
+  (apply #'vc-got--call "diff"
+ (mapcar #'file-relative-name args)))
 
 
 ;; Backend properties
@@ -458,7 +459,7 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
   (vc-got-with-worktree (car files)
 (cond ((and (null rev1)
 (null rev2))
-   (vc-got--diff (car files)))
+   (apply #'vc-got--diff files))
   (t (error "Not implemented")))
 
 (provide 'vc-got)



[elpa] externals/vc-got 5dec261 033/145: kill got stage/unstage buffer after utilisation and introduce unstage-all

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 5dec261eef82fd84ad75a51f7060e840b01183a6
Author: Omar Polo 
Commit: Omar Polo 

kill got stage/unstage buffer after utilisation and introduce unstage-all
---
 vc-got-stage.el | 20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index 4331ad5..4560aea 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -26,6 +26,7 @@ Higher values means higher priority.  DON'T use negative 
numbers.")
 (defvar vc-got-stage-prefix-map
   (let ((map (make-sparse-keymap)))
 (define-key map (kbd "A") #'vc-got-stage-apply)
+(define-key map (kbd "U") #'vc-got-unstage-all)
 (define-key map (kbd "b") #'vc-got-stage-beginning-of-change)
 (define-key map (kbd "e") #'vc-got-stage-end-of-change)
 (define-key map (kbd "n") #'vc-got-stage-next-change)
@@ -90,14 +91,22 @@ Higher values means higher priority.  DON'T use negative 
numbers.")
   (with-current-buffer buf
 (insert "n\n")))
 
+(defun vc-got-stage-unstage-all ()
+  (interactive)
+  (let* ((default-directory (vc-find-root default-directory ".got"))
+ (unstage-buf   (get-buffer-create "*vc-got-unstage*")))
+(unless (zerop (apply #'process-file "got" nil unstage-buf nil
+  "unstage" (mapcar #'file-relative-name
+vc-got-stage-fileset)))
+  (pop-to-buffer unstage-buf)
+  (error "Got unstage failed"))
+(kill-buffer unstage-buf)))
+
 (defun vc-got-stage--apply-impl (script tmp-file)
   "Apply the stages using SCRIPT as script (TMP-FILE is the path)."
   (let* ((default-directory (vc-find-root default-directory ".got"))
  (stage-buf (get-buffer-create "*vc-got-stage*")))
-(unless (zerop (apply #'process-file "got" nil stage-buf nil "unstage"
-  (mapcar #'file-relative-name vc-got-stage-fileset)))
-  (pop-to-buffer stage-buf)
-  (error "Got unstage failed"))
+(vc-got-stage-unstage-all)
 (vc-got-stage--compute-y-or-n script)
 (with-current-buffer script
   (save-buffer))
@@ -105,7 +114,8 @@ Higher values means higher priority.  DON'T use negative 
numbers.")
   "-F" tmp-file (mapcar #'file-relative-name
 vc-got-stage-fileset)))
   (pop-to-buffer stage-buf)
-  (error "Got stage failed"
+  (error "Got stage failed"))
+(kill-buffer stage-buf)))
 
 (defun vc-got-stage-apply ()
   "Apply the stages.



[elpa] externals/vc-got 518ede1 010/145: augment vc-got--log

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 518ede14d1f7da94e0e6e1216bdce4dd33be55ca
Author: Omar Polo 
Commit: Omar Polo 

augment vc-got--log
---
 vc-got.el | 23 +--
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 0208d51..0c2a5a1 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -71,6 +71,7 @@
   (require 'subr-x))
 
 (require 'cl-lib)
+(require 'cl-seq)
 (require 'seq)
 (require 'vc)
 
@@ -99,17 +100,27 @@
   (with-temp-buffer
 (apply #'vc-got--call "add" (append vc-register-switches files
 
-(defun vc-got--log (limit path)
+(defun vc-got--log (&optional path limit start-commit search-pattern)
   "Execute the log command in the worktree of PATH.
-
-The output of the command will be put in the current-buffer.
+The output in the current buffer.
 
 LIMIT limits the maximum number of commit returned.
 
+START-COMMIT: start traversing history at the specified commit.
+SEARCH-PATTERN: limit to log messages matched by the regexp given.
+
 Return nil if the command failed or if PATH isn't included in any
 worktree."
-  (vc-got-with-worktree path
-(zerop (vc-got--call "log" "-l" (format "%s" limit) path
+  (vc-got-with-worktree (or path default-directory)
+(zerop
+ (apply #'vc-got--call
+(cl-remove-if #'null
+  (flatten-list
+   (list "log"
+ (when limit (list "-l" (format "%s" limit)))
+ (when start-commit (list "-c" start-commit))
+ (when search-pattern (list "-s" 
search-pattern))
+ path)))
 
 (defun vc-got--status (dir-or-file &rest files)
   "Return the output of ``got status''.
@@ -251,7 +262,7 @@ DIR-OR-FILE."
   "Return the id of the last commit that touched the FILE or \"0\" for a new 
(but added) file."
   (or
(with-temp-buffer
- (when (vc-got--log 1 file)
+ (when (vc-got--log file 1)
(let (start)
  (goto-char (point-min))
  (forward-line 1)   ;skip the - line



[elpa] externals/vc-got a8466f0 022/145: implement dir-extra-headers

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit a8466f02b7ba1629018f58c08c73d4fb2368c247
Author: Omar Polo 
Commit: Omar Polo 

implement dir-extra-headers

show the current branch for now
---
 vc-got.el | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
old mode 100644
new mode 100755
index 05e3c02..42a2b5d
--- a/vc-got.el
+++ b/vc-got.el
@@ -40,7 +40,7 @@
 ;; * registered DONE
 ;; * state  DONE
 ;; - dir-status-files   DONE
-;; - dir-extra-headers  NOT IMPLEMENTED
+;; - dir-extra-headers  DONE
 ;; - dir-printerNOT IMPLEMENTED
 ;; - status-fileinfo-extra  NOT IMPLEMENTED
 ;; * working-revision   DONE
@@ -333,6 +333,11 @@ DIR-OR-FILE."
 ;;   (vc-got-dir-status-files dir nil (lambda (res _t)
 ;;  (message "got %s" res
 
+(defun vc-got-dir-extra-headers (_dir)
+  (concat
+   (propertize "Branch : " 'face 'font-lock-type-face)
+   (vc-got--current-branch)))
+
 (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."
   (or



[elpa] externals/vc-got 12ca62f 034/145: implement vc-got-diff-switches

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 12ca62f2d57553ed120e902a25bd3231825de240
Author: Omar Polo 
Commit: Omar Polo 

implement vc-got-diff-switches
---
 vc-got.el | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 083718c..7182391 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -112,6 +112,14 @@
 (defvar vc-got-cmd "got"
   "The got command.")
 
+(defcustom vc-got-diff-switches t
+  "String or list of strings specifying switches for Got diff under VC.
+If nil, use the value of `vc-diff-switches'.  If t, use no switches."
+  :type '(choice (const :tag "Unspecified" nil)
+ (const :tag "None" t)
+ (string :tag "Argument String")
+ (repeat :tag "Argument List" :value ("") string)))
+
 ;; helpers
 
 (defun vc-got-root (file)
@@ -274,7 +282,8 @@ DIR-OR-FILE."
 (defun vc-got--diff (&rest args)
   "Call got diff with ARGS.  The result will be stored in the current buffer."
   (apply #'vc-got--call "diff"
- (mapcar #'file-relative-name args)))
+ (append (vc-switches 'got 'diff)
+ (mapcar #'file-relative-name args
 
 
 ;; Backend properties
@@ -489,8 +498,6 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
   (vc-got--log nil nil nil nil pattern
 
 ;; TODO: async
-;; TODO: we should append (vc-switches 'got 'diff) to the switches.
-;;   This by default is ("-u") and causes an error.
 ;; TODO: return 0 or 1
 (defun vc-got-diff (files &optional rev1 rev2 buffer _async)
   "Insert into BUFFER (or *vc-diff*) the diff for FILES from REV1 to REV2."



[elpa] externals/vc-got 45b0e76 023/145: typo in vc-got-pull

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 45b0e763644391ad8e51d50e54af026371912180
Author: Omar Polo 
Commit: Omar Polo 

typo in vc-got-pull

it still doesn't work, but at least now it invokes the correct
subcommand.
---
 vc-got.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 42a2b5d..ca9dc01 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -428,10 +428,10 @@ DIR-OR-FILE."
  (buffer (format "*vc-got : %s*" (expand-file-name root
 (when-let (cmd (if prompt
(split-string
-(read-shell-command "Got pull command: " "got pull")
+(read-shell-command "Got pull command: " "got fetch")
 " " t)
- '("got" "pull")))
-  (vc-do-command buffer 0 vc-got-cmd nil (cdr cmd)
+ '("got" "fetch")))
+  (apply #'vc-do-command buffer 0 vc-got-cmd nil (cdr cmd)
 
 (defun vc-got-print-log (files buffer &optional _shortlog start-revision limit)
   "Insert the revision log for FILES into BUFFER.



[elpa] externals/vc-got e79563b 044/145: make got program customizable

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit e79563bdabbe90721dc2532c1f97a26478108382
Merge: 7c257a7 febb894
Author: omar-polo <47739920+omar-p...@users.noreply.github.com>
Commit: GitHub 

make got program customizable
---
 vc-got.el | 19 +--
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 86c3d16..1e4b419 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -136,8 +136,14 @@
 
 (require 'vc-got-stage)
 
-(defvar vc-got-cmd "got"
-  "The got command.")
+(defgroup vc-got nil
+  "VC GoT backend."
+  :group 'vc)
+
+(defcustom vc-got-program "got"
+  "Name of the Got executable (excluding any arguments)."
+  :type 'string
+  :group 'vc-got)
 
 (defcustom vc-got-diff-switches t
   "String or list of strings specifying switches for Got diff under VC.
@@ -145,7 +151,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no 
switches."
   :type '(choice (const :tag "Unspecified" nil)
  (const :tag "None" t)
  (string :tag "Argument String")
- (repeat :tag "Argument List" :value ("") string)))
+ (repeat :tag "Argument List" :value ("") string))
+  :group 'vc-got)
 
 ;; helpers
 
@@ -169,8 +176,8 @@ Assume `default-directory' is inside a got worktree."
   (string-trim (buffer-string) nil "\n"
 
 (defun vc-got--call (&rest args)
-  "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output 
in the current buffer."
-  (apply #'process-file vc-got-cmd nil (current-buffer) nil args))
+  "Call `vc-got-program' in the `default-directory' with ARGS and put the 
output in the current buffer."
+  (apply #'process-file vc-got-program nil (current-buffer) nil args))
 
 (defun vc-got--add (files)
   "Add FILES to got, passing `vc-register-switches' to the command invocation."
@@ -486,7 +493,7 @@ ROOT is the worktree root."
 
 (defun vc-got-pull (prompt)
   "Execute got pull, prompting the user for the full command if PROMPT is not 
nil."
-  (vc-got--push-pull vc-got-cmd "fetch" prompt (vc-got-root 
default-directory)))
+  (vc-got--push-pull vc-got-program "fetch" prompt (vc-got-root 
default-directory)))
 
 (defun vc-got-push (prompt)
   "Run git push (not got!) in the repository dir.



[elpa] externals/vc-got 6eda2f1 035/145: vc-got-log-incoming

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 6eda2f1f013325ef2ba8a49de9b6ed701c166fe9
Author: Omar Polo 
Commit: Omar Polo 

vc-got-log-incoming
---
 vc-got.el | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 7182391..2eb93c5 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -78,9 +78,12 @@
 ;; HISTORY FUNCTIONS
 ;; * print-log  DONE
 ;; * log-outgoing   DONE
-;; * log-incoming   NOT IMPLEMENTED
+;; * log-incoming   DONE
 ;; - log-search DONE
 ;; - log-view-mode  NOT IMPLEMENTED
+;; - show-log-entry NOT IMPLEMENTED
+;; - comment-historyNOT IMPLEMENTED
+;; - update-changelog   NOT IMPLEMENTED
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)
@@ -489,6 +492,15 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
 (with-current-buffer buffer
   (vc-got--log nil nil nil rl
 
+(defun vc-got-incoming (buffer remote-location)
+  "Fill BUFFER with the diff between the REMOTE-LOCATION and the local 
worktree branch."
+  (let ((rl (if (or (not remote-location) (string-empty-p remote-location))
+(concat "origin/" (vc-got--current-branch))
+  remote-location))
+(inhibit-read-only t))
+(with-current-buffer buffer
+  (vc-got--log nil nil (vc-got--current-branch) rl
+
 ;; XXX: vc.el specify only pattern, but in reality this takes a buffer
 ;; and a pattern.
 (defun vc-got-log-search (buffer pattern)



[elpa] externals/vc-got 686eac9 026/145: implemented vc-got-push

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 686eac9a1fae366933598d31881b2684f69dbeaa
Author: Omar Polo 
Commit: Omar Polo 

implemented vc-got-push
---
 vc-got.el | 36 +---
 1 file changed, 29 insertions(+), 7 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 3af9891..32c1b2a 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -66,6 +66,8 @@
 ;; - merge-branch   DONE
 ;; - merge-news NOT IMPLEMENTED
 ;; - pull   DONE
+;; - push   DONE
+;;  uses git
 ;; - steal-lock NOT IMPLEMENTED
 ;; - modify-change-comment  NOT IMPLEMENTED
 ;;  can be implemented via histedit, if I understood correctly
@@ -121,6 +123,14 @@
   `(when-let (default-directory (vc-got-root ,file))
  ,@body))
 
+(defun vc-got--repo-root ()
+  "Return the path to the repository root.
+Assume `default-directory' is inside a got worktree."
+  (vc-got-with-worktree default-directory
+(with-temp-buffer
+  (insert-file-contents ".got/repository")
+  (string-trim (buffer-string) nil "\n"
+
 (defun vc-got--call (&rest args)
   "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output 
in the current buffer."
   (apply #'process-file vc-got-cmd nil (current-buffer) nil args))
@@ -424,16 +434,28 @@ DIR-OR-FILE."
 (when branch
   (vc-got--integrate branch
 
-(defun vc-got-pull (prompt)
-  "Execute got pull, prompting the user for the full command if PROMPT is not 
nil."
-  (let* ((root (vc-got-root default-directory))
- (buffer (format "*vc-got : %s*" (expand-file-name root
+(defun vc-got--push-pull (cmd op prompt root)
+  "Execute CMD OP, or prompt the user if PROMPT is non-nil.
+ROOT is the worktree root."
+  (let ((buffer (format "*vc-got : %s*" (expand-file-name root
 (when-let (cmd (if prompt
(split-string
-(read-shell-command "Got pull command: " "got fetch")
+(read-shell-command (format "%s %s command: " cmd op)
+(format "%s %s" cmd op))
 " " t)
- '("got" "fetch")))
-  (apply #'vc-do-command buffer 0 vc-got-cmd nil (cdr cmd)
+ (list cmd op)))
+  (apply #'vc-do-command buffer 0 (car cmd) nil (cdr cmd)
+
+(defun vc-got-pull (prompt)
+  "Execute got pull, prompting the user for the full command if PROMPT is not 
nil."
+  (vc-got--push-pull vc-got-cmd "fetch" prompt (vc-got-root 
default-directory)))
+
+(defun vc-got-push (prompt)
+  "Run git push (not got!) in the repository dir.
+If PROMPT is non-nil, prompt for the git command to run."
+  (let* ((root (vc-got-root default-directory))
+ (default-directory (vc-got--repo-root)))
+(vc-got--push-pull "git" "push" prompt root)))
 
 (defun vc-got-print-log (files buffer &optional _shortlog start-revision limit)
   "Insert the revision log for FILES into BUFFER.



[elpa] externals/vc-got 406d7b4 037/145: switch to GPLv3

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 406d7b4d0d3443ace9ec9f938296041977d918eb
Author: Omar Polo 
Commit: Omar Polo 

switch to GPLv3

and while here adjust slightly the comment headers.
---
 LICENCE | 687 +++-
 vc-got-stage.el |  15 +-
 vc-got.el   |  38 ++--
 3 files changed, 705 insertions(+), 35 deletions(-)

diff --git a/LICENCE b/LICENCE
index 3e3d9ff..4432540 100644
--- a/LICENCE
+++ b/LICENCE
@@ -1,13 +1,676 @@
- Copyright (c) 2020 Omar Polo 
+
+   GNU GENERAL PUBLIC LICENSE
+  Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+   Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+  TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
  
- Permission to use, copy, modify, and distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
- 
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESU

[elpa] externals/vc-got 5509116 018/145: implement vc-got-find-ignore-file

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 55091167c3506eda81107b6315018b82cb8a75eb
Author: Omar Polo 
Commit: Omar Polo 

implement vc-got-find-ignore-file

This is optional, but with this in place `project-find-file' works as
intended.  Also, should we support also .cvsignore?
---
 vc-got.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/vc-got.el b/vc-got.el
index ced238f..134d469 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -394,6 +394,11 @@ DIR-OR-FILE."
   (vc-got-with-worktree file
 (vc-got--cat rev obj-id)
 
+(defun vc-got-find-ignore-file (file)
+  "Return the gitignore file that controls FILE."
+  (expand-file-name ".gitignore"
+(vc-got-root file)))
+
 (defun vc-got-checkout (_file &optional _rev)
   "Checkout revision REV of FILE.  If REV is t, checkout from the head."
   (error "vc got: checkout not implemented"))



[elpa] externals/vc-got 8da4c01 049/145: remove debugging comments

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 8da4c01ab1701f49af2bb11b89698b2b3f839f1b
Author: Omar Polo 
Commit: Omar Polo 

remove debugging comments
---
 vc-got.el | 19 ---
 1 file changed, 19 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index bbbf7a1..c36a3ac 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -356,21 +356,11 @@ DIR-OR-FILE."
 (not (or (string-prefix-p "?" status)
  (string-prefix-p "N" status)))
 
-;; (vc-got-registered "/usr/ports/mystuff/net/td")
-;; (vc-got-registered "/usr/ports/mystuff/net/td/Makefile")
-;; (vc-got-registered "/usr/ports/mystuff/tmp")
-;; (vc-got-registered "/usr/ports/mystuff/no-existant")
-
 (defun vc-got-state (file)
   "Return the current version control state of FILE.  See `vc-state'."
   (unless (file-directory-p file)
 (vc-got--parse-status-flag (vc-got--status file
 
-;; (vc-got-state "/usr/ports/mystuff/net/td")
-;; (vc-got-state "/usr/ports/mystuff/net/td/Makefile")
-;; (vc-got-state "/usr/ports/mystuff/tmp")
-;; (vc-got-state "/usr/ports/mystuff/non-existant")
-
 (defun vc-got-dir-status-files (dir files update-function)
   (let ((fs (seq-filter (lambda (file)
   (and (not (string= file ".."))
@@ -388,10 +378,6 @@ DIR-OR-FILE."
   result))
  finally (funcall update-function result nil
 
-;; (let ((dir "/usr/ports/mystuff"))
-;;   (vc-got-dir-status-files dir nil (lambda (res _t)
-;;  (message "got %s" res
-
 (defun vc-got-dir-extra-headers (_dir)
   (concat
(propertize "Branch : " 'face 'font-lock-type-face)
@@ -416,11 +402,6 @@ DIR-OR-FILE."
(when (eq (vc-got-state file) 'added)
  "0")))
 
-;; (vc-got-working-revision "/usr/ports/mystuff/non-existant")
-;; (vc-got-working-revision "/usr/ports/mystuff/CVS")
-;; (vc-got-working-revision "/usr/ports/mystuff/tmp")
-;; (vc-got-working-revision "/usr/ports/mystuff/net/td/Makefile")
-
 (defun vc-got-checkout-model (_files)
   'implicit)
 



[elpa] externals/vc-got 0e25fbe 039/145: expand the vc function status list

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 0e25fbe82c06c1ddbdbed273e77f9391eb6220f2
Author: Timo Myyrä 
Commit: Timo Myyrä 

expand the vc function status list

Add full list of vc functions which should be implemented. It is easier
to track progress as all functions are in same list.
---
 vc-got.el | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/vc-got.el b/vc-got.el
index 6b0b0c0..86c3d16 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -78,6 +78,36 @@
 ;; - show-log-entry NOT IMPLEMENTED
 ;; - comment-historyNOT IMPLEMENTED
 ;; - update-changelog   NOT IMPLEMENTED
+;; * diff   DONE
+;; - revision-completion-table  NOT IMPLEMENTED
+;; - annotate-command   NOT IMPLEMENTED
+;; - annotate-time  NOT IMPLEMENTED
+;; - annotate-current-time  NOT IMPLEMENTED
+;; - annotate-extract-revision-at-line  NOT IMPLEMENTED
+;; - region-history NOT IMPLEMENTED
+;; - region-history-modeNOT IMPLEMENTED
+;; - mergebase  NOT IMPLEMENTED
+;;
+;; TAG SYSTEM
+;; - create-tag NOT IMPLEMENTED
+;; - retrieve-tag   NOT IMPLEMENTED
+;;
+;; MISCELLANEOUSNOT IMPLEMENTED
+;; - make-version-backups-p NOT IMPLEMENTED
+;; - root   DONE
+;; - ignore NOT IMPLEMENTED
+;; - ignore-completion-tableNOT IMPLEMENTED
+;; - previous-revision  NOT IMPLEMENTED
+;; - next-revision  NOT IMPLEMENTED
+;; - log-edit-mode  NOT IMPLEMENTED
+;; - check-headers  NOT IMPLEMENTED
+;; - delete-fileNOT IMPLEMENTED
+;; - rename-fileNOT IMPLEMENTED
+;; - find-file-hook NOT IMPLEMENTED
+;; - extra-menu NOT IMPLEMENTED
+;; - extra-dir-menu NOT IMPLEMENTED
+;; - conflicted-files   NOT IMPLEMENTED
+;; - repository-url NOT IMPLEMENTED
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)



[elpa] externals/vc-got ba12390 027/145: adding vc-got-stage

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit ba123905bee33e736ce9f4e97bf5f3e714a7d39f
Author: Omar Polo 
Commit: Omar Polo 

adding vc-got-stage

vc-got-stage is a minor mode for vc-diff buffers controlled by Got.
It's a tentative at implementing the stage operation for specific
changes instead of whole files.  vc.el works with filesets, and this
is fine.  But sometimes you want to commit only certain hunks.

This initial implementation allows the user to stage changes, but you
can't commit them (yet).
---
 vc-got-stage.el | 205 
 vc-got.el   |   7 ++
 2 files changed, 212 insertions(+)

diff --git a/vc-got-stage.el b/vc-got-stage.el
new file mode 100644
index 000..ae553d2
--- /dev/null
+++ b/vc-got-stage.el
@@ -0,0 +1,205 @@
+;; vc-got-stage.el --- Stage changes in vc-got diff buffers  -*- 
lexical-binding: t; -*-
+
+(eval-when-compile
+  (require 'subr-x))
+
+(defgroup vc-got-stage nil
+  "Stage hunks in vc-got diff buffers"
+  :group 'faces
+  :prefix "vc-got-stage-")
+
+(defface vc-got-stage-staged-face
+'((t (:foreground "red" :background "yellow")))
+  "Face used to highlight the staged mark on changes."
+  :group 'vc-got-stage)
+
+(defvar vc-got-stage-fileset nil
+  "The files diffed in the last call to `vc-got-diff'.")
+
+(defvar vc-got-stage-overlay-priority 0
+  "Specify overlay priority.
+Higher values means higher priority.  DON'T use negative numbers.")
+
+(defvar vc-got-stage--overlays nil
+  "The list of overlays.")
+
+(defvar vc-got-stage-prefix-map
+  (let ((map (make-sparse-keymap)))
+(define-key map (kbd "A") #'vc-got-stage-apply)
+(define-key map (kbd "b") #'vc-got-stage-beginning-of-change)
+(define-key map (kbd "e") #'vc-got-stage-end-of-change)
+(define-key map (kbd "n") #'vc-got-stage-next-change)
+(define-key map (kbd "p") #'vc-got-stage-prev-change)
+(define-key map (kbd "t") #'vc-got-stage-toggle-mark)
+map)
+  "Keymap for function `vc-got-stage-mode'.")
+
+;;;###autoload
+(define-minor-mode vc-got-stage-mode
+  "Stage hunks in vc-got diff buffers.
+
+\\{vc-got-stage-mode-map}"
+  :group vc-got-stage
+  :keymap (let ((map (make-sparse-keymap)))
+(define-key map (kbd "C-c g") vc-got-stage-prefix-map)
+map))
+
+;;;###autoload (defun vc-got-stage-activate ()
+;;;###autoload   "Activate vg-got-stage-mode if the current buffer is a vc-got 
diff."
+;;;###autoload   (when-let (root (vc-find-root default-directory ".got"))
+;;;###autoload (vc-got-stage-mode +1)))
+
+(defun vc-got-stage-activate ()
+  "Activate vg-got-stage-mode if the current buffer is a vc-got diff."
+  (message "VC got stage activate? %s" (vc-find-root default-directory ".got"))
+  (when-let (root (vc-find-root default-directory ".got"))
+(vc-got-stage-mode +1)))
+
+;;;###autoload (add-hook 'diff-mode-hook #'vc-got-stage-activate)
+(add-hook 'diff-mode-hook #'vc-got-stage-activate)
+
+(defun vc-got-stage--in-change ()
+  "T if the point is in a line that's part of a change."
+  (save-excursion
+(beginning-of-line)
+(when-let (ch (char-after))
+  (or (= ch ?\-)
+  (= ch ?\+)
+
+(defun vc-got-stage--change-marked-p ()
+  "T if the current change is marked."
+  (let ((p (point)))
+(cl-loop
+   for overlay in vc-got-stage--overlays
+   if (and (overlay-start overlay)
+   (= p (overlay-start overlay)))
+   return t
+   finally (return nil
+
+(defun vc-got-stage--compute-y-or-n (buf)
+  "Fill BUF with ``y'' or ``n'' lines for staging purpose."
+  (save-excursion
+(goto-char (point-min))
+(let ((p (point)))
+  (while (not (= p (progn (vc-got-stage-next-change)
+  (point
+(setq p (point))
+(if (vc-got-stage--change-marked-p)
+(with-current-buffer buf
+  (insert "y\n"))
+  (with-current-buffer buf
+(insert "n\n")))
+
+(defun vc-got-stage--apply-impl (script tmp-file)
+  "Apply the stages using SCRIPT as script (TMP-FILE is the path)."
+  (interactive "P")
+  (let* ((default-directory (vc-got-root default-directory))
+ (stage-buf (get-buffer-create "*vc-got-stage*")))
+(unless (zerop (apply #'process-file "got" nil stage-buf nil "unstage"
+  (mapcar #'file-relative-name vc-got-stage-fileset)))
+  (pop-to-buffer stage-buf)
+  (error "Got unstage failed"))
+(vc-got-stage--compute-y-or-n script)
+(with-current-buffer script
+  (save-buffer))
+(unless (zerop (apply #'process-file "got" nil stage-buf nil "stage" "-p"
+  "-F" tmp-file (mapcar #'file-relative-name
+vc-got-stage-fileset)))
+  (pop-to-buffer stage-buf)
+  (error "Got stage failed"
+
+(defun vc-got-stage-apply ()
+  "Apply the stages.
+This will first reset the stages of all the involved files, then
+stage the

[elpa] externals/vc-got d06f988 019/145: suggest to add .got to vc-directory-exclusion-list

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit d06f9880de206d7ff5133d5ddea7cd0f67f3cb6a
Author: Omar Polo 
Commit: Omar Polo 

suggest to add .got to vc-directory-exclusion-list
---
 README.md | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index d2dbdb8..84830bd 100644
--- a/README.md
+++ b/README.md
@@ -15,11 +15,20 @@ require the library.
 (cl-pushnew 'Got vc-handled-backends)
 ```
 
+It's highly recommended to add `".got"` to the list of
+`vc-directory-exclusion-list`.
+
+```emacs-lisp
+(cl-pushnew ".got" vc-directory-exclusion-list)
+```
+
 With `use-package` something like this should be enough:
 
 ```emacs-lisp
 (use-package vc-got
   :load-path "/path/to/vc-got/"
-  :init (cl-pushnew 'Got vc-handled-backends)
-  :defer t)
+  :defer t
+  :init
+  (cl-pushnew 'Got vc-handled-backends)
+  (cl-pushnew ".got" vc-directory-exclusion-list))
 ```



[elpa] externals/vc-got 8228942 050/145: fix vc-got-dir-status-files

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 82289421895601458f16fa160107b9154be83342
Author: Omar Polo 
Commit: Omar Polo 

fix vc-got-dir-status-files

now it works correctly even when an untracked files gets deleted.
---
 vc-got.el | 40 +---
 1 file changed, 25 insertions(+), 15 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index c36a3ac..746bd0b 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -362,21 +362,31 @@ DIR-OR-FILE."
 (vc-got--parse-status-flag (vc-got--status file
 
 (defun vc-got-dir-status-files (dir files update-function)
-  (let ((fs (seq-filter (lambda (file)
-  (and (not (string= file ".."))
-   (not (string= file "."))
-   (not (string= file ".got"
-(or files
-(directory-files dir)
-(cl-loop with result = (mapcar (lambda (x)
- (list (car x) (cdr x) nil))
-   (vc-got--parse-status
-(apply #'vc-got--status dir files)))
- for file in fs
- do (unless (cadr (assoc file result #'string=))
-  (cl-pushnew (list file 'up-to-date nil)
-  result))
- finally (funcall update-function result nil
+  (let* ((fs (seq-filter (lambda (file)
+   (and (not (string= file ".."))
+(not (string= file "."))
+(not (string= file ".got"
+ (or files
+ (directory-files dir
+ (stats (vc-got--parse-status (apply #'vc-got--status dir files)))
+ (res))
+;; collect deleted and removed files
+(cl-loop for (file . st) in stats
+ do (when (or (eq st 'missing)
+  (eq st 'removed))
+  (push (list file st nil) res)))
+(cl-loop for file in fs
+ do (let ((s (if (file-directory-p file)
+ (list file 'unregistered nil)
+   (if-let (status (cdr (assoc file stats #'string=)))
+   (list file status nil)
+ ;; if file doesn't exists, it's a
+ ;; untracked file that was removed.
+ (when (file-exists-p file)
+   (list file 'up-to-date nil))
+  (when s
+(push s res)))
+ finally (funcall update-function res nil
 
 (defun vc-got-dir-extra-headers (_dir)
   (concat



[elpa] externals/vc-got d54ceb8 041/145: make got program be customizable

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit d54ceb890b973c9f1af37a21789f52f5db830a37
Author: Timo Myyrä 
Commit: Timo Myyrä 

make got program be customizable

other platforms might have different name for got or it might not be in
PATH so provide means to customize it.
---
 vc-got.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 6b0b0c0..2e1eecb 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -106,8 +106,9 @@
 
 (require 'vc-got-stage)
 
-(defvar vc-got-cmd "got"
-  "The got command.")
+(defcustom vc-got-program "got"
+  "Name of the Got executable (excluding any arguments)."
+  :type 'string)
 
 (defcustom vc-got-diff-switches t
   "String or list of strings specifying switches for Got diff under VC.
@@ -139,8 +140,8 @@ Assume `default-directory' is inside a got worktree."
   (string-trim (buffer-string) nil "\n"
 
 (defun vc-got--call (&rest args)
-  "Call `vc-got-cmd' in the `default-directory' with ARGS and put the output 
in the current buffer."
-  (apply #'process-file vc-got-cmd nil (current-buffer) nil args))
+  "Call `vc-got-program' in the `default-directory' with ARGS and put the 
output in the current buffer."
+  (apply #'process-file vc-got-program nil (current-buffer) nil args))
 
 (defun vc-got--add (files)
   "Add FILES to got, passing `vc-register-switches' to the command invocation."
@@ -456,7 +457,7 @@ ROOT is the worktree root."
 
 (defun vc-got-pull (prompt)
   "Execute got pull, prompting the user for the full command if PROMPT is not 
nil."
-  (vc-got--push-pull vc-got-cmd "fetch" prompt (vc-got-root 
default-directory)))
+  (vc-got--push-pull vc-got-program "fetch" prompt (vc-got-root 
default-directory)))
 
 (defun vc-got-push (prompt)
   "Run git push (not got!) in the repository dir.



[elpa] externals/vc-got a5e9be3 029/145: fix table

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit a5e9be3d8fb24fc987bc5707a89dac4e1e9aaac3
Author: Omar Polo 
Commit: Omar Polo 

fix table
---
 README.md | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 0afc79d..730dc47 100644
--- a/README.md
+++ b/README.md
@@ -46,12 +46,14 @@ VC doesn't support this.  This is the motivation behind
 
 The following keys are enabled by `vc-got-stage-mode`:
 
+| key| description|
+|||
 | C-c g A | Applies (i.e. stage in got) the marked changes |
-| C-c g b | Go to beginning of change |
-| C-c g e | Go to end of change |
-| C-c g n | Go to next change |
-| C-c g p | Go to previous change |
-| C-c g t | Toggle mark |
+| C-c g b | Go to beginning of change  |
+| C-c g e | Go to end of change|
+| C-c g n | Go to next change  |
+| C-c g p | Go to previous change  |
+| C-c g t | Toggle mark|
 
 A change is a set of sequential line added/removed by the diff, it is
 a smaller unit than a *hunk*.



[elpa] externals/vc-got a2474a4 048/145: improve vc-got-dir-status-files

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit a2474a45dd5b17500561db24bec5680ec7224737
Author: Omar Polo 
Commit: Omar Polo 

improve vc-got-dir-status-files

show also missing/deleted files in vc-dir.  This isn't perfect yet,
because adding a temporary file and removing it will confuse the
vc-dir buffer.
---
 vc-got.el | 36 +++-
 1 file changed, 15 insertions(+), 21 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 0aa37df..bbbf7a1 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -372,27 +372,21 @@ DIR-OR-FILE."
 ;; (vc-got-state "/usr/ports/mystuff/non-existant")
 
 (defun vc-got-dir-status-files (dir files update-function)
-  (let* ((files (seq-filter (lambda (file)
-  (and (not (string= file ".."))
-   (not (string= file "."))
-   (not (string= file ".got"
-(or files
-(directory-files dir
- (statuses (vc-got--parse-status
-(apply #'vc-got--status dir files)))
- (default-directory dir))
-(cl-loop
- with result = nil
- for file in files
- do (setq result
-  (cons
-   (if (file-directory-p file)
-   (list file 'unregistered nil)
- (if-let (status (cdr (assoc file statuses #'string=)))
- (list file status nil)
-   (list file 'up-to-date nil)))
-   result))
- finally (funcall update-function result nil
+  (let ((fs (seq-filter (lambda (file)
+  (and (not (string= file ".."))
+   (not (string= file "."))
+   (not (string= file ".got"
+(or files
+(directory-files dir)
+(cl-loop with result = (mapcar (lambda (x)
+ (list (car x) (cdr x) nil))
+   (vc-got--parse-status
+(apply #'vc-got--status dir files)))
+ for file in fs
+ do (unless (cadr (assoc file result #'string=))
+  (cl-pushnew (list file 'up-to-date nil)
+  result))
+ finally (funcall update-function result nil
 
 ;; (let ((dir "/usr/ports/mystuff"))
 ;;   (vc-got-dir-status-files dir nil (lambda (res _t)



[elpa] externals/vc-got cf4e3eb 070/145: fix vc-got-dir-status-files

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit cf4e3ebe40038ce0bfff250a345070556b386fe1
Author: Omar Polo 
Commit: Omar Polo 

fix vc-got-dir-status-files

after the last change to vc-got--status it wouldn't return
'up-to-date.
---
 vc-got.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 090838d..4421901 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -391,7 +391,9 @@ tree."
 (with-temp-buffer
   (when (zerop (vc-got--call "status" file))
 (goto-char (point-min))
-(vc-got--parse-status-char (char-after))
+(if (eobp)
+'up-to-date
+  (vc-got--parse-status-char (char-after)))
 
 (defun vc-got-dir-status-files (dir files update-function)
   "Build the status for FILES in DIR.



[elpa] externals/vc-got df20ca2 040/145: add vc-got--program-version command to return version number

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit df20ca2725ebd6753073d5f9827aa22bb67dc3eb
Author: Timo Myyrä 
Commit: Timo Myyrä 

add vc-got--program-version command to return version number

this can be used to select behaviour based on used got version.
---
 vc-got.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/vc-got.el b/vc-got.el
index 6b0b0c0..f57e873 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -118,6 +118,12 @@ If nil, use the value of `vc-diff-switches'.  If t, use no 
switches."
  (repeat :tag "Argument List" :value ("") string)))
 
 ;; helpers
+(defun vc-got--program-version ()
+  "Returns the version string of used `Got' command."
+  (let (process-file-side-effects)
+(with-temp-buffer
+  (vc-got--call "-V")
+  (substring (buffer-string) 4 -1
 
 (defun vc-got-root (file)
   "Return the work tree root for FILE, or nil."



[elpa] externals/vc-got b34e96f 036/145: Emacs upstream has fixed the documentation, comment not needed

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit b34e96f9da78a55092762ed9fda088026474f35a
Author: Omar Polo 
Commit: Omar Polo 

Emacs upstream has fixed the documentation, comment not needed
---
 vc-got.el | 2 --
 1 file changed, 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 2eb93c5..1f73e93 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -501,8 +501,6 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
 (with-current-buffer buffer
   (vc-got--log nil nil (vc-got--current-branch) rl
 
-;; XXX: vc.el specify only pattern, but in reality this takes a buffer
-;; and a pattern.
 (defun vc-got-log-search (buffer pattern)
   "Search commits for PATTERN and write the results found in BUFFER."
   (with-current-buffer buffer



[elpa] externals/vc-got 986bd9a 038/145: fix diff on multiple files

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 986bd9a0366c6483c1749aa79459b612c0752853
Author: Omar Polo 
Commit: Omar Polo 

fix diff on multiple files

got diff wants a single file or two references/tags/sha.
---
 vc-got.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 3085f3a..6b0b0c0 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -517,7 +517,8 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
   (vc-got-with-worktree (car files)
 (cond ((and (null rev1)
 (null rev2))
-   (apply #'vc-got--diff files))
+   (dolist (file files)
+ (vc-got--diff file)))
   (t (error "Not implemented")))
 
 (provide 'vc-got)



[elpa] externals/vc-got 7c257a7 042/145: Merge pull request #1 from zmyrgel/feature/expand-implementation-status

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 7c257a7b800d3a5ddf981b66bbbff794fa52f901
Merge: 986bd9a 0e25fbe
Author: omar-polo <47739920+omar-p...@users.noreply.github.com>
Commit: GitHub 

Merge pull request #1 from zmyrgel/feature/expand-implementation-status

expand the vc function status list
---
 vc-got.el | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/vc-got.el b/vc-got.el
index 6b0b0c0..86c3d16 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -78,6 +78,36 @@
 ;; - show-log-entry NOT IMPLEMENTED
 ;; - comment-historyNOT IMPLEMENTED
 ;; - update-changelog   NOT IMPLEMENTED
+;; * diff   DONE
+;; - revision-completion-table  NOT IMPLEMENTED
+;; - annotate-command   NOT IMPLEMENTED
+;; - annotate-time  NOT IMPLEMENTED
+;; - annotate-current-time  NOT IMPLEMENTED
+;; - annotate-extract-revision-at-line  NOT IMPLEMENTED
+;; - region-history NOT IMPLEMENTED
+;; - region-history-modeNOT IMPLEMENTED
+;; - mergebase  NOT IMPLEMENTED
+;;
+;; TAG SYSTEM
+;; - create-tag NOT IMPLEMENTED
+;; - retrieve-tag   NOT IMPLEMENTED
+;;
+;; MISCELLANEOUSNOT IMPLEMENTED
+;; - make-version-backups-p NOT IMPLEMENTED
+;; - root   DONE
+;; - ignore NOT IMPLEMENTED
+;; - ignore-completion-tableNOT IMPLEMENTED
+;; - previous-revision  NOT IMPLEMENTED
+;; - next-revision  NOT IMPLEMENTED
+;; - log-edit-mode  NOT IMPLEMENTED
+;; - check-headers  NOT IMPLEMENTED
+;; - delete-fileNOT IMPLEMENTED
+;; - rename-fileNOT IMPLEMENTED
+;; - find-file-hook NOT IMPLEMENTED
+;; - extra-menu NOT IMPLEMENTED
+;; - extra-dir-menu NOT IMPLEMENTED
+;; - conflicted-files   NOT IMPLEMENTED
+;; - repository-url NOT IMPLEMENTED
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)



[elpa] externals/vc-got fab791a 052/145: vc-got--call flatten and filter arg list

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit fab791a23c58d981375f0c0aad775fdf75b00a7c
Author: Omar Polo 
Commit: Omar Polo 

vc-got--call flatten and filter arg list

it's handy to pass to vc-got--call lists like '("-l" 2) or nil values
(maybe from (when reverse "-R")).  This moves some filtering logic
from vc-got--log to vc-got--call.
---
 vc-got.el | 20 +---
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index a248730..08d53c3 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -182,7 +182,8 @@ Assume `default-directory' is inside a got worktree."
 
 (defun vc-got--call (&rest args)
   "Call `vc-got-program' in the `default-directory' with ARGS and put the 
output in the current buffer."
-  (apply #'process-file vc-got-program nil (current-buffer) nil args))
+  (apply #'process-file vc-got-program nil (current-buffer) nil
+ (cl-remove-if #'null (flatten-list args
 
 (defun vc-got--add (files)
   "Add FILES to got, passing `vc-register-switches' to the command invocation."
@@ -206,16 +207,13 @@ worktree."
   (let (process-file-side-effects)
 (vc-got-with-worktree (or path default-directory)
   (zerop
-   (apply #'vc-got--call
-  (cl-remove-if #'null
-(flatten-list
- (list "log"
-   (when limit (list "-l" (format "%s" limit)))
-   (when start-commit (list "-c" start-commit))
-   (when stop-commit (list "-x" stop-commit))
-   (when search-pattern (list "-s" 
search-pattern))
-   (when reverse '("-R"))
-   path
+   (vc-got--call "log"
+ (when limit (list "-l" (format "%s" limit)))
+ (when start-commit (list "-c" start-commit))
+ (when stop-commit (list "-x" stop-commit))
+ (when search-pattern (list "-s" search-pattern))
+ (when reverse '("-R"))
+ path)
 
 (defun vc-got--status (dir-or-file &rest files)
   "Return the output of ``got status''.



[elpa] externals/vc-got febb894 043/145: Add new customization group `vc-got' under vc

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit febb894c3e693485f7723820782cfcaccdc2cb4d
Author: Timo Myyrä 
Commit: Timo Myyrä 

Add new customization group `vc-got' under vc

this moves the customization options to its own group
---
 vc-got.el | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 2e1eecb..3e4882d 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -106,9 +106,14 @@
 
 (require 'vc-got-stage)
 
+(defgroup vc-got nil
+  "VC GoT backend."
+  :group 'vc)
+
 (defcustom vc-got-program "got"
   "Name of the Got executable (excluding any arguments)."
-  :type 'string)
+  :type 'string
+  :group 'vc-got)
 
 (defcustom vc-got-diff-switches t
   "String or list of strings specifying switches for Got diff under VC.
@@ -116,7 +121,8 @@ If nil, use the value of `vc-diff-switches'.  If t, use no 
switches."
   :type '(choice (const :tag "Unspecified" nil)
  (const :tag "None" t)
  (string :tag "Argument String")
- (repeat :tag "Argument List" :value ("") string)))
+ (repeat :tag "Argument List" :value ("") string))
+  :group 'vc-got)
 
 ;; helpers
 



[elpa] externals/vc-got daae979 066/145: implement vc-got-stage-commit to commit staged changes

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit daae979d49408c97d6ed40de4a1aad4c2304c91d
Author: Omar Polo 
Commit: Omar Polo 

implement vc-got-stage-commit to commit staged changes
---
 vc-got-stage.el | 18 ++
 vc-got.el   |  4 
 2 files changed, 22 insertions(+)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index 489c18f..461b819 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -25,12 +25,14 @@
 
 ;;; Code:
 
+(require 'log-edit)
 (require 'rx)
 (require 'vc)
 
 (defvar vc-got-program) ;vc-got.el
 (declare-function vc-got--diff"vc-got")
 (declare-function vc-got--unstage "vc-got" (file))
+(declare-function vc-got-checkin  "vc-got" (fileset comment))
 
 (defvar vc-got-stage--process nil
   "The got stage process.")
@@ -127,5 +129,21 @@ If FILESET is nil, show the diff for every staged hunks."
 (vc-got--diff "-s" file))
 (vc-got--diff "-s")
 
+(defun vc-got-stage-commit ()
+  "Commit staged hunks."
+  (interactive)
+  (let ((buf (get-buffer-create "*vc-got-stage-commit*")))
+(pop-to-buffer buf)
+(log-edit (lambda ()
+(interactive)
+(let ((msg (buffer-substring-no-properties (point-min)
+   (point-max
+  (kill-buffer)
+  (vc-got-checkin nil msg)))
+  t
+  ;; TODO: add here an alist of
+  ;; '((vc-log-fileset . (staged-files)))
+  )))
+
 (provide 'vc-got-stage)
 ;;; vc-got-stage.el ends here
diff --git a/vc-got.el b/vc-got.el
index 32a11f7..f088f2d 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -447,6 +447,10 @@ tree."
 
 (defalias 'vc-got-responsible-p #'vc-got-root)
 
+;; XXX: generally speaking, files cannot be nil.  But we have to
+;; handle that case too, because vc-got-stage-commit will call
+;; vc-got-checking with fileset nil to commit the current staged
+;; hunks.
 (defun vc-got-checkin (files comment &optional _rev)
   "Commit FILES with COMMENT as commit message."
   (with-temp-buffer



[elpa] externals/vc-got f09d635 045/145: Merge pull request #2 from zmyrgel/feature/add-version-command

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit f09d635903d423f3b3370842b8a719d431bc6047
Merge: e79563b df20ca2
Author: omar-polo <47739920+omar-p...@users.noreply.github.com>
Commit: GitHub 

Merge pull request #2 from zmyrgel/feature/add-version-command

add vc-got--program-version command to return version number
---
 vc-got.el | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/vc-got.el b/vc-got.el
index 1e4b419..a451aa8 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -155,6 +155,12 @@ If nil, use the value of `vc-diff-switches'.  If t, use no 
switches."
   :group 'vc-got)
 
 ;; helpers
+(defun vc-got--program-version ()
+  "Returns the version string of used `Got' command."
+  (let (process-file-side-effects)
+(with-temp-buffer
+  (vc-got--call "-V")
+  (substring (buffer-string) 4 -1
 
 (defun vc-got-root (file)
   "Return the work tree root for FILE, or nil."



[elpa] externals/vc-got c27df03 055/145: print more info in vc-got-dir-extra-headers

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit c27df03ea824ff238691d3e4c20f662611e3fe10
Author: Omar Polo 
Commit: Omar Polo 

print more info in vc-got-dir-extra-headers

added repository path and remote url to vc-got-dir-extra-headers
---
 vc-got.el | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 81c60b3..261eeb1 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -387,10 +387,14 @@ DIR-OR-FILE."
 (push s res)))
  finally (funcall update-function res nil
 
-(defun vc-got-dir-extra-headers (_dir)
-  (concat
-   (propertize "Branch : " 'face 'font-lock-type-face)
-   (vc-got--current-branch)))
+(defun vc-got-dir-extra-headers (dir)
+  "Return a string for the `vc-dir' buffer heading for directory DIR."
+  (concat (propertize "Repository : " 'face 'font-lock-type-face)
+  (vc-got--repo-root) "\n"
+  (propertize "Remote URL : " 'face 'font-lock-type-face)
+  (vc-got-repository-url dir) "\n"
+  (propertize "Branch : " 'face 'font-lock-type-face)
+  (vc-got--current-branch)))
 
 (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."



[elpa] externals/vc-got 2d83de2 074/145: implement vc-got-dir-printer

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 2d83de2ecf9274d3ab0469cabb968114d1d1bedb
Author: Omar Polo 
Commit: Omar Polo 

implement vc-got-dir-printer

This way we can control how each file gets displayed in the *vc-dir*
buffer and display the staged information.

The advice around vc-dir-move-to-goal-column is needed otherwise `n'
and `p' moves the cursor to the wrong column.  vc-dir.el hardcodes
that value to 25.
---
 vc-got.el | 72 ---
 1 file changed, 64 insertions(+), 8 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 4421901..23070ec 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -35,7 +35,7 @@
 ;; * state  DONE
 ;; - dir-status-files   DONE
 ;; - dir-extra-headers  DONE
-;; - dir-printerNOT IMPLEMENTED
+;; - dir-printerDONE
 ;; - status-fileinfo-extra  NOT IMPLEMENTED
 ;; * working-revision   DONE
 ;; * checkout-model DONE
@@ -134,6 +134,10 @@
 (require 'vc)
 (require 'vc-annotate)
 
+;; FIXME: avoid loading this?  We only need it for
+;; vc-dir-filename-mouse-map in our custom printer.
+(require 'vc-dir)
+
 (require 'vc-got-stage)
 
 (defgroup vc-got nil
@@ -233,17 +237,19 @@ files)."
 (cl-loop until (eobp)
  ;; the format of each line is
  ;; \n
- collect (let* ((file-status (prog1 (char-after)
+ collect (let* ((file-status (prog1 (vc-got--parse-status-char
+ (char-after))
(forward-char)))
-(stage-status (prog1 (char-after)
+(stage-status (prog1 (vc-got--parse-stage-char
+  (char-after))
 (forward-char)))
 (filename (progn
 (forward-char)
 (buffer-substring (point)
   
(line-end-position)
(list filename
- (vc-got--parse-status-char file-status)
- (vc-got--parse-stage-char stage-status)))
+ (or file-status (and stage-status 
'up-to-date))
+ stage-status))
  do (forward-line))
 
 (defun vc-got--parse-status-char (c)
@@ -262,9 +268,9 @@ files)."
 (defun vc-got--parse-stage-char (c)
   "Parse the stage status char C into a symbol."
   (cl-case c
-(?M 'edited)
-(?A 'added)
-(?D 'removed)))
+(?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."
@@ -426,6 +432,44 @@ FILES is nil, consider all the files in DIR."
   (propertize "Branch : " 'face 'font-lock-type-face)
   (vc-got--current-branch)))
 
+(defun vc-got-dir-printer (info)
+  "Pretty-printer for the vc-dir-fileinfo structure INFO."
+  (let* ((isdir (vc-dir-fileinfo->directory info))
+(state (if isdir "" (vc-dir-fileinfo->state info)))
+(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
+  (format "%-14s" 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
+  (if stage-state
+ (format "staged:%-7s" stage-state)
+   (format "%-14s" ""))
+  '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 "%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
+
 (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."
   (or
@@ -697,5 +741,17 @@ Value is returned as floating point fractional number of 
days."
 (forward-line))
   found)
 
+
+;;

[elpa] externals/vc-got 06d4d37 031/145: add Makefile

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 06d4d3734fd0b273c45f8848c3223516d4164a89
Author: Omar Polo 
Commit: Omar Polo 

add Makefile

ATM it only compiles el to elc
---
 Makefile | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/Makefile b/Makefile
new file mode 100644
index 000..b1e208b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+EMACS =emacs
+
+compile: vc-got.elc vc-got-stage.elc
+
+clean:
+   rm -f *.elc
+
+.SUFFIXES: .el .elc
+.el.elc:
+   ${EMACS} -Q --batch -L . -f batch-byte-compile $<



[elpa] externals/vc-got 3f25d9f 051/145: add vc-got-annotate (#4)

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 3f25d9ffc6f214200f4e66c4d362bad00c109ca6
Author: Timo Myyrä 
Commit: GitHub 

add vc-got-annotate  (#4)

* add vc-got-annotate-{command,time,extract-revision-at-line}

this makes vc-annotate command basic functionality working, needs
next/prev-revision support to see diffs.

* add vc-got-{previous,next}-revision defuns

roughy working but might need a bit more testing.

* add vc-got-annotate-re helper

* use vc-got--log in prev/next-revision functions

no need to reinvent the wheel, use the existing vc-got--log to get the
log info.

* fix vc-got-previous-revision

vc-got--log leaves point at the end of buffer so move point to the
beginning before running keep-lines so it has chance at working.

* fixes for vc-got-next-revision

set rstart/end to keep-lines so it works on whole buffer and don't use
previous-line as its not intended for elisp code. Also fix the first
match regexp to allow branch names after commit sha-1 values.

* prefer with-current-buffer

* require vc-annotate

* rename vc-got-annotate-re to vc-got--annotate-re

this is for internal use so name it so. While here add doc string for it.

* Make annotation buffers parent managed by got

vc-ensure-vc-buffer won't recognise this buffer as managed by got unless
vc-parent-buffer points to a buffer managed by got.

* refactor vc-got-next-revision

no need for extensive checks in function, got command won't return
successfully unless it finds the wanted revision so are certain the rev
is found, we only need to check if it has a parent.

while here, replace the multiple commit regexp with internal
vc-got--commit-re.
---
 vc-got.el | 82 +++
 1 file changed, 77 insertions(+), 5 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 746bd0b..a248730 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -80,10 +80,10 @@
 ;; - update-changelog   NOT IMPLEMENTED
 ;; * diff   DONE
 ;; - revision-completion-table  NOT IMPLEMENTED
-;; - annotate-command   NOT IMPLEMENTED
-;; - annotate-time  NOT IMPLEMENTED
+;; - annotate-command   DONE
+;; - annotate-time  DONE
 ;; - annotate-current-time  NOT IMPLEMENTED
-;; - annotate-extract-revision-at-line  NOT IMPLEMENTED
+;; - annotate-extract-revision-at-line  DONE
 ;; - region-history NOT IMPLEMENTED
 ;; - region-history-modeNOT IMPLEMENTED
 ;; - mergebase  NOT IMPLEMENTED
@@ -97,8 +97,8 @@
 ;; - root   DONE
 ;; - ignore NOT IMPLEMENTED
 ;; - ignore-completion-tableNOT IMPLEMENTED
-;; - previous-revision  NOT IMPLEMENTED
-;; - next-revision  NOT IMPLEMENTED
+;; - previous-revision  DONE
+;; - next-revision  DONE
 ;; - log-edit-mode  NOT IMPLEMENTED
 ;; - check-headers  NOT IMPLEMENTED
 ;; - delete-fileNOT IMPLEMENTED
@@ -133,6 +133,7 @@
 (require 'cl-seq)
 (require 'seq)
 (require 'vc)
+(require 'vc-annotate)
 
 (defgroup vc-got nil
   "VC GoT backend."
@@ -545,5 +546,76 @@ LIMIT limits the number of commits, optionally starting at 
START-REVISION."
  (vc-got--diff file)))
   (t (error "Not implemented")))
 
+(defun vc-got-annotate-command (file buf &optional rev)
+  "Show annotated contents of FILE in buffer BUF. If given, use revision REV."
+  (let (process-file-side-effects)
+(with-current-buffer buf
+  ;; FIXME: vc-ensure-vc-buffer won't recognise this buffer as managed
+  ;; by got unless vc-parent-buffer points to a buffer managed by got.
+  ;; investigate why this is needed.
+  (set (make-local-variable 'vc-parent-buffer) (find-file-noselect file))
+  (apply #'vc-got--call "blame" (if rev
+(list "-c" rev file)
+  (list file))
+
+(defconst vc-got--annotate-re
+  (concat "^[0-9]\\{1,\\}) " ; line number followed by )
+  "\\([a-z0-9]+\\) " ; SHA-1 of commit
+  "\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\}\\) " ; year-mm-dd
+  "\\([^ ]\\)+ "); author
+  "Regexp to match annotation output lines.
+
+Provides capture groups for:
+1. revision id
+2. date of commit
+3. author of commit")
+
+(defconst vc-got--commit-re "^commit \\([a-z0-9]+\\)"
+  "Regexp to match commit lines.
+
+Provides capture group for the commit revision id.")
+
+(defun vc-got-annotate-time ()
+  "Return the time of the next line of annotation at or after point.
+Value is returned as floating point fractional number of 

[elpa] externals/vc-got eacbf76 065/145: don't hardcode got questions

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit eacbf767c64ccb8c469698044c691c7baa3b20a4
Author: Omar Polo 
Commit: Omar Polo 

don't hardcode got questions

match and relay them to the user
---
 vc-got-stage.el | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/vc-got-stage.el b/vc-got-stage.el
index baf0e43..489c18f 100644
--- a/vc-got-stage.el
+++ b/vc-got-stage.el
@@ -25,6 +25,7 @@
 
 ;;; Code:
 
+(require 'rx)
 (require 'vc)
 
 (defvar vc-got-program) ;vc-got.el
@@ -86,11 +87,12 @@ PROC is the process, STRING part of its output."
   (insert string)
   (save-excursion
 (beginning-of-line)
-(let ((msg (cond ((looking-at "^stage this change?")
-  "Stage this change? ")
- ((looking-at "^stage this addition?")
-  "Stage this addition? "
-  (when msg
+(when (looking-at (rx bol
+  (group (zero-or-one "un")
+ "stage"
+ (zero-or-more anychar)
+ "?")))
+  (let ((msg (match-string 1)))
 (kill-line)
 (process-send-string buf (if (y-or-n-p msg) "y\n" "n\n"))
 (erase-buffer)



[elpa] externals/vc-got 0a66694 046/145: vc-got--log: add flag for reverse and mark as no side effects

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 0a66694e897e35f0472d5ada455a76b7719cc285
Author: Omar Polo 
Commit: Omar Polo 

vc-got--log: add flag for reverse and mark as no side effects
---
 vc-got.el | 28 
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index a451aa8..827fc90 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -190,7 +190,8 @@ Assume `default-directory' is inside a got worktree."
   (with-temp-buffer
 (apply #'vc-got--call "add" (append vc-register-switches files
 
-(defun vc-got--log (&optional path limit start-commit stop-commit 
search-pattern)
+(defun vc-got--log (&optional path limit start-commit stop-commit
+  search-pattern reverse)
   "Execute the log command in the worktree of PATH.
 The output in the current buffer.
 
@@ -199,20 +200,23 @@ LIMIT limits the maximum number of commit returned.
 START-COMMIT: start traversing history at the specified commit.
 STOP-COMMIT: stop traversing history at the specified commit.
 SEARCH-PATTERN: limit to log messages matched by the regexp given.
+REVERSE: display the log messages in reverse order.
 
 Return nil if the command failed or if PATH isn't included in any
 worktree."
-  (vc-got-with-worktree (or path default-directory)
-(zerop
- (apply #'vc-got--call
-(cl-remove-if #'null
-  (flatten-list
-   (list "log"
- (when limit (list "-l" (format "%s" limit)))
- (when start-commit (list "-c" start-commit))
- (when stop-commit (list "-x" stop-commit))
- (when search-pattern (list "-s" 
search-pattern))
- path)))
+  (let (process-file-side-effects)
+(vc-got-with-worktree (or path default-directory)
+  (zerop
+   (apply #'vc-got--call
+  (cl-remove-if #'null
+(flatten-list
+ (list "log"
+   (when limit (list "-l" (format "%s" limit)))
+   (when start-commit (list "-c" start-commit))
+   (when stop-commit (list "-x" stop-commit))
+   (when search-pattern (list "-s" 
search-pattern))
+   (when reverse '("-R"))
+   path
 
 (defun vc-got--status (dir-or-file &rest files)
   "Return the output of ``got status''.



[elpa] externals/vc-got 668dc8e 068/145: vc-got--status: handle stage info and filter result

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 668dc8eb0b9440ec404e94c343f3bf4978d4e90a
Author: Omar Polo 
Commit: Omar Polo 

vc-got--status: handle stage info and filter result

Changed how vc-got--status works: before it returned a string
representing the output of "got status", now a data structure.  Elisp
is better (and more efficient) at managing buffers instead.

Additionally, now it parses also the stage information and has a
flag to list only file with certain status flag (i.e. only conflicted
files, only added files, ...)
---
 vc-got.el | 101 +++---
 1 file changed, 57 insertions(+), 44 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 3ce4e03..08d0e7c 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -216,43 +216,55 @@ worktree."
  (when reverse '("-R"))
  path)
 
-(defun vc-got--status (dir-or-file &rest files)
-  "Return the output of ``got status''.
-
+(defun vc-got--status (status-codes dir-or-file &rest files)
+  "Return a list of lists '(FILE STATUS STAGE-STATUS).
 DIR-OR-FILE can be either a directory or a file.  If FILES is
 given, return the status of those files, otherwise the status of
-DIR-OR-FILE."
+DIR-OR-FILE.  STATUS-CODES is either nil, or a string that's
+passed as the -s flag to got status to limit the types of status
+to report (e.g. \"CD\" to report only conflicts and deleted
+files)."
   (vc-got-with-worktree dir-or-file
 (with-temp-buffer
-  (if files
-  (apply #'vc-got--call "status" files)
-(vc-got--call "status" dir-or-file))
-  (buffer-string
-
-(defun vc-got--parse-status-flag (flag)
-  "Parse FLAG, see `vc-state'."
-  ;; got outputs nothing if the file is up-to-date
-  (if (string-empty-p flag)
-  'up-to-date
-;; trying to follow the order of the manpage
-(cl-case (aref flag 0)
-  (?M 'edited)
-  (?A 'added)
-  (?D 'removed)
-  (?C 'conflict)
-  (?! 'missing)
-  (?~ 'edited) ;XXX: what does it means for a file to be ``obstructed''?
-  (?? 'unregistered)
-  (?m 'edited) ;modified file modes
-  (?N nil
-
-(defun vc-got--parse-status (output)
-  "Parse the OUTPUT of got status and return an alist of (FILE . STATUS)."
-  ;; XXX: the output of got is line-oriented and will break if
-  ;; filenames contains spaces or newlines.
-  (cl-loop for line in (split-string output "\n" t)
-   collect (cl-destructuring-bind (status file) (split-string line " " 
t " ")
- `(,file . ,(vc-got--parse-status-flag status)
+  (when (zerop (vc-got--call "status"
+ (when status-codes (list "-s" status-codes))
+ (or files dir-or-file)))
+(goto-char (point-min))
+(cl-loop until (eobp)
+ ;; the format of each line is
+ ;; \n
+ collect (let* ((file-status (prog1 (char-after)
+   (forward-char)))
+(stage-status (prog1 (char-after)
+(forward-char)))
+(filename (progn
+(forward-char)
+(buffer-substring (point)
+  
(line-end-position)
+   (list filename
+ (vc-got--parse-status-char file-status)
+ (vc-got--parse-stage-char stage-status)))
+ do (forward-line))
+
+(defun vc-got--parse-status-char (c)
+  "Parse status char C into a symbol accepted by `vc-state'."
+  (cl-case c
+(?M 'edited)
+(?A 'added)
+(?D 'removed)
+(?C 'conflict)
+(?! 'missing)
+(?~ 'edited) ;XXX: what does it means for a file to be ``obstructed''?
+(?? 'unregistered)
+(?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 'edited)
+(?A 'added)
+(?D 'removed)))
 
 (defun vc-got--tree-parse ()
   "Parse into an alist the output of got tree -i in the current buffer."
@@ -367,14 +379,19 @@ tree."
   (if (file-directory-p file)
   nil   ;got doesn't track directories
 (when (vc-find-root file ".got")
-  (let ((status (vc-got--status file)))
-(not (or (string-prefix-p "?" status)
- (string-prefix-p "N" status)))
+  (let ((s (vc-got-state file)))
+(not (or (eq s 'unregistered)
+ (null s)))
 
 (defun vc-got-state (file)
   "Return the current version control state of FILE.  See `vc-state'."
   (unless (file-directory-p file)
-(vc-got--parse-status-flag (vc-got--status file
+;; Manually calling got status and checking

[elpa] externals/vc-got 7bb16f7 053/145: implement conflicted-files

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 7bb16f79d9239b75da67f85f08d4a6586d7ecb14
Author: Omar Polo 
Commit: Omar Polo 

implement conflicted-files
---
 vc-got.el | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 08d53c3..96163a5 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -106,7 +106,7 @@
 ;; - find-file-hook NOT IMPLEMENTED
 ;; - extra-menu NOT IMPLEMENTED
 ;; - extra-dir-menu NOT IMPLEMENTED
-;; - conflicted-files   NOT IMPLEMENTED
+;; - conflicted-files   DONE
 ;; - repository-url NOT IMPLEMENTED
 
 ;; TODO: use the idiom
@@ -615,5 +615,20 @@ Value is returned as floating point fractional number of 
days."
   (when (looking-at vc-got--commit-re)
 (match-string-no-properties 1)
 
+(defun vc-got-conflicted-files (dir)
+  "Return the list of files with conflicts in directory DIR."
+  (let* ((root (vc-got-root dir))
+ (default-directory root)
+ (process-file-side-effects))
+;; for got it doesn't matter where we call "got status", it will
+;; always report file paths from the root of the repo.
+(cl-loop with conflicts = nil
+ for (file . status) in (vc-got--parse-status-flag
+ (vc-got--status "."))
+ do (when (and (eq status 'conflict)
+   (file-in-directory-p file dir))
+  (push file conflicts))
+ finally return conflicts)))
+
 (provide 'vc-got)
 ;;; vc-got.el ends here



[elpa] externals/vc-got 8b635a9 054/145: implement repository-url

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 8b635a9f0f8c22640d8e129df31a514deace0679
Author: Omar Polo 
Commit: Omar Polo 

implement repository-url
---
 vc-got.el | 19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 96163a5..81c60b3 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -107,7 +107,7 @@
 ;; - extra-menu NOT IMPLEMENTED
 ;; - extra-dir-menu NOT IMPLEMENTED
 ;; - conflicted-files   DONE
-;; - repository-url NOT IMPLEMENTED
+;; - repository-url DONE
 
 ;; TODO: use the idiom
 ;;  (let (process-file-side-effects) ...)
@@ -630,5 +630,22 @@ Value is returned as floating point fractional number of 
days."
   (push file conflicts))
  finally return conflicts)))
 
+(defun vc-got-repository-url (_file &optional remote-name)
+  "Return URL for REMOTE-NAME, or for \"origin\" if nil."
+  (let* ((default-directory (vc-got--repo-root))
+ (remote-name (or remote-name "origin"))
+ (heading (concat "[remote \"" remote-name "\"]"))
+ found)
+(with-temp-buffer
+  (insert-file-contents "config")
+  (goto-char (point-min))
+  (when (search-forward heading nil t)
+(forward-line)
+(while (and (not found)
+(looking-at ".*="))   ;too broad?
+  (when (looking-at ".*url = \\(.*\\)")
+(setq found (match-string-no-properties 1
+found
+
 (provide 'vc-got)
 ;;; vc-got.el ends here



[elpa] externals/vc-got 8ed796d 062/145: vc-got-dir-status-files: show changes in subdirs

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 8ed796d4347e6530a37aee28080c8c4de842c01e
Author: Omar Polo 
Commit: Omar Polo 

vc-got-dir-status-files: show changes in subdirs
---
 vc-got.el | 19 +++
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index f4121be..43ee10e 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -376,21 +376,16 @@ DIR-OR-FILE."
  (or files
  (directory-files dir
  (stats (vc-got--parse-status (apply #'vc-got--status dir files)))
- (res))
-;; collect deleted and removed files
-(cl-loop for (file . st) in stats
- do (when (or (eq st 'missing)
-  (eq st 'removed))
-  (push (list file st nil) res)))
+ (res (mapcar (lambda (x)
+(list (car x) (cdr x) nil))
+  stats)))
 (cl-loop for file in fs
- do (let ((s (if (file-directory-p file)
- (list file 'unregistered nil)
-   (if-let (status (cdr (assoc file stats #'string=)))
-   (list file status nil)
+ do (let ((s (unless (or (cdr (assoc file stats #'string=))
+ (file-directory-p file))
+   (when (file-exists-p file)
  ;; if file doesn't exists, it's a
  ;; untracked file that was removed.
- (when (file-exists-p file)
-   (list file 'up-to-date nil))
+ (list file 'up-to-date nil)
   (when s
 (push s res)))
  finally (funcall update-function res nil



[elpa] externals/vc-got 43c93a8 063/145: typo

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 43c93a89a7024d8b8556207cd1404c6b563249e8
Author: Omar Polo 
Commit: Omar Polo 

typo
---
 vc-got.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vc-got.el b/vc-got.el
index 43ee10e..3a03536 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -634,7 +634,7 @@ Value is returned as floating point fractional number of 
days."
 ;; for got it doesn't matter where we call "got status", it will
 ;; always report file paths from the root of the repo.
 (cl-loop with conflicts = nil
- for (file . status) in (vc-got--parse-status-flag
+ for (file . status) in (vc-got--parse-status
  (vc-got--status "."))
  do (when (and (eq status 'conflict)
(file-in-directory-p file dir))



[elpa] externals/vc-got 3cdb075 058/145: update status list a bit

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 3cdb0759b5b41b166c618e8366016b8a33face08
Author: Timo Myyrä 
Commit: omar-polo <47739920+omar-p...@users.noreply.github.com>

update status list a bit
---
 vc-got.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 2689c7e..0fb35e5 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -47,7 +47,7 @@
 ;;  do.
 ;; * register   DONE
 ;; - responsible-p  DONE
-;; - receive-file   NOT IMPLEMENTED
+;; - receive-file   NOT NEEDED, default `register' works 
fine
 ;; - unregister DONE
 ;; * checkinDONE
 ;; * find-revision  DONE
@@ -61,7 +61,7 @@
 ;; - pull   DONE
 ;; - push   DONE
 ;;  uses git
-;; - steal-lock NOT IMPLEMENTED
+;; - steal-lock NOT NEEDED, `got' is not using locks
 ;; - modify-change-comment  NOT IMPLEMENTED
 ;;  can be implemented via histedit, if I understood correctly
 ;;  what it is supposed to do.
@@ -92,19 +92,19 @@
 ;; - retrieve-tag   NOT IMPLEMENTED
 ;;
 ;; MISCELLANEOUSNOT IMPLEMENTED
-;; - make-version-backups-p NOT IMPLEMENTED
+;; - make-version-backups-p NOT NEEDED, `got' works fine locally
 ;; - root   DONE
 ;; - ignore NOT IMPLEMENTED
 ;; - ignore-completion-tableNOT IMPLEMENTED
 ;; - previous-revision  DONE
 ;; - next-revision  DONE
 ;; - log-edit-mode  NOT IMPLEMENTED
-;; - check-headers  NOT IMPLEMENTED
+;; - check-headers  NOT NEEDED, `got' does not use headers
 ;; - delete-fileDONE
-;; - rename-fileNOT IMPLEMENTED
-;; - find-file-hook NOT IMPLEMENTED
-;; - extra-menu NOT IMPLEMENTED
-;; - extra-dir-menu NOT IMPLEMENTED
+;; - rename-fileNOT NEEDED, `delete' + `register' is 
enough
+;; - find-file-hook NOT NEEDED, no need for hooks yet
+;; - extra-menu NOT IMPLEMENTED, add `import', 
`integrate', `stage'?
+;; - extra-dir-menu NOT IMPLEMENTED, same as above
 ;; - conflicted-files   DONE
 ;; - repository-url DONE
 



[elpa] externals/vc-got 6b6c8a7 064/145: fundamentals for staging changes

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 6b6c8a7882362c36787a7522e0b0cecc463f6e3d
Author: Omar Polo 
Commit: Omar Polo 

fundamentals for staging changes

This is an initial implementation for the stage/unstage functionalities.
They operate at a smaller scope than filesets, the work with
individual hunks.

An interactive stage hunks and a unstage-all are implemented.
---
 Makefile|   2 +-
 vc-got-stage.el | 129 
 vc-got.el   |   8 
 3 files changed, 138 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 68acf98..b1e208b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 EMACS =emacs
 
-compile: vc-got.elc
+compile: vc-got.elc vc-got-stage.elc
 
 clean:
rm -f *.elc
diff --git a/vc-got-stage.el b/vc-got-stage.el
new file mode 100644
index 000..baf0e43
--- /dev/null
+++ b/vc-got-stage.el
@@ -0,0 +1,129 @@
+;;; vc-got-stage.el --- Stage functionalities for vc-got  -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2021  Omar Polo
+
+;; Author: Omar Polo 
+;; Keywords: vc
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program.  If not, see .
+
+;;; Commentary:
+
+;; Stage-related functions for vc-got.  This allows vc-got to stage
+;; and commit individual chunks and not entire filesets.
+
+;;; Code:
+
+(require 'vc)
+
+(defvar vc-got-program) ;vc-got.el
+(declare-function vc-got--diff"vc-got")
+(declare-function vc-got--unstage "vc-got" (file))
+
+(defvar vc-got-stage--process nil
+  "The got stage process.")
+
+(defvar vc-got-stage--fileset nil
+  "Remaining fileset to process.")
+
+(defun vc-got-stage--assert-proc ()
+  "Assert no vc-got-stage process is running."
+  (when (process-live-p vc-got-stage--process)
+(error "A vc-got-stage-files is already in progress")))
+
+(defun vc-got-stage-files (fileset)
+  "Interactively stage hunks from files in FILESET."
+  (interactive (list (cadr (vc-deduce-fileset
+  (vc-got-stage--assert-proc)
+  (if (not fileset)
+  (message "[vc-got] nothing to stage.")
+(setq vc-got-stage--fileset fileset)
+(vc-got-stage--next)))
+
+(defun vc-got-stage--next ()
+  "Process next file in stage list."
+  (vc-got-stage--assert-proc)
+  (let ((file (car vc-got-stage--fileset)))
+(if (not file)
+(progn (kill-buffer (process-buffer vc-got-stage--process))
+   (message "[vc-got] stage done."))
+  (setq vc-got-stage--fileset (cdr vc-got-stage--fileset))
+  (let ((buf (get-buffer-create "*vc-got-stage*")))
+(pop-to-buffer buf)
+(with-current-buffer buf
+  (buffer-disable-undo)
+  (erase-buffer)
+  (read-only-mode)
+  (unless (derived-mode-p 'diff-mode)
+(diff-mode)))
+(setq vc-got-stage--process
+  (make-process :name "got"
+:buffer buf
+:command (list vc-got-program "stage" "-p" file)
+:connection 'pty
+:filter #'vc-got-stage--filter
+:sentinel #'vc-got-stage--sentinel))
+
+(defun vc-got-stage--filter (proc string)
+  "Filter for got stage process.
+PROC is the process, STRING part of its output."
+  (let ((buf (process-buffer proc)))
+(when (buffer-live-p buf)
+  (let ((inhibit-read-only t))
+(with-current-buffer buf
+  (goto-char (point-max))
+  (insert string)
+  (save-excursion
+(beginning-of-line)
+(let ((msg (cond ((looking-at "^stage this change?")
+  "Stage this change? ")
+ ((looking-at "^stage this addition?")
+  "Stage this addition? "
+  (when msg
+(kill-line)
+(process-send-string buf (if (y-or-n-p msg) "y\n" "n\n"))
+(erase-buffer)
+
+(defun vc-got-stage--sentinel (_proc event)
+  "Sentinel for got stage process.
+Should be only called when EVENT is finished."
+  (when (string= event "finished\n")
+(vc-got-stage--next)))
+
+;; TODO: make this interactive just as stage is
+(defun vc-got-stage-unstage (fileset)
+  "Unstage staged hunks in FILESET."
+  (interactive (list (cadr (vc-deduce-fileset
+  (vc-got-stage--assert-proc)
+  (if fileset
+  (dolist 

[elpa] externals/vc-got 6f42ede 081/145: don't create temp buffers for nothing

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit 6f42ede4aec43aaad2f470329c034ed0b40945b0
Author: Omar Polo 
Commit: Omar Polo 

don't create temp buffers for nothing
---
 vc-got.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 23ea185..12d777c 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -727,8 +727,8 @@ Value is returned as floating point fractional number of 
days."
  ((file-exists-p "config")
   "config")))
  found)
-(with-temp-buffer
-  (when conf
+(when conf
+  (with-temp-buffer
 (insert-file-contents conf)
 (goto-char (point-min))
 (when (search-forward heading nil t)



[elpa] externals/vc-got ffa81a1 067/145: typo

2021-09-09 Thread ELPA Syncer
branch: externals/vc-got
commit ffa81a1d2d8cc7efa8ac9b4babf21f3c9751e6b7
Author: Omar Polo 
Commit: Omar Polo 

typo
---
 vc-got.el | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index f088f2d..3ce4e03 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -449,8 +449,7 @@ tree."
 
 ;; XXX: generally speaking, files cannot be nil.  But we have to
 ;; handle that case too, because vc-got-stage-commit will call
-;; vc-got-checking with fileset nil to commit the current staged
-;; hunks.
+;; vc-got-checkin with fileset nil to commit the current staged hunks.
 (defun vc-got-checkin (files comment &optional _rev)
   "Commit FILES with COMMENT as commit message."
   (with-temp-buffer



  1   2   >