[nongnu] elpa/tuareg 59446ec 2/2: tuareg-other-file-alist: Fix typo

2021-09-01 Thread ELPA Syncer
branch: elpa/tuareg
commit 59446ecd986e6070a143a4545dec3b715d81752b
Author: Christophe Troestler 
Commit: Christophe Troestler 

tuareg-other-file-alist: Fix typo
---
 tuareg.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tuareg.el b/tuareg.el
index fb9d76b..de7bd1e 100644
--- a/tuareg.el
+++ b/tuareg.el
@@ -246,7 +246,7 @@ much less efficient."
 
 (defcustom tuareg-other-file-alist
   '(("\\.\\(?:pp\\.\\)?mli\\'" (".ml" ".mll" ".mly" ".pp.ml"))
-("\\.\\(?:pp\\.\\)ml\\'" (".mli"))
+("\\.\\(?:pp\\.\\)?ml\\'" (".mli"))
 ("\\.mll\\'" (".mli"))
 ("\\.mly\\'" (".mli"))
 ("\\.eliomi\\'" (".eliom"))



[nongnu] elpa/tuareg 872beee 1/2: ocamldebug: minor cleanup

2021-09-01 Thread ELPA Syncer
branch: elpa/tuareg
commit 872beee8d078ba1609a0f688eddc40efa564c511
Author: Christophe Troestler 
Commit: Christophe Troestler 

ocamldebug: minor cleanup
---
 ocamldebug.el | 59 +++
 1 file changed, 27 insertions(+), 32 deletions(-)

diff --git a/ocamldebug.el b/ocamldebug.el
index b1f4309..82faef8 100644
--- a/ocamldebug.el
+++ b/ocamldebug.el
@@ -38,9 +38,10 @@
 
 (require 'comint)
 (require 'shell)
-(require 'tuareg (expand-file-name
-  "tuareg" (file-name-directory (or load-file-name
-
byte-compile-current-file
+(require 'tuareg (expand-file-name "tuareg" (file-name-directory
+ (or load-file-name
+ byte-compile-current-file
+ buffer-file-name
 (require 'derived)
 
 ;;; Variables.
@@ -112,7 +113,6 @@
 map))
 
 (define-derived-mode ocamldebug-mode comint-mode "OCaml-Debugger"
-
   "Major mode for interacting with an ocamldebug process.
 
 The following commands are available:
@@ -202,11 +202,10 @@ representation is simply concatenated with the COMMAND."
   "@ \"%m\" # %c")
 
 (defun ocamldebug-kill-filter (string)
-  ;gob up stupid questions :-)
+  ;; Gob up stupid questions :-)
   (setq ocamldebug-filter-accumulator
(concat ocamldebug-filter-accumulator string))
-  (when (string-match "\\(.* \\)(y or n) "
-  ocamldebug-filter-accumulator)
+  (when (string-match "\\(.* \\)(y or n) " ocamldebug-filter-accumulator)
 (setq ocamldebug-kill-output
  (cons t (match-string 1 ocamldebug-filter-accumulator)))
 (setq ocamldebug-filter-accumulator ""))
@@ -225,7 +224,7 @@ representation is simply concatenated with the COMMAND."
 (defun ocamldebug-kill ()
   "Kill the program."
   (interactive)
-  (let ((ocamldebug-kill-output))
+  (let (ocamldebug-kill-output)
 (with-current-buffer ocamldebug-current-buffer
   (let ((proc (get-buffer-process (current-buffer)))
(ocamldebug-filter-function #'ocamldebug-kill-filter))
@@ -240,7 +239,7 @@ representation is simply concatenated with the COMMAND."
 ;;FIXME: ocamldebug doesn't output the Hide marker on kill
 
 (defun ocamldebug-goto-filter (string)
-  ;accumulate onto previous output
+  ;; Accumulate onto previous output
   (setq ocamldebug-filter-accumulator
(concat ocamldebug-filter-accumulator string))
   (when (or (string-match (concat
@@ -257,8 +256,7 @@ representation is simply concatenated with the COMMAND."
  (match-string 2 ocamldebug-filter-accumulator))
 (setq ocamldebug-filter-accumulator
  (substring ocamldebug-filter-accumulator (1- (match-end 0)
-  (when (string-match comint-prompt-regexp
-  ocamldebug-filter-accumulator)
+  (when (string-match comint-prompt-regexp ocamldebug-filter-accumulator)
 (setq ocamldebug-goto-output (or ocamldebug-goto-output 'fail))
 (setq ocamldebug-filter-accumulator ""))
   (when (string-match "\n\\(.*\\)\\'" ocamldebug-filter-accumulator)
@@ -268,7 +266,6 @@ representation is simply concatenated with the COMMAND."
 
 (def-ocamldebug "goto" "\C-g")
 (defun ocamldebug-goto (&optional time)
-
   "Go to the execution time TIME.
 
 Without TIME, the command behaves as follows: In the ocamldebug buffer,
@@ -278,7 +275,6 @@ time associated in execution history with the current point 
location.
 
 With a negative TIME, move that many lines backward in the ocamldebug
 buffer, then try to obtain the time from context around point."
-
   (interactive "P")
   (cond
(time
@@ -293,25 +289,25 @@ buffer, then try to obtain the time from context around 
point."
  (error "I don't have %d times in my history"
 (- 1 ntime
((eq (current-buffer) ocamldebug-current-buffer)
-  (let ((time (cond
-  ((eobp) 0)
-  ((save-excursion
- (beginning-of-line 1)
- (looking-at "^Time : \\([0-9]+\\) - pc : [0-9]+ "))
-   (string-to-number (match-string 1)))
-  ((string-to-number (ocamldebug-format-command "%e"))
-   (ocamldebug-call "goto" nil time)))
+(let ((time (cond
+((eobp) 0)
+((save-excursion
+   (beginning-of-line 1)
+   (looking-at "^Time : \\([0-9]+\\) - pc : [0-9]+ "))
+ (string-to-number (match-string 1)))
+((string-to-number (ocamldebug-format-command "%e"))
+  (ocamldebug-call "goto" nil time)))
(t
 (let ((module (ocamldebug-module-name (buffer-file-name)))
  (ocamldebug-goto-position (int-to-string (1- (point
- (ocamldebug-goto-output) (address))
-  ;get a list of all events in the current module
+ ocamldebug-goto-output address)
+  ;; Get a l

[nongnu] elpa/tuareg updated (f72ed44 -> 59446ec)

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

  from  f72ed44   Remove nuisance message from .elc build rule
   new  872beee   ocamldebug: minor cleanup
   new  59446ec   tuareg-other-file-alist: Fix typo


Summary of changes:
 ocamldebug.el | 59 +++
 tuareg.el |  2 +-
 2 files changed, 28 insertions(+), 33 deletions(-)



[elpa] externals/setup 7896b50: Use setup-ensure-function in :local-hook

2021-09-01 Thread ELPA Syncer
branch: externals/setup
commit 7896b509c5975d7875cb61d3b05b0e30b12b034d
Author: Philip Kaludercic 
Commit: Philip Kaludercic 

Use setup-ensure-function in :local-hook
---
 setup.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.el b/setup.el
index 03266cb..cdca915 100644
--- a/setup.el
+++ b/setup.el
@@ -522,7 +522,7 @@ supported:
   (lambda (hook function)
 `(add-hook ',(setup-get 'hook)
(lambda ()
- (add-hook ',hook #',function nil t
+ (add-hook ',hook ,(setup-ensure-function function) nil t
   :documentation "Add FUNCTION to HOOK only in buffers of the current mode."
   :debug '(symbolp sexp)
   :repeatable t)



[elpa] externals/org d70f280: org-macs: Allow for nil ffap-url-regexp

2021-09-01 Thread ELPA Syncer
branch: externals/org
commit d70f2806788dce06871287ef02c88ee08076dffc
Author: TEC 
Commit: TEC 

org-macs: Allow for nil ffap-url-regexp

* lisp/org-macs.el (org-url-p): `ffap-url-regexp' is allowed to be nil,
which is taken to mean urls should not be matched.  When this is set,
`string-match-p' errors.  To consider this case correctly, we check that
`ffap-url-regexp' is non-nil before calling `string-match-p'.

Reported-by: "Peder Stray" 

---
 lisp/org-macs.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 77458db..65db8f8 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -811,7 +811,7 @@ return nil."
 (defun org-url-p (s)
   "Non-nil if string S is a URL."
   (require 'ffap)
-  (string-match-p ffap-url-regexp s))
+  (and ffap-url-regexp (string-match-p ffap-url-regexp s)))
 
 
 ;;; String manipulation



[nongnu] main a4124a5: * Makefile (gnu-elpa git): Fix URL for elpa.git

2021-09-01 Thread monnier--- via
branch: main
commit a4124a544eb0191145d4ba9a92b56d45759eacdc
Author: Stefan Monnier 
Commit: Stefan Monnier 

* Makefile (gnu-elpa git): Fix URL for elpa.git

Use The `git` transport because it is significantly faster (in terms of
time before the transfer starts, which can take about a minute when
using `https`).
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 1abc6f3..24f8fe5 100644
--- a/Makefile
+++ b/Makefile
@@ -6,5 +6,5 @@ GNUmakefile: admin
 
 admin:
git remote add --no-tags -ft elpa-admin \
-   gnu-elpa https://git.sv.gnu.org/r/emacs/elpa.git
+   gnu-elpa git://git.sv.gnu.org/emacs/elpa.git
git worktree add -b elpa-admin admin gnu-elpa/elpa-admin



[nongnu] elpa/editorconfig 2ab86dc: Update CHANGELOG

2021-09-01 Thread ELPA Syncer
branch: elpa/editorconfig
commit 2ab86dc9a8ed7a669ca348252d4af46522b5c411
Author: 10sr <8.slas...@gmail.com>
Commit: 10sr <8.slas...@gmail.com>

Update CHANGELOG
---
 CHANGELOG.md | 4 
 1 file changed, 4 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b22162..bad2e15 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,10 @@ and this project adheres to [Semantic 
Versioning](https://semver.org/spec/v2.0.0
 
 ### Changed
 
+- Use new implementation by default (#263)
+  - Set `(setq editorconfig--legacy-version t)` to use previous one
+
+
 ### Deprecated
 
 ### Removed



[elpa] externals/rec-mode 646962c: fix ; ; ; ###autoload tag in rec-mode.el

2021-09-01 Thread ELPA Syncer
branch: externals/rec-mode
commit 646962cff4f728cfa56c72ed43de8936713c8bb6
Author: Jose E. Marchesi 
Commit: Jose E. Marchesi 

fix ;;;###autoload tag in rec-mode.el

Problem and patch reported by Stefan Monnier.
---
 rec-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rec-mode.el b/rec-mode.el
index 8806fb2..86f284a 100644
--- a/rec-mode.el
+++ b/rec-mode.el
@@ -64,7 +64,7 @@
 Valid values are `edit' and `navigation'.  The default is `navigation'"
   :type 'symbol
   :safe (lambda (x) (member x '(edit navigation
-;;;###autoload (put rec-open-mode 'safe-local-variable (lambda (x) (member x 
'(edit navigation))
+;;;###autoload (put 'rec-open-mode 'safe-local-variable (lambda (x) (member x 
'(edit navigation
 
 (defcustom rec-popup-calendar t
   "Whether to use a popup calendar to select dates when editing field values.



[elpa] externals/company updated (4377506 -> faf8972)

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

  from  4377506   Merge pull request #1203 from yugaego/docstring
   new  4dd5ddb   Add CONTRIBUTING file
   new  d9f4a22   Merge pull request #1207 from yugaego/contribute
   new  757a6f3   Add a link from README
   new  faf8972   Avoid mentioning company-lsp (I hear it's deprecated)


Summary of changes:
 CONTRIBUTING.md | 69 +
 README.md   |  2 ++
 2 files changed, 71 insertions(+)
 create mode 100644 CONTRIBUTING.md



[elpa] externals/company 4dd5ddb 1/4: Add CONTRIBUTING file

2021-09-01 Thread ELPA Syncer
branch: externals/company
commit 4dd5ddb23b7a4ddb2b290e30234ffec4dd846964
Author: YE 
Commit: YE 

Add CONTRIBUTING file
---
 CONTRIBUTING.md | 69 +
 1 file changed, 69 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000..e01bb99
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,69 @@
+# Contributing to Company
+
+### Fixes and Improvements
+
+You're welcome to open a [`pull 
request`](https://docs.github.com/en/github/collaborating-with-pull-requests)
+or send a patch with the changes.  
+For non-trivial updates, please clearly describe the problem and the solution.
+
+If you're looking for *a challenge*, go grab an Issue with the
+[`wishlist` 
label](https://github.com/company-mode/company-mode/issues?q=is%3Aissue+is%3Aopen+label%3Awishlist).
+
+If you have *a question* on where to start implementing a feature,
+ask in a related [Issue](https://github.com/company-mode/company-mode/issues)
+or create a new 
[Discussion](https://github.com/company-mode/company-mode/discussions).
+
+
+### Documentation
+
+Help on improving, fixing, and writing documentation is also wanted.  
+See these ideas on where to start:
+- Add and edit pages in [`Company` 
Wiki](https://github.com/company-mode/company-mode/wiki).
+- Share your findings in 
[`Discussions`](https://github.com/company-mode/company-mode/discussions/categories/show-and-tell).
+- Write a [manual](https://github.com/company-mode/company-mode/issues/926).
+
+
+### Backend Integration
+
+New backends are rarely accepted for inclusion into `Company` at this stage.
+
+Our common recommendation for new backends is one of the following:
+- Publish a backend to (M)ELPA.
+- Create a `*-completion-at-point` function for a call by 
`completion-at-point-functions`.
+
+Feel free to [ask](https://github.com/company-mode/company-mode/discussions)
+if you're hesitating which approach to choose.
+
+
+### Guidelines for Third-Party Packages
+
+This section was born as a result of the question asked in
+[Issue #923](https://github.com/company-mode/company-mode/issues/923).
+
+There are two preferred ways to integrate a third-party package with `Company`.
+
+1. Use `completion-at-point-functions` and convey extra information through the
+`:company-*` additional properties (like e.g. `elisp-completion-at-point` 
does).
+In this scenario, some minor mode can and should call `add-hook`.
+
+2. Define a `Company` backend (as described in `Commentary` at the top of
+`company.el` and in `company-backends` docstring).
+Then, in the documentation, describe how you recommend it to be used.
+
+
+Buffer-local values are allowed, but usually not necessary.  
+If a backend is added globally, checking a major mode in the prefix function 
is a must.
+
+Examples:
+- https://github.com/tigersoldier/company-lsp#usage
+- https://github.com/pythonic-emacs/company-anaconda#usage
+
+
+### Copyright Assignment
+
+`Company` is subject to the same [copyright 
assignment](https://www.fsf.org/licensing/contributor-faq)
+policy as `GNU Emacs`.
+
+Any [legally 
significant](https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html#Legally-Significant)
+contributions can only be merged after the author has completed their 
paperwork.
+Please ask for the request form, and we'll send it to you.



[elpa] externals/company 757a6f3 3/4: Add a link from README

2021-09-01 Thread ELPA Syncer
branch: externals/company
commit 757a6f35049314cf80ec3c67d2f47ba5c8fba690
Author: Dmitry Gutov 
Commit: Dmitry Gutov 

Add a link from README
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index ea1db88..a0f9125 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,8 @@ File a bug report in 
[Issues](https://github.com/company-mode/company-mode/issue
 
 Ask a question or suggest a feature in 
[Discussions](https://github.com/company-mode/company-mode/discussions/).
 
+See 
[Contributing](https://github.com/company-mode/company-mode/blob/master/CONTRIBUTING.md)
 on other ways to help out.
+
 [![Build 
Status](https://github.com/company-mode/company-mode/actions/workflows/ci.yml/badge.svg)](https://github.com/company-mode/company-mode/actions/workflows/ci.yml)
 [![GNU 
Emacs](https://img.shields.io/static/v1?logo=gnuemacs&logoColor=fafafa&label=Made%20for&message=GNU%20Emacs&color=7F5AB6&style=flat)](https://www.gnu.org/software/emacs/)
 
[![MELPA](https://melpa.org/packages/company-badge.svg)](https://melpa.org/#/company)



[elpa] externals/company d9f4a22 2/4: Merge pull request #1207 from yugaego/contribute

2021-09-01 Thread ELPA Syncer
branch: externals/company
commit d9f4a22e717b5ad2d4d74710ba98d0d8281a81b1
Merge: 4377506 4dd5ddb
Author: Dmitry Gutov 
Commit: GitHub 

Merge pull request #1207 from yugaego/contribute

Add CONTRIBUTING file
---
 CONTRIBUTING.md | 69 +
 1 file changed, 69 insertions(+)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000..e01bb99
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,69 @@
+# Contributing to Company
+
+### Fixes and Improvements
+
+You're welcome to open a [`pull 
request`](https://docs.github.com/en/github/collaborating-with-pull-requests)
+or send a patch with the changes.  
+For non-trivial updates, please clearly describe the problem and the solution.
+
+If you're looking for *a challenge*, go grab an Issue with the
+[`wishlist` 
label](https://github.com/company-mode/company-mode/issues?q=is%3Aissue+is%3Aopen+label%3Awishlist).
+
+If you have *a question* on where to start implementing a feature,
+ask in a related [Issue](https://github.com/company-mode/company-mode/issues)
+or create a new 
[Discussion](https://github.com/company-mode/company-mode/discussions).
+
+
+### Documentation
+
+Help on improving, fixing, and writing documentation is also wanted.  
+See these ideas on where to start:
+- Add and edit pages in [`Company` 
Wiki](https://github.com/company-mode/company-mode/wiki).
+- Share your findings in 
[`Discussions`](https://github.com/company-mode/company-mode/discussions/categories/show-and-tell).
+- Write a [manual](https://github.com/company-mode/company-mode/issues/926).
+
+
+### Backend Integration
+
+New backends are rarely accepted for inclusion into `Company` at this stage.
+
+Our common recommendation for new backends is one of the following:
+- Publish a backend to (M)ELPA.
+- Create a `*-completion-at-point` function for a call by 
`completion-at-point-functions`.
+
+Feel free to [ask](https://github.com/company-mode/company-mode/discussions)
+if you're hesitating which approach to choose.
+
+
+### Guidelines for Third-Party Packages
+
+This section was born as a result of the question asked in
+[Issue #923](https://github.com/company-mode/company-mode/issues/923).
+
+There are two preferred ways to integrate a third-party package with `Company`.
+
+1. Use `completion-at-point-functions` and convey extra information through the
+`:company-*` additional properties (like e.g. `elisp-completion-at-point` 
does).
+In this scenario, some minor mode can and should call `add-hook`.
+
+2. Define a `Company` backend (as described in `Commentary` at the top of
+`company.el` and in `company-backends` docstring).
+Then, in the documentation, describe how you recommend it to be used.
+
+
+Buffer-local values are allowed, but usually not necessary.  
+If a backend is added globally, checking a major mode in the prefix function 
is a must.
+
+Examples:
+- https://github.com/tigersoldier/company-lsp#usage
+- https://github.com/pythonic-emacs/company-anaconda#usage
+
+
+### Copyright Assignment
+
+`Company` is subject to the same [copyright 
assignment](https://www.fsf.org/licensing/contributor-faq)
+policy as `GNU Emacs`.
+
+Any [legally 
significant](https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html#Legally-Significant)
+contributions can only be merged after the author has completed their 
paperwork.
+Please ask for the request form, and we'll send it to you.



[elpa] externals/company faf8972 4/4: Avoid mentioning company-lsp (I hear it's deprecated)

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

Avoid mentioning company-lsp (I hear it's deprecated)

#1207
---
 CONTRIBUTING.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e01bb99..2e372fe 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -55,8 +55,8 @@ Buffer-local values are allowed, but usually not necessary.
 If a backend is added globally, checking a major mode in the prefix function 
is a must.
 
 Examples:
-- https://github.com/tigersoldier/company-lsp#usage
 - https://github.com/pythonic-emacs/company-anaconda#usage
+- https://github.com/vspinu/company-math#activation
 
 
 ### Copyright Assignment



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

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

  from  ceb2b98   Merge branch 'fix' into 'master'
   new  4e9bb3b   fix user clean up on disconnect-because-of-error
   new  a4a07fb   Improve error handling
   new  50e6d90   Merge branch 'fix' into 'master'
   new  4797413   bump version number


Summary of changes:
 HACKING.org |  12 +++-
 crdt.el | 101 
 2 files changed, 72 insertions(+), 41 deletions(-)



[elpa] externals/crdt 4e9bb3b 1/4: fix user clean up on disconnect-because-of-error

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

fix user clean up on disconnect-because-of-error
---
 crdt.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/crdt.el b/crdt.el
index 458834c..42d09e7 100644
--- a/crdt.el
+++ b/crdt.el
@@ -1494,7 +1494,6 @@ Handle received STRING from PROCESS."
   ;; client disconnected
   (setf (crdt--session-network-clients crdt--session)
 (delq client (crdt--session-network-clients crdt--session)))
-  (when (process-buffer client) (kill-buffer (process-buffer client)))
   ;; generate a clear cursor message and a clear contact message
   (let* ((client-id (process-get client 'client-id))
  (clear-contact-message `(contact ,client-id nil)))
@@ -1505,7 +1504,8 @@ Handle received STRING from PROCESS."
 `(cursor ,k ,client-id 1 nil 1 nil)
 client))
  (crdt--session-buffer-table crdt--session))
-(crdt--refresh-users-maybe)
+(crdt--refresh-users-maybe))
+  (when (process-buffer client) (kill-buffer (process-buffer client))
 
 (defun crdt--client-process-sentinel (process _message)
   (unless (eq (process-status process) 'open)



[elpa] externals/crdt 4797413 4/4: bump version number

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

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

diff --git a/crdt.el b/crdt.el
index d4da1f9..f70e801 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.3
+;; Version: 0.1.4
 
 ;; This file is part of GNU Emacs.
 



[elpa] externals/crdt 50e6d90 3/4: Merge branch 'fix' into 'master'

2021-09-01 Thread ELPA Syncer
branch: externals/crdt
commit 50e6d90df5cfa4336286bdef84746da6b3450f9a
Merge: ceb2b98 a4a07fb
Author: Qiantan Hong 
Commit: Qiantan Hong 

Merge branch 'fix' into 'master'

Fix

See merge request qhong/crdt.el!4
---
 HACKING.org | 12 +++-
 crdt.el | 99 +
 2 files changed, 71 insertions(+), 40 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index eab1b13..e066ddb 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 458834c..d4da1f9 100644
--- a/crdt.el
+++ b/crdt.el
@@ -344,6 +344,9 @@ 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
@@ -465,9 +468,7 @@ If such buffer doesn't exist yet, do nothing."
(widen)
(condition-case err
,(cons 'progn body)
- (error (if (crdt--server-p)
-(signal (car err) (cdr err)) ; didn't implement server 
side recovery yet
-  (crdt--client-recover)
+ (error (crdt--recover err
 
 (defmacro crdt--with-buffer-name-pull (name &rest body)
   "Find CRDT shared buffer associated with NAME and evaluate BODY in it.
@@ -1138,14 +1139,25 @@ Verify that CRDT IDs in a document follows ascending 
order."
 
 ;;; Recovery
 
-(defun crdt--client-recover ()
-  "Try to recover from a synchronization failure from a client.
+(defun crdt--recover (&optional err)
+  "Try to recover from a synchronization failure.
 Current buffer is assmuned to be the one with synchronization error."
-  (ding)
-  (read-only-mode)
-  (message "Synchronization error detected, try recovering...")
-  (crdt--broadcast-maybe
-   (crdt--format-message `(get ,crdt--buffer-network-name
+  (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))
+  (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
 
@@ -1302,7 +1314,8 @@ The network process for the client connection is PROCESS."
 
 (cl-defmethod crdt-process-message (message process)
   (message "Unrecognized message %S from %s:%s."
-   message (process-contact process :host) (process-contact process 
:service)))
+   message (process-contact process :host) (process-contact process 
:service))
+  (signal 'crdt-unrecognized-message nil))
 
 (cl-defmethod crdt-process-message ((message (head insert)) process)
   (cl-destructuring-bind (buffer-name crdt-id position-hint content) (cdr 
message)
@@ -1349,7 +1362,7 @@ The network process for the client connection is PROCESS."
 (lambda ()
   (goto-char
(max (min pos (point-max))
-(point-max)))
+(point-min)))
 

[elpa] externals/crdt a4a07fb 2/4: Improve error handling

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

Improve error handling

- add error recovery to protocol
- server side error handling (by sending the client an error message)
- fix a stupid typo for the crdt--buffer-sync-callback to relocate cursor
---
 HACKING.org | 12 +++-
 crdt.el | 95 +
 2 files changed, 69 insertions(+), 38 deletions(-)

diff --git a/HACKING.org b/HACKING.org
index eab1b13..e066ddb 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 42d09e7..d4da1f9 100644
--- a/crdt.el
+++ b/crdt.el
@@ -344,6 +344,9 @@ 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
@@ -465,9 +468,7 @@ If such buffer doesn't exist yet, do nothing."
(widen)
(condition-case err
,(cons 'progn body)
- (error (if (crdt--server-p)
-(signal (car err) (cdr err)) ; didn't implement server 
side recovery yet
-  (crdt--client-recover)
+ (error (crdt--recover err
 
 (defmacro crdt--with-buffer-name-pull (name &rest body)
   "Find CRDT shared buffer associated with NAME and evaluate BODY in it.
@@ -1138,14 +1139,25 @@ Verify that CRDT IDs in a document follows ascending 
order."
 
 ;;; Recovery
 
-(defun crdt--client-recover ()
-  "Try to recover from a synchronization failure from a client.
+(defun crdt--recover (&optional err)
+  "Try to recover from a synchronization failure.
 Current buffer is assmuned to be the one with synchronization error."
-  (ding)
-  (read-only-mode)
-  (message "Synchronization error detected, try recovering...")
-  (crdt--broadcast-maybe
-   (crdt--format-message `(get ,crdt--buffer-network-name
+  (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))
+  (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
 
@@ -1302,7 +1314,8 @@ The network process for the client connection is PROCESS."
 
 (cl-defmethod crdt-process-message (message process)
   (message "Unrecognized message %S from %s:%s."
-   message (process-contact process :host) (process-contact process 
:service)))
+   message (process-contact process :host) (process-contact process 
:service))
+  (signal 'crdt-unrecognized-message nil))
 
 (cl-defmethod crdt-process-message ((message (head insert)) process)
   (cl-destructuring-bind (buffer-name crdt-id position-hint content) (cdr 
message)
@@ -1349,7 +1362,7 @@ The network process for the client connection is PROCESS."
 (lambda ()
   (goto-char
(max (min pos (point-