[elpa] externals/consult updated (8c6c63b613 -> 8d0e5a547d)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/consult.

  from  8c6c63b613 consult--jump: Always copy marker before push-mark to be 
safe (See #562)
   new  4b3e4bb7c8 Convert marker to number instead of copying it 
unnecessarily
   new  8d0e5a547d consult--jump-1: Minor cleanup


Summary of changes:
 consult.el | 23 +++
 1 file changed, 11 insertions(+), 12 deletions(-)



[elpa] externals/consult 8d0e5a547d 2/2: consult--jump-1: Minor cleanup

2022-04-28 Thread ELPA Syncer
branch: externals/consult
commit 8d0e5a547dec6cde5111f1a314ba7c22af21
Author: Daniel Mendler 
Commit: Daniel Mendler 

consult--jump-1: Minor cleanup
---
 consult.el | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/consult.el b/consult.el
index 2d12e71a8f..d7810962bf 100644
--- a/consult.el
+++ b/consult.el
@@ -1263,19 +1263,17 @@ See `isearch-open-necessary-overlays' and 
`isearch-open-overlay-temporary'."
 
 (defun consult--jump-1 (pos)
   "Go to POS and recenter."
-  (cond
-   ((and (markerp pos) (not (marker-buffer pos)))
-;; Only print a message, no error in order to not mess
-;; with the minibuffer update hook.
-(message "Buffer is dead"))
-   (t
+  (if (and (markerp pos) (not (marker-buffer pos)))
+  ;; Only print a message, no error in order to not mess
+  ;; with the minibuffer update hook.
+  (message "Buffer is dead")
 ;; Switch to buffer if it is not visible
 (when (and (markerp pos) (not (eq (current-buffer) (marker-buffer pos
   (consult--buffer-action (marker-buffer pos) 'norecord))
 ;; Widen if we cannot jump to the position (idea from 
flycheck-jump-to-error)
 (unless (= (goto-char pos) (point))
   (widen)
-  (goto-char pos)
+  (goto-char pos
 
 (defun consult--jump (pos)
   "Push current position to mark ring, go to POS and recenter."



[elpa] externals/org a0b8adf08a 1/2: org-fold: Reveal hidden macro markers

2022-04-28 Thread ELPA Syncer
branch: externals/org
commit a0b8adf08a5278aa1498eb0e56c412e3dccc017d
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-fold: Reveal hidden macro markers

* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Unfold hidden macro markers on invisible edit.
---
 lisp/org-fold.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index 9abf97c3cc..67b8b582c0 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -833,7 +833,9 @@ DETAIL is either nil, `minimal', `local', `ancestors',
 (let (org-hide-emphasis-markers
   org-link-descriptive
   org-pretty-entities
+  org-hide-macro-markers
   (region (or (org-find-text-property-region (point) 'org-emphasis)
+  (org-find-text-property-region (point) 'org-macro)
   (org-find-text-property-region (point) 'invisible)
   region)))
   (when region



[elpa] externals/org updated (1ed9e42238 -> 782a661921)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  1ed9e42238 org-todo: Fix point moving after setting todo keyword in 
empty heading
   new  a0b8adf08a org-fold: Reveal hidden macro markers
   new  782a661921 org-fold-show-set-visibility: Do not reveal emphasis 
unless DETAIL is `local'


Summary of changes:
 lisp/ol.el   |  2 +-
 lisp/org-fold.el | 33 +
 2 files changed, 22 insertions(+), 13 deletions(-)



[elpa] externals/org 782a661921 2/2: org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL is `local'

2022-04-28 Thread ELPA Syncer
branch: externals/org
commit 782a6619216c651846661d933ac27c03b8c8b075
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL is 
`local'

* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Prevent revealing hidden emphasis unless requested DETAIL is `local'.
* lisp/ol.el (org-next-link): Honour `org-fold-show-context-detail'.

Reported in 
https://orgmode.org/list/626a0713.1c69fb81.a3583.1a07smtpin_added_bro...@mx.google.com
---
 lisp/ol.el   |  2 +-
 lisp/org-fold.el | 35 +--
 2 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/lisp/ol.el b/lisp/ol.el
index 22eaae8fbf..d4bd0e40c2 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -1456,7 +1456,7 @@ is non-nil, move backward."
(`nil nil)
(link
 (goto-char (org-element-property :begin link))
-(when (org-invisible-p) (org-fold-show-context))
+(when (org-invisible-p) (org-fold-show-context 'link-search))
 (throw :found t)
   (goto-char pos)
   (setq org-link--search-failed t)
diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index 67b8b582c0..9739bbed2d 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -830,21 +830,28 @@ DETAIL is either nil, `minimal', `local', `ancestors',
   (redisplay)
   (let ((region (org-fold-get-region-at-point)))
 ;; Reveal emphasis markers.
-(let (org-hide-emphasis-markers
-  org-link-descriptive
-  org-pretty-entities
-  org-hide-macro-markers
-  (region (or (org-find-text-property-region (point) 'org-emphasis)
-  (org-find-text-property-region (point) 'org-macro)
-  (org-find-text-property-region (point) 'invisible)
-  region)))
-  (when region
-(org-with-point-at (car region)
-  (beginning-of-line)
-  (let (font-lock-extend-region-functions)
-(font-lock-fontify-region (max (point-min) (1- (car region))) 
(cdr region))
+(when (eq detail 'local)
+  (let (org-hide-emphasis-markers
+org-link-descriptive
+org-pretty-entities
+org-hide-macro-markers
+(region (or (org-find-text-property-region (point) 
'org-emphasis)
+(org-find-text-property-region (point) 'org-macro)
+(org-find-text-property-region (point) 'invisible)
+region)))
+(when region
+  (org-with-point-at (car region)
+(beginning-of-line)
+(let (font-lock-extend-region-functions)
+  (font-lock-fontify-region (max (point-min) (1- (car 
region))) (cdr region))
+  ;; Unfold links.
+  (dolist (spec '(org-link org-link-description))
+(org-fold-region (car region) (cdr region) nil spec)))
 (when region
-  (org-fold-region (car region) (cdr region) nil
+  (dolist (spec (org-fold-core-folding-spec-list))
+;; Links are taken care by above.
+(unless (memq spec '(org-link org-link-description))
+  (org-fold-region (car region) (cdr region) nil spec))
 (unless (org-before-first-heading-p)
   (org-with-limited-levels
(cl-case detail



[elpa] externals/consult 4b3e4bb7c8 1/2: Convert marker to number instead of copying it unnecessarily

2022-04-28 Thread ELPA Syncer
branch: externals/consult
commit 4b3e4bb7c8cf1d13dad17711ef7eb0d7305c5338
Author: Daniel Mendler 
Commit: Daniel Mendler 

Convert marker to number instead of copying it unnecessarily
---
 consult.el | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/consult.el b/consult.el
index f164bc0e74..2d12e71a8f 100644
--- a/consult.el
+++ b/consult.el
@@ -1280,12 +1280,13 @@ See `isearch-open-necessary-overlays' and 
`isearch-open-overlay-temporary'."
 (defun consult--jump (pos)
   "Push current position to mark ring, go to POS and recenter."
   (when pos
-;; When the marker is in the same buffer,
-;; record previous location such that the user can jump back quickly.
-(unless (and (markerp pos) (not (eq (current-buffer) (marker-buffer pos
+;; When the marker is in the same buffer, record previous location
+;; such that the user can jump back quickly.
+(when (or (not (markerp pos)) (eq (current-buffer) (marker-buffer pos)))
   ;; push-mark mutates markers in the mark-ring and the mark-marker.
-  ;; Therefore we copy the marker to be safe. We all love side effects!
-  (setq pos (copy-marker pos))
+  ;; Therefore we transform the marker to a number to be safe.
+  ;; We all love side effects!
+  (setq pos (+ pos 0))
   (push-mark (point) t))
 (consult--jump-1 pos)
 (consult--invisible-open-permanently)



[elpa] externals/hyperbole 4049bd9472: Add hui-copy-to-register tests (#193)

2022-04-28 Thread ELPA Syncer
branch: externals/hyperbole
commit 4049bd9472508f6a5a9950c8c03f7b76f3538a1a
Author: Mats Lidell 
Commit: GitHub 

Add hui-copy-to-register tests (#193)
---
 ChangeLog |   8 +
 test/hui-tests.el | 103 +-
 2 files changed, 110 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 7e14052086..e61bf06f05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-04-27  Mats Lidell  
+
+* test/hui-tests.el (hui--copy-to-register--yank-in-same-kotl)
+(hui--copy-to-register--yank-in-other-kotl)
+(hui--copy-to-register--yank-in-other-file)
+(hui--copy-to-register--yank-in-other-file-other-dir): Add
+hui-copy-to-register tests.
+
 2022-04-26  Mats Lidell  
 
 * test/hui-tests.el (hui--kill-ring-save--yank-in-same-kotl)
diff --git a/test/hui-tests.el b/test/hui-tests.el
index d9ef10edbd..ad28b4ebd6 100644
--- a/test/hui-tests.el
+++ b/test/hui-tests.el
@@ -3,7 +3,7 @@
 ;; Author:   Mats Lidell 
 ;;
 ;; Orig-Date:30-Jan-21 at 12:00:00
-;; Last-Mod: 25-Apr-22 at 23:50:46 by Mats Lidell
+;; Last-Mod: 27-Apr-22 at 23:24:09 by Mats Lidell
 ;;
 ;; Copyright (C) 2021-2022  Free Software Foundation, Inc.
 ;; See the "HY-COPY" file for license information.
@@ -411,6 +411,107 @@ Ensure modifying the button but keeping the label does 
not create a double label
   (delete-file other-file)
   (delete-directory other-dir
 
+(ert-deftest hui--copy-to-register--yank-in-same-kotl ()
+  "Yank klink in register into same kotl file."
+  (skip-unless (not noninteractive))
+  (let ((kotl-file (make-temp-file "hypb" nil ".kotl")))
+(unwind-protect
+(progn
+  (find-file kotl-file)
+  (klink:create "1")
+  (kotl-mode:beginning-of-cell)
+
+  (forward-char 1)
+  (with-mock
+(mock (register-read-with-preview  "Copy to register: ") => ?a)
+(call-interactively #'hui-copy-to-register))
+
+  (kotl-mode:add-cell)
+  (insert-register ?a)
+  (kotl-mode:beginning-of-cell)
+  (should (looking-at-p "<@ 1>"))
+  (forward-char 1)
+  (should (equal (hattr:get (hbut:at-p) 'actype) 'klink:act)))
+  (delete-file kotl-file
+
+(ert-deftest hui--copy-to-register--yank-in-other-kotl ()
+  "Yank klink in register into other kotl file."
+  (skip-unless (not noninteractive))
+  (let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
+(other-file (make-temp-file "hypb" nil ".kotl")))
+(unwind-protect
+(progn
+  (find-file kotl-file)
+  (klink:create "1")
+  (kotl-mode:beginning-of-cell)
+
+  (forward-char 1)
+  (with-mock
+(mock (register-read-with-preview  "Copy to register: ") => ?a)
+(call-interactively #'hui-copy-to-register))
+
+  (find-file other-file)
+  (insert-register ?a)
+  (kotl-mode:beginning-of-cell)
+  (should (looking-at-p (concat "<" (file-name-nondirectory kotl-file) 
", 1>")))
+  (forward-char 1)
+  (should (equal (hattr:get (hbut:at-p) 'actype) 'klink:act)))
+  (delete-file kotl-file)
+  (delete-file other-file
+
+(ert-deftest hui--copy-to-register--yank-in-other-file ()
+  "Yank klink in regiuster into other file."
+  (skip-unless (not noninteractive))
+  (let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
+(other-file (make-temp-file "hypb" nil ".txt")))
+(unwind-protect
+(progn
+  (find-file kotl-file)
+  (klink:create "1")
+  (kotl-mode:beginning-of-cell)
+
+  (forward-char 1)
+  (with-mock
+(mock (register-read-with-preview  "Copy to register: ") => ?a)
+(call-interactively #'hui-copy-to-register))
+
+  (find-file other-file)
+  (insert-register ?a)
+  (beginning-of-buffer)
+  (should (looking-at-p (concat "<" (file-name-nondirectory kotl-file) 
", 1>")))
+  (forward-char 1)
+  (should (equal (hattr:get (hbut:at-p) 'actype) 'klink:act)))
+  (delete-file kotl-file)
+  (delete-file other-file
+
+(ert-deftest hui--copy-to-register--yank-in-other-file-other-dir ()
+  "Yank klink in register into other file in other dir."
+  (skip-unless (not noninteractive))
+  (let ((kotl-file (make-temp-file "hypb" nil ".kotl"))
+(other-dir (make-temp-file "hypb" t))
+(other-file "other-file"))
+(unwind-protect
+(progn
+  (find-file kotl-file)
+  (klink:create "1")
+  (kotl-mode:beginning-of-cell)
+
+  (forward-char 1)
+  (with-mock
+(mock (register-read-with-preview  "Copy to register: ") => ?a)
+(call-interactively #'hui-copy-to-register))
+
+  (find-file (concat (file-name-as-directory other-dir) other-file))
+  (insert-register ?a)
+  (save-buffer 0)
+  (beginning-of-buffer)
+  (should 

[elpa] externals/tmr cbf80eca40 2/2: Add command tmr-with-description

2022-04-28 Thread ELPA Syncer
branch: externals/tmr
commit cbf80eca40037159ac2d61f1ca0bebd47631456b
Author: Damien Cassou 
Commit: Protesilaos Stavrou 

Add command tmr-with-description
---
 tmr.el | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/tmr.el b/tmr.el
index f0be4c8bb7..db06fd45b8 100644
--- a/tmr.el
+++ b/tmr.el
@@ -288,5 +288,19 @@ To cancel the timer, use the `tmr-cancel' command."
   tmr--timers)
 (tmr--log-in-buffer object-desc)))
 
+;;;###autoload
+(defun tmr-with-description (time description)
+  "Set timer to TIME duration and notify with DESCRIPTION after it elapses.
+
+See `tmr' for a description of the arguments. The difference
+between the two commands is that `tmr-with-description' always
+asks for a description whereas `tmr' only asks for it when the
+user uses a prefix argument (\\[universal-argument])."
+  (interactive
+   (list
+(read-string "N minutes for timer (append `h' or `s' for other units): ")
+(tmr--description-prompt)))
+  (tmr time description))
+
 (provide 'tmr)
 ;;; tmr.el ends here



[elpa] externals/cape 7f22485d61: Add cape-capf-accept-all Capf transformer

2022-04-28 Thread ELPA Syncer
branch: externals/cape
commit 7f22485d61ddee0063493a25d9800c67421d8a0a
Author: Daniel Mendler 
Commit: Daniel Mendler 

Add cape-capf-accept-all Capf transformer
---
 README.org |  1 +
 cape.el| 14 ++
 2 files changed, 15 insertions(+)

diff --git a/README.org b/README.org
index dedd3320de..9a15c72dc1 100644
--- a/README.org
+++ b/README.org
@@ -217,6 +217,7 @@ achieve a similarly refreshing strategy.
 ** Other Capf transformers
 
 - ~cape-interactive-capf~: Create a Capf which can be called interactively.
+- ~cape-wrap-accept-all~, ~cape-capf-accept-all~: Create a Capf which accepts 
every input as valid.
 - ~cape-wrap-silent~, ~cape-capf-silent~: Wrap a chatty Capf and silence it.
 - ~cape-wrap-purify~, ~cape-capf-purify~: Purify a broken Capf and ensure that 
it does not modify the buffer.
 - ~cape-wrap-noninterruptible~, ~cape-capf-noninterruptible:~ Protect a Capf 
which does not like to be interrupted.
diff --git a/cape.el b/cape.el
index fe0376460e..a216a998b6 100644
--- a/cape.el
+++ b/cape.el
@@ -108,6 +108,11 @@ The buffers are scanned for completion candidates by 
`cape-line'."
   (let ((completion-at-point-functions (list capf)))
 (or (completion-at-point) (user-error "%s: No completions" capf
 
+(defun cape--accept-all-table (table)
+  "Create completion TABLE which accepts all input."
+  (lambda (str pred action)
+(or (eq action 'lambda) (complete-with-action action table str pred
+
 (defun cape--noninterruptible-table (table)
   "Create non-interruptible completion TABLE."
   (lambda (str pred action)
@@ -728,11 +733,20 @@ If the prefix is long enough, enforce auto completion."
   (funcall capf))
   (buffer-read-only nil
 
+;;;###autoload
+(defun cape-wrap-accept-all (capf)
+  "Call CAPF and return a completion table which accepts every input."
+  (pcase (funcall capf)
+(`(,beg ,end ,table . ,plist)
+ `(,beg ,end ,(cape--accept-all-table table) . ,plist
+
 (defmacro cape--capf-wrapper (wrapper)
   "Create a capf transformer for WRAPPER."
   `(defun ,(intern (format "cape-capf-%s" wrapper)) (&rest args)
  (lambda () (apply #',(intern (format "cape-wrap-%s" wrapper)) args
 
+;;;###autoload (autoload 'cape-capf-accept-all "cape")
+(cape--capf-wrapper accept-all)
 ;;;###autoload (autoload 'cape-capf-buster "cape")
 (cape--capf-wrapper buster)
 ;;;###autoload (autoload 'cape-capf-case-fold "cape")



[elpa] externals/tmr cd19c0211b 1/2: Make playing sound optional

2022-04-28 Thread ELPA Syncer
branch: externals/tmr
commit cd19c0211b48d11e74ec1bf93ddc6d154cd0224d
Author: Damien Cassou 
Commit: Protesilaos Stavrou 

Make playing sound optional
---
 tmr.el | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tmr.el b/tmr.el
index 5720f33c63..f0be4c8bb7 100644
--- a/tmr.el
+++ b/tmr.el
@@ -76,8 +76,10 @@
 
 (defcustom tmr-sound-file
   "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"
-  "Path to sound file used by `tmr--play-sound'."
-  :type 'file
+  "Path to sound file used by `tmr--play-sound'.
+If nil, don't play any sound."
+  :type '(choice file
+ (const :tag "Off" nil))
   :group 'tmr)
 
 (defcustom tmr-notification-urgency 'normal
@@ -129,7 +131,7 @@ It should take two string arguments: the title and the 
message."
 ;; platforms and Emacs needs to be compiled --with-sound capabilities.
 (defun tmr--play-sound ()
   "Play `tmr-sound-file' using the 'ffplay' executable (ffmpeg)."
-  (let ((sound tmr-sound-file))
+  (when-let* ((sound tmr-sound-file))
 (when (file-exists-p sound)
   (unless (executable-find "ffplay")
 (user-error "Cannot play %s without `ffplay'" sound))



[elpa] externals/tmr updated (06cba12d4a -> cbf80eca40)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/tmr.

  from  06cba12d4a Add "Acknowledgements" section in the manual
   new  cd19c0211b Make playing sound optional
   new  cbf80eca40 Add command tmr-with-description


Summary of changes:
 tmr.el | 22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)



[nongnu] elpa/rust-mode updated (26ecc903c5 -> d17be3051b)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch elpa/rust-mode.

  from  26ecc903c5 update readme
   new  c29c1f7888 Use Eask for CI
   new  d0072d6033 Rename job
   new  a403e4ae51 Disable checkdoc and lint for now
   new  791a585991 ci: test
   new  46325b4350 fix network issue
   new  d17be3051b Merge pull request #444 from jcs-PR/ci-eask


Summary of changes:
 .github/workflows/test.yml | 20 ++-
 .gitignore |  4 +++
 Eask   | 16 
 Makefile   | 64 +++---
 4 files changed, 53 insertions(+), 51 deletions(-)
 create mode 100644 Eask



[nongnu] elpa/rust-mode a403e4ae51 3/6: Disable checkdoc and lint for now

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit a403e4ae516e3efff55941c3dbe05be10ddc1021
Author: Jen-Chieh Shen 
Commit: Jen-Chieh Shen 

Disable checkdoc and lint for now
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 876ea22497..9299917c61 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,8 @@ DEPS  =
 LOAD_PATH  ?= $(addprefix -L ../,$(DEPS))
 LOAD_PATH  += -L .
 
-ci: build compile checkdoc lint test
+# TODO: add checkdoc and lint
+ci: build compile checkdoc
 
 build:
$(EASK) package



[nongnu] elpa/rust-mode 791a585991 4/6: ci: test

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit 791a5859918a930036c77f63affdc535f485f685
Author: Jen-Chieh Shen 
Commit: Jen-Chieh Shen 

ci: test
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 9299917c61..7a0546df2f 100644
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ LOAD_PATH  ?= $(addprefix -L ../,$(DEPS))
 LOAD_PATH  += -L .
 
 # TODO: add checkdoc and lint
-ci: build compile checkdoc
+ci: build compile test
 
 build:
$(EASK) package



[nongnu] elpa/rust-mode 46325b4350 5/6: fix network issue

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit 46325b435037b5dd96a724fed83e940a7015a848
Author: Jen-Chieh Shen 
Commit: GitHub 

fix network issue
---
 Eask | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Eask b/Eask
index 5f9910121b..64417eaaad 100644
--- a/Eask
+++ b/Eask
@@ -12,3 +12,5 @@
  "rust-utils.el")
 
 (depends-on "emacs" "25.1")
+
+(setq network-security-level 'low)  ; see 
https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432



[nongnu] elpa/rust-mode d17be3051b 6/6: Merge pull request #444 from jcs-PR/ci-eask

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit d17be3051b22a06d7742178cd1367aed61807a66
Merge: 26ecc903c5 46325b4350
Author: brotzeit 
Commit: GitHub 

Merge pull request #444 from jcs-PR/ci-eask

Use Eask for CI
---
 .github/workflows/test.yml | 20 ++-
 .gitignore |  4 +++
 Eask   | 16 
 Makefile   | 64 +++---
 4 files changed, 53 insertions(+), 51 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6b016cf6be..a970eda156 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -3,28 +3,34 @@ name: CI
 on: [push, pull_request]
 
 jobs:
-unix-test:
-runs-on: ubuntu-latest
+test:
+runs-on: ${{ matrix.os }}
 strategy:
-max-parallel: 6
+fail-fast: false
 matrix:
+os: [ubuntu-latest, macos-latest, windows-latest]
 emacs-version:
 - 26.3
 - 27.2
+- 28.1
 # - snapshot
 
 steps:
 - uses: actions/checkout@v2
 
-- uses: purcell/setup-emacs@master
+- uses: jcs090218/setup-emacs@master
   with:
   version: ${{ matrix.emacs-version }}
 
-- uses: conao3/setup-cask@master
+- uses: actions/setup-node@v2
   with:
-  version: 0.8.4
+node-version: '16'
+
+- uses: emacs-eask/setup-eask@master
+  with:
+version: 'snapshot'
 
 - name: Run tests
   run: |
-make test  
+make ci  
 
diff --git a/.gitignore b/.gitignore
index c531d9867f..2835be648c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
 *.elc
+*-autoloads.el
+
+.eask
+/dist
diff --git a/Eask b/Eask
new file mode 100644
index 00..64417eaaad
--- /dev/null
+++ b/Eask
@@ -0,0 +1,16 @@
+(package "rust-mode"
+ "1.0.4"
+ "A major-mode for editing Rust source code")
+
+(package-file "rust-mode.el")
+
+(files 
+ "rust-cargo.el"
+ "rust-compile.el"
+ "rust-playpen.el"
+ "rust-rustfmt.el"
+ "rust-utils.el")
+
+(depends-on "emacs" "25.1")
+
+(setq network-security-level 'low)  ; see 
https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432
diff --git a/Makefile b/Makefile
index 64bb106a7e..7a0546df2f 100644
--- a/Makefile
+++ b/Makefile
@@ -8,64 +8,40 @@ PKG = rust-mode
 
 EMACS ?= emacs
 EMACS_ARGS ?=
-
-ELS   = rust-mode.el
-ELS  += rust-cargo.el
-ELS  += rust-compile.el
-ELS  += rust-playpen.el
-ELS  += rust-rustfmt.el
-ELS  += rust-utils.el
-ELCS  = $(ELS:.el=.elc)
+EASK ?= eask
 
 DEPS  =
 
 LOAD_PATH  ?= $(addprefix -L ../,$(DEPS))
 LOAD_PATH  += -L .
 
-lisp: $(ELCS) loaddefs
+# TODO: add checkdoc and lint
+ci: build compile test
+
+build:
+   $(EASK) package
+   $(EASK) install
 
-%.elc: %.el
+compile:
@printf "Compiling $<\n"
-   @$(EMACS) -Q --batch $(EMACS_ARGS) \
-   $(LOAD_PATH) --funcall batch-byte-compile $<
+   $(EASK) compile
 
 test:
-   @$(EMACS) -Q --batch -L . -l rust-mode.el \
-   -l rust-mode-tests.el -f ert-run-tests-batch-and-exit
+   $(EASK) ert rust-mode-tests.el
+
+checkdoc:
+   $(EASK) checkdoc
+
+lint:
+   $(EASK) lint
 
-CLEAN  = $(ELCS) $(PKG)-autoloads.el
+CLEAN = $(PKG)-autoloads.el
 
 clean:
@printf "Cleaning...\n"
@rm -rf $(CLEAN)
+   $(EASK) clean-all
 
-loaddefs: $(PKG)-autoloads.el
-
-define LOADDEFS_TMPL
-;;; $(PKG)-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name \
-(or (file-name-directory #$$) (car load-path
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; $(PKG)-autoloads.el ends here
-endef
-export LOADDEFS_TMPL
-#'
-
-$(PKG)-autoloads.el: $(ELS)
+$(PKG)-autoloads.el:
@printf "Generating $@\n"
-   @printf "%s" "$$LOADDEFS_TMPL" > $@
-   @$(EMACS) -Q --batch --eval "(progn\
-   (setq make-backup-files nil)\
-   (setq vc-handled-backends nil)\
-   (setq default-directory (file-truename default-directory))\
-   (setq generated-autoload-file (expand-file-name \"$@\"))\
-   (setq find-file-visit-truename t)\
-   (update-directory-autoloads default-directory))"
-
+   $(EASK) autoloads



[elpa] externals/tmr 80673d9eb5 1/2: Update docs for Damien Cassou's contributions

2022-04-28 Thread ELPA Syncer
branch: externals/tmr
commit 80673d9eb59db63c09ddc438974d98cd3688b932
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Update docs for Damien Cassou's contributions

This pertains to commits cbf80ec, cd19c02.  Thanks to Damien for the
patches!
---
 README.org | 21 +
 tmr.el | 21 +
 2 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/README.org b/README.org
index 8b805dc4d7..000a2b7362 100644
--- a/README.org
+++ b/README.org
@@ -85,6 +85,11 @@ asks for a description which accompanies the given timer.  
Preconfigured
 candidates are specified in the user option ~tmr-descriptions-list~,
 though any arbitrary input is acceptable at the minibuffer prompt.
 
+#+findex: tmr-with-description
+An alternative to the ~tmr~ command is ~tmr-with-description~.  The
+difference between the two is that the latter always prompts for a
+description.
+
 #+findex: tmr-view-echo-area-messages
 When the timer is set, a message is sent to the echo area recording the
 current time and the point in the future when the timer elapses.  Echo
@@ -103,6 +108,9 @@ notification can be set through the 
~tmr-notification-urgency~ option.
 Note that it is up to the desktop environment or notification daemon to
 decide how to handle the urgency value.
 
+If the ~tmr-sound-file~ is nil, or the file is not found, no sound will
+be played.
+
 #+findex: tmr-cancel
 The ~tmr-cancel~ command is used to cancel running timers (as set by the
 ~tmr~ command).  If there is only one timer, it cancels it outright.  If
@@ -169,14 +177,18 @@ Everything is in place to set up the package.
 ;; Load the `tmr' library
 (require 'tmr)
 
+;; set to nil to disable the sound
+(setq tmr-sound-file
+  "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga")
+
 ;; OPTIONALLY set global key bindings:
 (let ((map global-map))
-  (define-key map (kbd "C-c t t") #'tmr)
+  (define-key map (kbd "C-c t t") #'tmr) ; or use the command 
`tmr-with-description'
   (define-key map (kbd "C-c t e") #'tmr-view-echo-area-messages) ; "e" to 
remind of C-h e
   (define-key map (kbd "C-c t c") #'tmr-cancel))
 
-;; Also check the user options `tmr-sound-file',
-;; `tmr-notification-urgency' `tmr-descriptions-list'.
+;; Also check the user options `tmr-notification-urgency'
+;; `tmr-descriptions-list'.
 #+end_src
 
 * Acknowledgements
@@ -189,7 +201,8 @@ TMR is meant to be a collective effort.  Every bit of help 
matters.
 
 + Author/maintainer :: Protesilaos Stavrou.
 
-+ Contributions to the code or manual :: Christian Tietze.
++ Contributions to the code or manual :: Christian Tietze, Damien
+  Cassou.
 
 * GNU Free Documentation License
 :PROPERTIES:
diff --git a/tmr.el b/tmr.el
index db06fd45b8..134f377ba7 100644
--- a/tmr.el
+++ b/tmr.el
@@ -44,6 +44,10 @@
 ;; candidates are specified in the user option `tmr-descriptions-list',
 ;; though any arbitrary input is acceptable at the minibuffer prompt.
 ;;
+;; An alternative to the `tmr' command is `tmr-with-description'.  The
+;; difference between the two is that the latter always prompts for a
+;; description.
+;;
 ;; When the timer is set, a message is sent to the echo area recording the
 ;; current time and the point in the future when the timer elapses.  Echo
 ;; area messages can be reviewed with the `view-echo-area-messages' which is
@@ -59,6 +63,9 @@
 ;; Note that it is up to the desktop environment or notification daemon to
 ;; decide how to handle the urgency value.
 ;;
+;; If the `tmr-sound-file' is nil, or the file is not found, no sound will
+;; be played.
+;;
 ;; The `tmr-cancel' command is used to cancel running timers (as set by the
 ;; `tmr' command).  If there is only one timer, it cancels it outright.  If
 ;; there are multiple timers, it produces a minibuffer completion prompt
@@ -95,7 +102,10 @@ such notifications."
   :group 'tmr)
 
 (defcustom tmr-descriptions-list (list "Boil water" "Prepare tea" "Bake bread")
-  "Optional description candidates for the current `tmr'."
+  "Optional description candidates for the current `tmr'.
+These are provided as completion candidates when `tmr' is called
+with a DESCRIPTION argument or when `tmr-with-description' is
+used."
   :type '(repeat string)
   :group 'tmr)
 
@@ -267,9 +277,12 @@ With optional DESCRIPTION as a prefix 
(\\[universal-argument]),
 prompt for a description among `tmr-descriptions-list', though
 allow for any string to serve as valid input.
 
-This command also plays back `tmr-sound-file'.
+This command also plays back `tmr-sound-file' if it is available.
+
+To cancel the timer, use the `tmr-cancel' command.
 
-To cancel the timer, use the `tmr-cancel' command."
+To always prompt for a DESCRIPTION when setting a timer, use the
+command `tmr-with-description' instead of this one."
   (interactive
(list
 (read-string "N minutes for timer (append `h' or `s' for other units): ")
@@ -292,7 +305,7 @@ To cancel the timer, use the `tmr-cancel' command."
 (defun tm

[nongnu] elpa/rust-mode d0072d6033 2/6: Rename job

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit d0072d6033da0866659987099ecfbf8877e0c0e8
Author: Jen-Chieh Shen 
Commit: Jen-Chieh Shen 

Rename job
---
 .github/workflows/test.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index dcc875e137..a970eda156 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -3,7 +3,7 @@ name: CI
 on: [push, pull_request]
 
 jobs:
-unix-test:
+test:
 runs-on: ${{ matrix.os }}
 strategy:
 fail-fast: false



[elpa] externals/tmr 7157ec61c4 2/2: Tweak acronym of package and clarify docs

2022-04-28 Thread ELPA Syncer
branch: externals/tmr
commit 7157ec61c451e3b97ba6117688d0de52bf294bea
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Tweak acronym of package and clarify docs
---
 README.org | 6 +++---
 tmr.el | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/README.org b/README.org
index 000a2b7362..13918f4fff 100644
--- a/README.org
+++ b/README.org
@@ -1,4 +1,4 @@
-#+title: TMR Must Reccur
+#+title: TMR May Ring
 #+author: Protesilaos Stavrou
 #+email: i...@protesilaos.com
 #+language: en
@@ -16,7 +16,7 @@
 
 #+texinfo_filename: tmr.info
 #+texinfo_dir_category: Emacs misc features
-#+texinfo_dir_title: TMR Must Recur: (tmr)
+#+texinfo_dir_title: TMR May Ring: (tmr)
 #+texinfo_dir_desc: Set timers using a convenient notation
 #+texinfo_header: @set MAINTAINERSITE @uref{https://protesilaos.com,maintainer 
webpage}
 #+texinfo_header: @set MAINTAINER Protesilaos Stavrou
@@ -125,7 +125,7 @@ create them, including the optional description that ~tmr~ 
accepts.
 :END:
 #+cindex: Installation instructions
 
-** COMMENT GNU ELPA package
+** GNU ELPA package
 :PROPERTIES:
 :CUSTOM_ID: h:807c2a8c-3d49-4fb3-bfb9-84d10675c95b
 :END:
diff --git a/tmr.el b/tmr.el
index 134f377ba7..9676c3bea1 100644
--- a/tmr.el
+++ b/tmr.el
@@ -5,7 +5,7 @@
 ;; Author: Protesilaos Stavrou 
 ;; URL: https://git.sr.ht/~protesilaos/tmr
 ;; Mailing list: https://lists.sr.ht/~protesilaos/tmr
-;; Version: 0.2.2
+;; Version: 0.2.3
 ;; Package-Requires: ((emacs "27.1"))
 ;; Keywords: convenience, timer
 
@@ -78,7 +78,7 @@
 (require 'notifications)
 
 (defgroup tmr ()
-  "TMR Must Recur (super simple timer for my private use)."
+  "TMR May Ring: set timers using a simple notation."
   :group 'data)
 
 (defcustom tmr-sound-file
@@ -195,7 +195,7 @@ Optionally include DESCRIPTION."
   (setq desc-plain (concat "\n" description)
 desc-propertized (concat " [" (propertize description 'face 'bold) 
"]")))
 (tmr--notify-send-notification
- "TMR Must Recur"
+ "TMR May Ring (Emacs tmr package)"
  (format "Time is up!\nStarted: %s\nEnded: %s%s"
  start end desc-plain))
 (message



[elpa] externals/tmr updated (cbf80eca40 -> 7157ec61c4)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/tmr.

  from  cbf80eca40 Add command tmr-with-description
   new  80673d9eb5 Update docs for Damien Cassou's contributions
   new  7157ec61c4 Tweak acronym of package and clarify docs


Summary of changes:
 README.org | 27 ---
 tmr.el | 27 ---
 2 files changed, 40 insertions(+), 14 deletions(-)



[nongnu] elpa/rust-mode c29c1f7888 1/6: Use Eask for CI

2022-04-28 Thread ELPA Syncer
branch: elpa/rust-mode
commit c29c1f78886e115ac33cc7704c85eca487a6d1e8
Author: Jen-Chieh Shen 
Commit: Jen-Chieh Shen 

Use Eask for CI
---
 .github/workflows/test.yml | 18 -
 .gitignore |  4 +++
 Eask   | 14 +++
 Makefile   | 63 ++
 4 files changed, 49 insertions(+), 50 deletions(-)

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 6b016cf6be..dcc875e137 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,27 +4,33 @@ on: [push, pull_request]
 
 jobs:
 unix-test:
-runs-on: ubuntu-latest
+runs-on: ${{ matrix.os }}
 strategy:
-max-parallel: 6
+fail-fast: false
 matrix:
+os: [ubuntu-latest, macos-latest, windows-latest]
 emacs-version:
 - 26.3
 - 27.2
+- 28.1
 # - snapshot
 
 steps:
 - uses: actions/checkout@v2
 
-- uses: purcell/setup-emacs@master
+- uses: jcs090218/setup-emacs@master
   with:
   version: ${{ matrix.emacs-version }}
 
-- uses: conao3/setup-cask@master
+- uses: actions/setup-node@v2
   with:
-  version: 0.8.4
+node-version: '16'
+
+- uses: emacs-eask/setup-eask@master
+  with:
+version: 'snapshot'
 
 - name: Run tests
   run: |
-make test  
+make ci  
 
diff --git a/.gitignore b/.gitignore
index c531d9867f..2835be648c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,5 @@
 *.elc
+*-autoloads.el
+
+.eask
+/dist
diff --git a/Eask b/Eask
new file mode 100644
index 00..5f9910121b
--- /dev/null
+++ b/Eask
@@ -0,0 +1,14 @@
+(package "rust-mode"
+ "1.0.4"
+ "A major-mode for editing Rust source code")
+
+(package-file "rust-mode.el")
+
+(files 
+ "rust-cargo.el"
+ "rust-compile.el"
+ "rust-playpen.el"
+ "rust-rustfmt.el"
+ "rust-utils.el")
+
+(depends-on "emacs" "25.1")
diff --git a/Makefile b/Makefile
index 64bb106a7e..876ea22497 100644
--- a/Makefile
+++ b/Makefile
@@ -8,64 +8,39 @@ PKG = rust-mode
 
 EMACS ?= emacs
 EMACS_ARGS ?=
-
-ELS   = rust-mode.el
-ELS  += rust-cargo.el
-ELS  += rust-compile.el
-ELS  += rust-playpen.el
-ELS  += rust-rustfmt.el
-ELS  += rust-utils.el
-ELCS  = $(ELS:.el=.elc)
+EASK ?= eask
 
 DEPS  =
 
 LOAD_PATH  ?= $(addprefix -L ../,$(DEPS))
 LOAD_PATH  += -L .
 
-lisp: $(ELCS) loaddefs
+ci: build compile checkdoc lint test
+
+build:
+   $(EASK) package
+   $(EASK) install
 
-%.elc: %.el
+compile:
@printf "Compiling $<\n"
-   @$(EMACS) -Q --batch $(EMACS_ARGS) \
-   $(LOAD_PATH) --funcall batch-byte-compile $<
+   $(EASK) compile
 
 test:
-   @$(EMACS) -Q --batch -L . -l rust-mode.el \
-   -l rust-mode-tests.el -f ert-run-tests-batch-and-exit
+   $(EASK) ert rust-mode-tests.el
+
+checkdoc:
+   $(EASK) checkdoc
+
+lint:
+   $(EASK) lint
 
-CLEAN  = $(ELCS) $(PKG)-autoloads.el
+CLEAN = $(PKG)-autoloads.el
 
 clean:
@printf "Cleaning...\n"
@rm -rf $(CLEAN)
+   $(EASK) clean-all
 
-loaddefs: $(PKG)-autoloads.el
-
-define LOADDEFS_TMPL
-;;; $(PKG)-autoloads.el --- automatically extracted autoloads
-;;
-;;; Code:
-(add-to-list 'load-path (directory-file-name \
-(or (file-name-directory #$$) (car load-path
-
-;; Local Variables:
-;; version-control: never
-;; no-byte-compile: t
-;; no-update-autoloads: t
-;; End:
-;;; $(PKG)-autoloads.el ends here
-endef
-export LOADDEFS_TMPL
-#'
-
-$(PKG)-autoloads.el: $(ELS)
+$(PKG)-autoloads.el:
@printf "Generating $@\n"
-   @printf "%s" "$$LOADDEFS_TMPL" > $@
-   @$(EMACS) -Q --batch --eval "(progn\
-   (setq make-backup-files nil)\
-   (setq vc-handled-backends nil)\
-   (setq default-directory (file-truename default-directory))\
-   (setq generated-autoload-file (expand-file-name \"$@\"))\
-   (setq find-file-visit-truename t)\
-   (update-directory-autoloads default-directory))"
-
+   $(EASK) autoloads



[nongnu] elpa/annotate 284506bb7e 1/4: - fixed function that is called on 'window-size-change-functions',

2022-04-28 Thread ELPA Syncer
branch: elpa/annotate
commit 284506bb7eceb231ce0d1e531c6f6e3b9734fe7e
Author: cage 
Commit: cage 

- fixed  function that  is  called on  'window-size-change-functions',
  this function is  called with a single frame as  an argument, whilst
  we was using 'font-lock-flush' that takes two integer arguments.

  The results was that the annotation was not properly resized.
---
 annotate.el | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/annotate.el b/annotate.el
index 9617c2b686..336d3f4942 100644
--- a/annotate.el
+++ b/annotate.el
@@ -432,13 +432,18 @@ modified (for example a newline is inserted)."
   (annotate-load-annotations)
   (font-lock-flush))
 
+(defun on-window-size-change (frame)
+  "The function to call when window-size-change-functions is called,
+note that the argument `FRAME' is ignored"
+  (font-lock-flush))
+
 (defun annotate-initialize ()
   "Load annotations and set up save and display hooks."
   (annotate-load-annotations)
   (add-hook 'after-save-hook  #'annotate-save-annotations t t)
   ;; This hook  is needed to  reorganize the layout of  the annotation
   ;; text when a window vertically resized
-  (add-hook 'window-size-change-functions #'font-lock-flush t t)
+  (add-hook 'window-size-change-functions #'on-window-size-change t t)
   (add-hook 'before-change-functions  #'annotate-before-change-fn t t)
   (add-hook 'Info-selection-hook  #'annotate-info-select-fn   t t)
   (if annotate-use-echo-area
@@ -454,7 +459,7 @@ modified (for example a newline is inserted)."
   "Clear annotations and remove save and display hooks."
   (annotate-clear-annotations)
   (remove-hook 'after-save-hook  #'annotate-save-annotations t)
-  (remove-hook 'window-size-change-functions #'font-lock-flush t)
+  (remove-hook 'window-size-change-functions #'on-window-size-change t)
   (remove-hook 'before-change-functions  #'annotate-before-change-fn t)
   (remove-hook 'Info-selection-hook  #'annotate-info-select-fn   t)
   (if annotate-use-echo-area



[nongnu] elpa/annotate updated (a3d42262f5 -> e982a7b74a)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch elpa/annotate.

  from  a3d42262f5 Merge pull request #128 from 
cage2/updated-version-after-mail-line-changes
   new  284506bb7e - fixed  function that  is  called on  
'window-size-change-functions',   this function is  called with a single frame 
as  an argument, whilst   we was using 'font-lock-flush' that takes two integer 
arguments.
   new  c00b6f49f7 - increased version number.
   new  5299eba136 - updated Changelog and NEWS.org.
   new  e982a7b74a Merge pull request #129 from cage2/fix-resize-hook


Summary of changes:
 Changelog   | 10 ++
 NEWS.org|  5 +
 annotate.el | 13 +
 3 files changed, 24 insertions(+), 4 deletions(-)



[nongnu] elpa/annotate c00b6f49f7 2/4: - increased version number.

2022-04-28 Thread ELPA Syncer
branch: elpa/annotate
commit c00b6f49f779dc5caac7b37d1e35f87891e015d4
Author: cage 
Commit: cage 

- increased version number.
---
 annotate.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/annotate.el b/annotate.el
index 336d3f4942..b97a496761 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Bastian Bechtold , cage 

 ;; URL: https://github.com/bastibe/annotate.el
 ;; Created: 2015-06-10
-;; Version: 1.5.3
+;; Version: 1.5.4
 
 ;; This file is NOT part of GNU Emacs.
 
@@ -58,7 +58,7 @@
 ;;;###autoload
 (defgroup annotate nil
   "Annotate files without changing them."
-  :version "1.5.3"
+  :version "1.5.4"
   :group 'text)
 
 (defvar annotate-mode-map



[nongnu] elpa/annotate e982a7b74a 4/4: Merge pull request #129 from cage2/fix-resize-hook

2022-04-28 Thread ELPA Syncer
branch: elpa/annotate
commit e982a7b74a681a8c2c823d8dcaafd185ab5f719e
Merge: a3d42262f5 5299eba136
Author: cage2 <1257703+ca...@users.noreply.github.com>
Commit: GitHub 

Merge pull request #129 from cage2/fix-resize-hook

Fix resize hook
---
 Changelog   | 10 ++
 NEWS.org|  5 +
 annotate.el | 13 +
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/Changelog b/Changelog
index dd6d9add41..31112ee8b9 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,13 @@
+2022-04-23 cage
+
+* annotate.el:
+
+- fixed  function that  is  called on  'window-size-change-functions',
+this function is  called with a single frame as  an argument, whilst
+we was using 'font-lock-flush' that takes two integer arguments.
+The results was that the annotation was not properly resized.
+- increased version number.
+
 2022-04-08 btd, cage
 
 * .gitignore,
diff --git a/NEWS.org b/NEWS.org
index b74ffd8ae0..31dc2a76a6 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,8 @@
+- 2022-04-23 v1.5.4 cage::
+
+  This version  restored redrawing  of annotation  when the  window is
+  resized.
+
 - 2022-01-26 v1.5.3 cage ::
 
   This version  fixed the  email maintainer  list that  was previously
diff --git a/annotate.el b/annotate.el
index 9617c2b686..b97a496761 100644
--- a/annotate.el
+++ b/annotate.el
@@ -7,7 +7,7 @@
 ;; Maintainer: Bastian Bechtold , cage 

 ;; URL: https://github.com/bastibe/annotate.el
 ;; Created: 2015-06-10
-;; Version: 1.5.3
+;; Version: 1.5.4
 
 ;; This file is NOT part of GNU Emacs.
 
@@ -58,7 +58,7 @@
 ;;;###autoload
 (defgroup annotate nil
   "Annotate files without changing them."
-  :version "1.5.3"
+  :version "1.5.4"
   :group 'text)
 
 (defvar annotate-mode-map
@@ -432,13 +432,18 @@ modified (for example a newline is inserted)."
   (annotate-load-annotations)
   (font-lock-flush))
 
+(defun on-window-size-change (frame)
+  "The function to call when window-size-change-functions is called,
+note that the argument `FRAME' is ignored"
+  (font-lock-flush))
+
 (defun annotate-initialize ()
   "Load annotations and set up save and display hooks."
   (annotate-load-annotations)
   (add-hook 'after-save-hook  #'annotate-save-annotations t t)
   ;; This hook  is needed to  reorganize the layout of  the annotation
   ;; text when a window vertically resized
-  (add-hook 'window-size-change-functions #'font-lock-flush t t)
+  (add-hook 'window-size-change-functions #'on-window-size-change t t)
   (add-hook 'before-change-functions  #'annotate-before-change-fn t t)
   (add-hook 'Info-selection-hook  #'annotate-info-select-fn   t t)
   (if annotate-use-echo-area
@@ -454,7 +459,7 @@ modified (for example a newline is inserted)."
   "Clear annotations and remove save and display hooks."
   (annotate-clear-annotations)
   (remove-hook 'after-save-hook  #'annotate-save-annotations t)
-  (remove-hook 'window-size-change-functions #'font-lock-flush t)
+  (remove-hook 'window-size-change-functions #'on-window-size-change t)
   (remove-hook 'before-change-functions  #'annotate-before-change-fn t)
   (remove-hook 'Info-selection-hook  #'annotate-info-select-fn   t)
   (if annotate-use-echo-area



[nongnu] elpa/annotate 5299eba136 3/4: - updated Changelog and NEWS.org.

2022-04-28 Thread ELPA Syncer
branch: elpa/annotate
commit 5299eba136d95aca0b11d3170b2f07acae6b1121
Author: cage 
Commit: cage 

- updated Changelog and NEWS.org.
---
 Changelog | 10 ++
 NEWS.org  |  5 +
 2 files changed, 15 insertions(+)

diff --git a/Changelog b/Changelog
index dd6d9add41..31112ee8b9 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,13 @@
+2022-04-23 cage
+
+* annotate.el:
+
+- fixed  function that  is  called on  'window-size-change-functions',
+this function is  called with a single frame as  an argument, whilst
+we was using 'font-lock-flush' that takes two integer arguments.
+The results was that the annotation was not properly resized.
+- increased version number.
+
 2022-04-08 btd, cage
 
 * .gitignore,
diff --git a/NEWS.org b/NEWS.org
index b74ffd8ae0..31dc2a76a6 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -1,3 +1,8 @@
+- 2022-04-23 v1.5.4 cage::
+
+  This version  restored redrawing  of annotation  when the  window is
+  resized.
+
 - 2022-01-26 v1.5.3 cage ::
 
   This version  fixed the  email maintainer  list that  was previously



[elpa] main b6b2a161bf: * elpa-packages (gtags-mode): New package

2022-04-28 Thread Stefan Monnier via
branch: main
commit b6b2a161bf1f119f8be143deac96c2cf19d18b5f
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packages (gtags-mode): New package
---
 elpa-packages | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/elpa-packages b/elpa-packages
index 9c9f35267d..5674fe1dbe 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -308,6 +308,8 @@
  ("gpastel":url "https://gitlab.petton.fr/DamienCassou/gpastel";)
  ("greader":url 
"https://gitlab.com/michelangelo-rodriguez/greader";)
  ("greenbar"   :url nil)
+ ("gtags-mode" :url "https://github.com/Ergus/gtags-mode";
+  :auto-sync t)
  ("guess-language" :url "https://github.com/tmalsburg/guess-language.el";)
  ("heap"   :url "http://www.dr-qubit.org/git/predictive.git";)
  ("hiddenquote":url 
"https://gitlab.com/mauroaranda/hiddenquote/hiddenquote";)



[elpa] branch externals/gtags-mode created (now 317ed00754)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/gtags-mode.

at  317ed00754 Assert we retun nil on error

This branch includes the following new commits:

   new  55b0cbadb6 First commit.
   new  c88225e3f1 Add Readme.md
   new  9763f8fb69 Add async processes to create and update database 
cleanly.
   new  ba893f6762 Improve imenu integration
   new  f4fc9bad41 Add find-file hook
   new  f4bda60a1a Fix global-xref--set-connection-locals.
   new  442f819924 General fixes.
   new  82b7f79aff Simplify code.
   new  45fdfac932 Simplify imenu again.
   new  1aaac5fead Simplify code to so only the needed.
   new  65c2da145a Reorder code a but and simplify.
   new  dc50f340d4 Small fixes in documentation and other details.
   new  9c4323a5e6 Improve connection local code.
   new  053184f8b5 Don't call with-connection-local-variables
   new  19f827a1d7 Use delq instead of remove.
   new  688f1e8886 Break long lines.
   new  192258fa32 Use list instead of quotes.
   new  599dfb8002 Improve debug of async processes.
   new  75aef71741 Fix messages.
   new  70b6c217d5 Add support for project.el.
   new  5445a63b79 Small fixes.
   new  a9f6acbaba List GTAGS buffers.
   new  ea16b9d8c7 global-xref-project-backend shouldn't call 
global-xref--find-root.
   new  04c2d9fbaf Use file-truename
   new  a3b99b9aa6 Enable the mode in all the already opened buffers 
sharing root.
   new  cd79d73561 Fix following Michael Albinus recommendations.
   new  95b730930b Remove global-xref--sync-sentinel
   new  a2c84b5a2b Optimize avoiding with-current-buffer.
   new  3d7bf179bb Use make-process instead of start-file-process.
   new  c1bbe60f19 Simplify code:
   new  13a0afbefd Renamed to gtags-xref-mode.
   new  ae397208b5 Finish rename process.
   new  c2e13cc742 Use a better name gtags-mode is free.
   new  5525174de9 Many changes:
   new  a14940cd98 Reorder some code and simplify cache code
   new  9fc5c618a1 Simplify a bit more the cache handling code.
   new  0954a065d3 Miscellaneous fixes
   new  54368ee7e0 Better use of the new plist.
   new  2e5ecb8042 Add check on mode enable.
   new  d1195ca318 Use memoization function
   new  33938b17e7 New function
   new  c60bb82307 Don't use with-memoization it is too new.
   new  f312adbbab Use match-string-no-properties is better.
   new  9b67043bcf Use a workaround to pint proper information
   new  d4890f5bb3 Small simplification.
   new  b18a7cb93d Fix docs, info messages and use `(,
   new  3f43b6056d ;; Fix typo
   new  8734f6b54d Reorder
   new  c823dcffc9 Assert not call plist-put for nil
   new  86777df9a3 Call gtags-mode--set-connection-locals before processes
   new  076ae4a55e Fall back to default on imenu.
   new  e8d19c4333 Add code to run extra sentinel
   new  777c51d630 Convert the mode in a global mode.
   new  10a710a3dd Fix and simplify
   new  148041bbe9 Cleanup and reorder code.
   new  7dc81cbae2 Small simplifies
   new  1f2f3d272b Fix performance issue.
   new  9dcb18fbe7 Use cscope output; it is easier to parse.
   new  3012f128ea Change "Gtags" to " Gtags" for minor-mode name
   new  ce6a4a6201 Merge pull request #1 from jangid/master
   new  317ed00754 Assert we retun nil on error




[elpa] externals/gtags-mode ba893f6762 04/61: Improve imenu integration

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit ba893f67626bd636e87fd377fcb74509c5cb4c83
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Improve imenu integration
---
 global-xref.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 52092e0f4a..e245200271 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -234,13 +234,12 @@ any additional command line arguments to pass to GNU 
Global."
 
 (defun global-xref-imenu-create-index-function ()
   "Make imenu use gtags."
-  (when-let ((commandfile (or (file-remote-p buffer-file-name 'localname)
- buffer-file-name)))
+  (when buffer-file-name
 (global-xref--filter-find-symbol
  (lambda (name _code _file line)
(list name line #'global-xref--imenu-goto-function))
  '("--file")
- commandfile)))
+ (file-name-nondirectory buffer-file-name
 
 ;;;###autoload
 (define-minor-mode global-xref-mode



[elpa] externals/gtags-mode f4bda60a1a 06/61: Fix global-xref--set-connection-locals.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit f4bda60a1a575fcdd6e95a048ba57b5f36dffd9c
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix global-xref--set-connection-locals.

connection-local-variables-alist needs to be a list...
---
 global-xref.el | 26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 305da1368e..30b2d46918 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -115,23 +115,25 @@ the cases"
 
 (defun global-xref--set-connection-locals ()
   "Set GLOBAL connection local variables when possible."
-  (when-let* ((host (file-remote-p default-directory 'host))
- (symvars (intern (concat "global-xref-" host "-vars")))
- (criteria `(:machine ,host))
- (connection-local-variables-alist t))
-(hack-connection-local-variables criteria)
-(unless (alist-get 'global-xref--global connection-local-variables-alist)
-  (connection-local-set-profile-variables
-   symvars
-   `((global-xref--global . ,(executable-find (file-name-base 
global-xref-global) t))
-(global-xref--gtags . ,(executable-find (file-name-base 
global-xref-gtags) t
-  (connection-local-set-profiles criteria symvars
+  (when-let ((host (file-remote-p default-directory 'host)))
+(let ((symvars (intern (concat "global-xref-" host "-vars")))
+ (criteria `(:machine ,host))
+ connection-local-variables-alist)
+  (hack-connection-local-variables criteria)
+  (unless (alist-get 'global-xref--global connection-local-variables-alist)
+   (connection-local-set-profile-variables
+symvars
+`((global-xref--global . ,(executable-find (file-name-base 
global-xref-global) t))
+  (global-xref--gtags . ,(executable-find (file-name-base 
global-xref-gtags) t
+   (connection-local-set-profiles criteria symvars)
 
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
   (let ((root (global-xref--exec 'global-xref--global '("--print-dbpath") nil 
nil)))
 (when root
-  (add-to-list 'global-xref--roots-list root)
+  (add-to-list 'global-xref--roots-list
+  (concat (file-remote-p default-directory)
+  (file-truename root)))
   root)))
 
 (defun global-xref--filter-find-symbol (creator args symbol)



[elpa] externals/gtags-mode f4fc9bad41 05/61: Add find-file hook

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit f4fc9bad41441d16cc286b79645c3287c540feb9
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add find-file hook
---
 global-xref.el | 16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index e245200271..305da1368e 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -189,9 +189,17 @@ Return the results as a list."
 (global-xref-update-file buffer-file-name)))
 
 (defun global-xref--find-file-hook ()
-  "After save hook to update GLOBAL database with changed data."
-  (when buffer-file-name
-(global-xref-update-file buffer-file-name)))
+  "Try to enable `global-xref' when opening a file.
+Check the roots and enable `global-xref' if the found-file is in
+one of them."
+  (let ((truename (file-truename buffer-file-name)))
+(catch 'found
+  (mapc (lambda (x)
+ (when (string-prefix-p x truename)
+   (global-xref-mode 1)
+   (throw 'found x)))
+   global-xref--roots-list)
+  nil)))
 
 ;; xref integration
 (defun global-xref--find-symbol (args symbol)
@@ -250,12 +258,14 @@ any additional command line arguments to pass to GNU 
Global."
(global-xref-mode
 (global-xref--set-connection-locals)
 (setq global-xref--project-root (global-xref--find-root))
+(add-hook 'find-file-hook #'global-xref--find-file-hook t)
 (add-hook 'xref-backend-functions #'global-xref-xref-backend nil t)
 (add-hook 'after-save-hook #'global-xref--after-save-hook nil t)
 (setq global-xref--imenu-default-function imenu-create-index-function)
 (setq imenu-create-index-function 
#'global-xref-imenu-create-index-function))
(t
 (setq global-xref--project-root nil)
+(remove-hook 'find-file-hook #'global-xref--find-file-hook)
 (remove-hook 'xref-backend-functions #'global-xref-xref-backend t)
 (remove-hook 'after-save-hook #'global-xref--after-save-hook t)
 (setq imenu-create-index-function global-xref--imenu-default-function



[elpa] externals/gtags-mode 45fdfac932 09/61: Simplify imenu again.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 45fdfac932fe35a4e24e1972efe082d362d3ed2f
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Simplify imenu again.
---
 global-xref.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/global-xref.el b/global-xref.el
index b1277ae29c..54f491f4a2 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -226,7 +226,7 @@ any additional command line arguments to pass to GNU 
Global."
   (when buffer-file-name
 (global-xref--filter-find-symbol
  (lambda (name _code _file line)
-   (list (format "%s:%s" line name) line 
#'global-xref--imenu-goto-function))
+   (list name line #'global-xref--imenu-goto-function))
  '("--file")
  (file-name-nondirectory buffer-file-name
 



[elpa] externals/gtags-mode 317ed00754 61/61: Assert we retun nil on error

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 317ed007548f13806e417d618eb37ef828ced802
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Assert we retun nil on error
---
 gtags-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 8983262566..39518a07d4 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -211,7 +211,8 @@ name, code, file, line."
(string-to-number (match-string-no-properties 3 
line) ;; line
   (gtags-mode--exec-sync
(append args gtags-mode--output-format-options) symbol)))
-(error "Calling gtags-mode--filter-find-symbol without GTAGSROOT")))
+(error "Calling gtags-mode--filter-find-symbol without GTAGSROOT")
+nil))
 
 (defun gtags-mode--update-buffers-plist ()
   "Actions to perform after creating a database.



[elpa] externals/gtags-mode 9fc5c618a1 36/61: Simplify a bit more the cache handling code.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 9fc5c618a1839e3c0491eefe98d21e6c5a046e8e
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Simplify a bit more the cache handling code.
---
 gtags-mode.el | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index ad55af0ad8..634e072ec9 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -171,12 +171,11 @@ completions usually from the cache when possible."
 (gtags-mode--get-plist
  gtags-mode--root
  (lambda (plist);; set and return the cache
-   (let* ((cache (plist-get plist :cache))
- (completions (or cache
-  (gtags-mode--exec-sync '("--completion")
-(unless cache
-  (plist-put plist :cache completions))
-completions)
+   (if-let ((cache (plist-get plist :cache)))
+  cache
+(setq cache (gtags-mode--exec-sync '("--completion")))
+(plist-put plist :cache cache)
+cache)
 
 (defun gtags-mode--buffers-in-root (root)
   "Return a list of buffers which variable `buffer-file-name' is inside ROOT."



[elpa] externals/gtags-mode 19f827a1d7 15/61: Use delq instead of remove.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 19f827a1d75b1e1f999293edec033738f0a5986e
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use delq instead of remove.
---
 global-xref.el | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 8e3498ad86..53b6690a49 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -168,20 +168,19 @@ occurred."
 Returns the results as a list of CREATORS outputs similar to
 `mapcar'.  Creator should be a function with 4 input arguments:
 name, code, file, line."
-  (remove
-   nil
-   (mapcar
-(lambda (line)
-  (when (string-match global-xref--output-format-regex line)
-   (funcall creator
-(match-string 1 line)   ;; name
-(match-string 4 line)   ;; code
-(match-string 3 line)   ;; file
-(string-to-number (match-string 2 line) ;; line
-(global-xref--exec-sync
- 'global-xref--global
- (append args global-xref--output-format-options
-`(,(shell-quote-argument symbol)))
+  (delete nil
+ (mapcar
+  (lambda (line)
+(when (string-match global-xref--output-format-regex line)
+  (funcall creator
+   (match-string 1 line)   ;; name
+   (match-string 4 line)   ;; code
+   (match-string 3 line)   ;; file
+   (string-to-number (match-string 2 line) ;; line
+  (global-xref--exec-sync
+   'global-xref--global
+   (append args global-xref--output-format-options
+   `(,(shell-quote-argument symbol)))
 
 ;; Interactive commands ==
 (defun global-xref-create (root-dir)



[elpa] externals/gtags-mode a9f6acbaba 22/61: List GTAGS buffers.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit a9f6acbaba36103c7fc2be1e6a10adc31e2547da
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

List GTAGS buffers.

global-xref--buffers-in-root : New function returning the list of
buffers opened in root.
---
 global-xref.el | 9 +
 1 file changed, 9 insertions(+)

diff --git a/global-xref.el b/global-xref.el
index c6215969a7..3939dd3709 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -225,6 +225,15 @@ one of them."
   (when (global-xref--has-open-root buffer-file-name)
 (global-xref-mode 1)))
 
+(defun global-xref--buffers-in-root (root)
+  "Return a list of buffers which variable `buffer-file-name' is inside ROOT."
+  (mapcan (lambda (buf)
+   (when-let* ((bname (buffer-local-value 'buffer-file-name buf))
+   (tname (file-truename bname))
+   ((string-prefix-p root tname)))
+ (list buf)))
+ (buffer-list)))
+
 ;; xref integration ==
 (defun global-xref--find-symbol (args symbol)
   "Run GNU Global to create xref input list with ARGS on SYMBOL.



[elpa] externals/gtags-mode 5445a63b79 21/61: Small fixes.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 5445a63b797e6bfcce472788455d2a8073c31c27
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Small fixes.
---
 global-xref.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index f539950752..c6215969a7 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -4,7 +4,7 @@
 
 ;; Author: Jimmy Aguilar Mena
 ;; URL: https://github.com/Ergus/global-xref
-;; Keywords: xref, imenu, gtags, global
+;; Keywords: xref, project, imenu, gtags, global
 ;; Version: 1.0 alpha
 ;; Package-Requires: ((emacs "28"))
 
@@ -25,7 +25,7 @@
 
 ;;; Commentary:
 
-;; GNU Global integration with xref and imenu.
+;; GNU Global integration with xref, project and imenu.
 
 ;;; Code:
 
@@ -291,7 +291,7 @@ any additional command line arguments to pass to GNU 
Global."
 (mapcan (lambda (dir)
  (when (string-prefix-p root dir)
(global-xref--filter-find-symbol
-'("-a" "--path") (string-remove-prefix root dir)
+'("--path") (string-remove-prefix root dir)
 (lambda (_name _code file _line)
   (concat remote file)
(or dirs (list root)
@@ -305,18 +305,18 @@ any additional command line arguments to pass to GNU 
Global."
(global-xref-mode
 (global-xref--set-connection-locals)
 (setq global-xref--project-root (global-xref--find-root))
-(add-hook 'find-file-hook #'global-xref--find-file-hook t)
+(add-hook 'find-file-hook #'global-xref--find-file-hook)
+(add-hook 'project-find-functions #'global-xref-project-backend)
 (add-hook 'xref-backend-functions #'global-xref-xref-backend nil t)
 (add-hook 'after-save-hook #'global-xref--after-save-hook nil t)
-(add-hook 'project-find-functions #'global-xref-project-backend)
 (setq global-xref--imenu-default-function imenu-create-index-function)
 (setq imenu-create-index-function 
#'global-xref-imenu-create-index-function))
(t
 (setq global-xref--project-root nil)
 (remove-hook 'find-file-hook #'global-xref--find-file-hook)
+(remove-hook 'project-find-functions #'global-xref-project-backend)
 (remove-hook 'xref-backend-functions #'global-xref-xref-backend t)
 (remove-hook 'after-save-hook #'global-xref--after-save-hook t)
-(remove-hook 'project-find-functions #'global-xref-project-backend)
 (setq imenu-create-index-function global-xref--imenu-default-function
 
 (provide 'global-xref)



[elpa] externals/gtags-mode a3b99b9aa6 25/61: Enable the mode in all the already opened buffers sharing root.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit a3b99b9aa612a792a6f2a7d05b88a8b8e7436cf1
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Enable the mode in all the already opened buffers sharing root.

This happens only when called interactively and complements
global-xref--find-file-hook.
---
 global-xref.el | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/global-xref.el b/global-xref.el
index 71f54376ab..5f3e3b02b8 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -322,7 +322,14 @@ any additional command line arguments to pass to GNU 
Global."
 (add-hook 'xref-backend-functions #'global-xref-xref-backend nil t)
 (add-hook 'after-save-hook #'global-xref--after-save-hook nil t)
 (setq global-xref--imenu-default-function imenu-create-index-function)
-(setq imenu-create-index-function 
#'global-xref-imenu-create-index-function))
+(setq imenu-create-index-function 
#'global-xref-imenu-create-index-function)
+;; Enable the mode in all the files inside `global-xref--project-root'
+(when (called-interactively-p 'all)
+  (mapc (lambda (buff)
+ (with-current-buffer buff
+   (unless global-xref-mode
+ (global-xref-mode 1
+   (global-xref--buffers-in-root global-xref--project-root
(t
 (setq global-xref--project-root nil)
 (remove-hook 'find-file-hook #'global-xref--find-file-hook)



[elpa] externals/gtags-mode ae397208b5 32/61: Finish rename process.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit ae397208b5cb9d99468a6a7eba23636ed0d2c8fc
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Finish rename process.
---
 gtags-xref.el | 220 +-
 1 file changed, 110 insertions(+), 110 deletions(-)

diff --git a/gtags-xref.el b/gtags-xref.el
index e51157c64b..c5e00bfca0 100644
--- a/gtags-xref.el
+++ b/gtags-xref.el
@@ -1,9 +1,9 @@
-;;; global-xref.el --- GNU Global integration with xref and imenu. -*- 
lexical-binding: t; -*-
+;;; gtags-xref.el --- GNU Global integration with xref, project and imenu. -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2022 Jimmy Aguilar Mena
 
 ;; Author: Jimmy Aguilar Mena
-;; URL: https://github.com/Ergus/global-xref
+;; URL: https://github.com/Ergus/gtags-xref
 ;; Keywords: xref, project, imenu, gtags, global
 ;; Version: 1.0 alpha
 ;; Package-Requires: ((emacs "28"))
@@ -31,72 +31,72 @@
 (require 'cl-generic)
 (require 'files-x)
 
-(defgroup global-xref nil
+(defgroup gtags-xref nil
   "GNU Global grup for xref."
   :group 'xref)
 
-(defcustom global-xref-global "global"
+(defcustom gtags-xref-global "global"
   "GNU Global executable."
   :type 'string
   :local t)
 
-(defcustom global-xref-gtags "gtags"
+(defcustom gtags-xref-gtags "gtags"
   "Gtags executable."
   :type 'string
   :local t)
 
-(defcustom global-xref-lighter "Global-Xref"
+(defcustom gtags-xref-lighter "Gtags-Xref"
   "Gtags executable."
   :type 'string
   :risky t)
 
-(defvar global-xref--roots-list nil
+(defvar gtags-xref--roots-list nil
   "Full list of Global roots.
 The address is absolute for remote hosts.")
-(put 'global-xref--roots-list 'risky-local-variable t)
+(put 'gtags-xref--roots-list 'risky-local-variable t)
 
-(defvar-local global-xref--global (executable-find global-xref-global))
-(defvar-local global-xref--gtags (executable-find global-xref-gtags))
-(defvar-local global-xref--project-root nil
+(defvar-local gtags-xref--global (executable-find gtags-xref-global))
+(defvar-local gtags-xref--gtags (executable-find gtags-xref-gtags))
+(defvar-local gtags-xref--project-root nil
   "Project Global root for this buffer.
 the address is relative on remote hosts.")
 
-(defconst global-xref--output-format-regex
+(defconst gtags-xref--output-format-regex
   
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
-  "Regex to filter the output with `global-xref--output-format-options'.")
+  "Regex to filter the output with `gtags-xref--output-format-options'.")
 
-(defconst global-xref--output-format-options
+(defconst gtags-xref--output-format-options
   '("--result=ctags-x" "--path-style=absolute")
-  "Command line options to use with `global-xref--output-format-regex'.")
+  "Command line options to use with `gtags-xref--output-format-regex'.")
 
 ;; Connection functions
-(defun global-xref--set-connection-locals ()
+(defun gtags-xref--set-connection-locals ()
   "Set GLOBAL connection local variables when possible and needed."
   (when-let* ((remote (file-remote-p default-directory))
  (criteria (connection-local-criteria-for-default-directory))
- ((not (and (local-variable-p 'global-xref--global)
-(local-variable-p 'global-xref--gtags
- (symvars (intern (concat "global-xref--" remote "-vars")))
+ ((not (and (local-variable-p 'gtags-xref--global)
+(local-variable-p 'gtags-xref--gtags
+ (symvars (intern (concat "gtags-xref--" remote "-vars")))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)
   (with-connection-local-variables
-   (let ((xref-global (if (local-variable-p 'global-xref-global)
- global-xref-global
-   (file-name-nondirectory global-xref-global)))
+   (let ((xref-global (if (local-variable-p 'gtags-xref-global)
+ gtags-xref-global
+   (file-name-nondirectory gtags-xref-global)))
 (xref-gtags (if (local-variable-p 'gtags-xref-global)
-global-xref-gtags
-  (file-name-nondirectory global-xref-gtags
+gtags-xref-gtags
+  (file-name-nondirectory gtags-xref-gtags
 (connection-local-set-profile-variables
  symvars
- `((global-xref--global . ,(executable-find xref-global t))
-   (global-xref--gtags . ,(executable-find xref-gtags t
+ `((gtags-xref--global . ,(executable-find xref-global t))
+   (gtags-xref--gtags . ,(executable-find xref-gtags t
 (connection-local-set-profiles criteria symvars
 (hack-connection-local-variables-apply criteria)))
 
 ;; Async functions
-(defun global-xref--exec-async-sentinel (process event)
+(defun gtags-xref--exec-async-sent

[elpa] externals/gtags-mode 0954a065d3 37/61: Miscellaneous fixes

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 0954a065d3e8e5a181bfd2e9d48323945d61138a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Miscellaneous fixes
---
 gtags-mode.el | 38 ++
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 634e072ec9..c03d3cc3a3 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -114,9 +114,9 @@ This is the sentinel set in `gtags-mode--exec-async'."
 
 (defun gtags-mode--exec-async (cmd args)
   "Run CMD with ARGS asynchronously and set SENTINEL to process.
-Starts an asynchronous process and sets
-`gtags-mode--exec-async-sentinel' as the process sentinel if
-SENTINEL is nil or not specified.  Returns the process object."
+Start an asynchronous process and sets
+`gtags-mode--exec-async-sentinel' as the process sentinel.
+Returns the process object."
   (when cmd
 (let ((pr (make-process :name (format "%s-async" cmd)
:buffer (generate-new-buffer " *temp*" t)
@@ -127,17 +127,15 @@ SENTINEL is nil or not specified.  Returns the process 
object."
   pr)))
 
 (defun gtags-mode--exec-sync (args)
-  "Run CMD with ARGS synchronously, on success call SENTINEL.
-Starts a sync process; on success call SENTINEL or
-`gtags-mode--sync-sentinel' if SENTINEL is not specified or nil.
-Returns the output of SENTINEL or nil if any error occurred."
-  (when cmd
-(with-temp-buffer ;; When sync
-  (let ((status (apply #'process-file gtags-mode--global nil 
(current-buffer) nil args)))
+  "Run global with ARGS synchronously.
+On success return a list of strings or nil if any error occurred."
+  (when-let ((global gtags-mode--global))
+(with-temp-buffer
+  (let ((status (apply #'process-file global nil (current-buffer) nil 
args)))
(if (eq status 0)
(string-lines (buffer-string) t)
  (message "Global error output:\n%s" (buffer-string))
- (message "Sync %s %s: exited abnormally with code %s" cmd args status)
+ (message "Sync global %s: exited abnormally with code %s" args status)
  nil)
 
 ;; Utilities functions (a bit less low level) 
@@ -179,12 +177,13 @@ completions usually from the cache when possible."
 
 (defun gtags-mode--buffers-in-root (root)
   "Return a list of buffers which variable `buffer-file-name' is inside ROOT."
-  (mapcan (lambda (buf)
-   (when-let* ((bname (buffer-local-value 'buffer-file-name buf))
-   (tname (file-truename bname))
-   ((string-prefix-p root tname)))
- (list buf)))
- (buffer-list)))
+  (when root
+(mapcan (lambda (buf)
+ (when-let* ((bname (buffer-local-value 'buffer-file-name buf))
+ (tname (file-truename bname))
+ ((string-prefix-p root tname)))
+   (list buf)))
+   (buffer-list
 
 (defun gtags-mode--filter-find-symbol (args symbol creator)
   "Run `gtags-mode--exec-sync' with ARGS on SYMBOL and filter output with 
CREATOR.
@@ -230,7 +229,7 @@ name, code, file, line."
 
 (defun gtags-mode--find-file-hook ()
   "Try to enable `gtags' when opening a file.
-Check the roots and enable `gtags' if the found-file is in
+Check the roots list and enable `gtags' if the open file is in
 one of them."
   (when (gtags-mode--get-plist buffer-file-name #'identity)
 (gtags-mode 1)))
@@ -238,8 +237,7 @@ one of them."
 ;; xref integration ==
 (defun gtags-mode--xref-find-symbol (args symbol)
   "Run GNU Global to create xref input list with ARGS on SYMBOL.
-Return the results as a list of xref location objects.  ARGS are
-any additional command line arguments to pass to GNU Global."
+Return as a list of xref location objects."
   (gtags-mode--filter-find-symbol
args symbol
(lambda (_name code file line)



[elpa] externals/gtags-mode 7dc81cbae2 56/61: Small simplifies

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 7dc81cbae245be2d3a1cfaf4517ff5791fd59fb4
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Small simplifies
---
 gtags-mode.el | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index e06bd6a5b3..8d137c1454 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -65,7 +65,7 @@ The address is absolute for remote hosts.")
   "Regex to filter the output with `gtags-mode--output-format-options'.")
 
 (defconst gtags-mode--output-format-options
-  '("--result=ctags-x" "--path-style=absolute")
+  '("--result=ctags-x" "--path-style=absolute --color=never")
   "Command line options to use with `gtags-mode--output-format-regex'.")
 
 ;; Connection functions
@@ -75,7 +75,7 @@ The address is absolute for remote hosts.")
  ((not (and (local-variable-p 'gtags-mode--global)
 (local-variable-p 'gtags-mode--gtags
  (criteria (connection-local-criteria-for-default-directory))
- (symvars (intern (concat "gtags-mode--" remote "-vars")))
+ (symvars (intern (format "gtags-mode--%s-vars" remote)))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)
   (with-connection-local-variables  ;; because *-executable can be set as 
connection local
@@ -248,12 +248,12 @@ This iterates over the buffers and tries to reset
 (defun gtags-mode--xref-find-symbol (args symbol)
   "Run GNU Global to create xref input list with ARGS on SYMBOL.
 Return as a list of xref location objects."
-  (gtags-mode--filter-find-symbol
-   args symbol
-   (lambda (_name code file line)
- (xref-make code (xref-make-file-location
- (concat (file-remote-p default-directory) file)
- line 0)
+  (let ((remote (file-remote-p default-directory)))
+(gtags-mode--filter-find-symbol
+ args symbol
+ (lambda (_name code file line)
+   (xref-make code (xref-make-file-location
+   (file-truename (concat remote file)) line 0))
 
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (head 
:gtagsroot)))
   "List all symbols."



[elpa] externals/gtags-mode 65c2da145a 11/61: Reorder code a but and simplify.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 65c2da145a38b96d583aea0b2fbe9ac4b8a896bf
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Reorder code a but and simplify.
---
 global-xref.el | 85 +-
 1 file changed, 49 insertions(+), 36 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index e75a84bb01..81318bffc9 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -31,6 +31,7 @@
 
 (require 'xref)
 (require 'cl-generic)
+(require 'files-x)
 
 (defgroup global-xref nil
   "GNU Global grup for xref."
@@ -67,6 +68,34 @@ the address is relative on remote hosts.")
   '("--result=ctags-x" "--path-style=absolute")
   "Command line options to use with `global-xref--output-format-regex'.")
 
+;; Connection functions
+(defun global-xref--set-connection-locals ()
+  "Set GLOBAL connection local variables when possible and needed."
+  (when-let* ((host (file-remote-p default-directory 'host))
+ (symvars (intern (concat "global-xref-" host "-vars")))
+ ((not (alist-get symvars connection-local-profile-alist)))
+ (criteria `(:machine ,host)))
+(connection-local-set-profile-variables
+ symvars
+ `((global-xref--global . ,(executable-find (file-name-base 
global-xref-global) t))
+   (global-xref--gtags . ,(executable-find (file-name-base 
global-xref-gtags) t
+(connection-local-set-profiles criteria symvars)))
+
+;; Async functions
+(defun global-xref--exec-async-sentinel (process event)
+  "Sentinel to run when PROCESS emits EVENT.
+This is the sentinel set in `global-xref--exec-async'."
+  (let ((temp-buffer (process-buffer process)))
+(while (accept-process-output process))
+(if (eq (process-status process) 'exit)
+   (and (buffer-name temp-buffer)
+(kill-buffer temp-buffer))
+  (with-current-buffer temp-buffer
+   (while (accept-process-output process))
+   (while (accept-process-output process))
+   (message "global error output:\n%s" (buffer-string)
+  (message "Async %s: %s" (process-command process) event))
+
 (defun global-xref--exec-async (command args)
   "Run COMMAND with ARGS asynchronously.
 Starts an async process and sets an informative process sentinel.
@@ -76,19 +105,23 @@ Returns the process handler."
   (process (apply #'start-file-process
   (format "%s-async" cmd)
   (generate-new-buffer " *temp*" t) cmd args)))
- (set-process-sentinel
-  process
-  (lambda (process event)
-   (let ((temp-buffer (process-buffer process)))
- (while (accept-process-output process))
- (if (eq (process-status process) 'exit)
- (and (buffer-name temp-buffer)
-  (kill-buffer temp-buffer))
-   (with-current-buffer temp-buffer
- (message "global error output:\n%s" (buffer-string)
-   (message "Async %s: %s" (process-command process) event)))
+ (set-process-sentinel process #'global-xref--exec-async-sentinel)
  process)))
 
+;; Sync functions
+(defun global-xref--sync-sentinel ()
+  "Return current buffer text as a list of strings."
+  (let (lines substring)
+(goto-char (point-min))
+(while (not (eobp))
+  (setq substring (buffer-substring-no-properties
+  (line-beginning-position)
+  (line-end-position)))
+  (unless (string-blank-p substring)
+   (push substring lines))
+  (forward-line 1))
+(nreverse lines)))
+
 (defun global-xref--exec-sync (command args)
   "Run COMMAND with ARGS synchronously.
 Starts a sync process returns the output of the command as a list
@@ -98,32 +131,12 @@ of strings or nil if any error occurred."
  (with-temp-buffer ;; When sync
(let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
 (if (eq status 0)
-(let (lines substring)
-  (goto-char (point-min))
-  (while (not (eobp))
-(when (not (string-blank-p
-(setq substring (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position)
-  (push substring lines))
-(forward-line 1))
-  (nreverse lines))
+(global-xref--sync-sentinel)
   (message "global error output:\n%s" (buffer-string))
   (error "Sync %s %s: exited abnormally with code %s" cmd args status)
   nil))
 
-(defun global-xref--set-connection-locals ()
-  "Set GLOBAL connection local variables when possible."
-  (when-let* ((host (file-remote-p default-directory 'host))
- (symvars (intern (concat "global-xref-" host "-vars")))
- ((not (alist-get symvars connection-local-profile-alist)))
- (criteria `(:machine ,host)))
-(connection-local-set-profile-var

[elpa] externals/gtags-mode 9c4323a5e6 13/61: Improve connection local code.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 9c4323a5e6bad59da86b66a64e55996471861a9c
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Improve connection local code.
---
 global-xref.el | 39 +++
 1 file changed, 27 insertions(+), 12 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 7734266120..0feba4043f 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -39,15 +39,18 @@
 
 (defcustom global-xref-global "global"
   "GNU Global executable."
-  :type 'string)
+  :type 'string
+  :local t)
 
 (defcustom global-xref-gtags "gtags"
   "Gtags executable."
-  :type 'string)
+  :type 'string
+  :local t)
 
 (defcustom global-xref-lighter "Global-Xref"
   "Gtags executable."
-  :type 'string)
+  :type 'string
+  :risky t)
 
 (defvar global-xref--roots-list nil
   "Full list of project Global root.
@@ -72,14 +75,26 @@ the address is relative on remote hosts.")
 (defun global-xref--set-connection-locals ()
   "Set GLOBAL connection local variables when possible and needed."
   (when-let* ((host (file-remote-p default-directory 'host))
- (symvars (intern (concat "global-xref-" host "-vars")))
- ((not (alist-get symvars connection-local-profile-alist)))
- (criteria `(:machine ,host)))
-(connection-local-set-profile-variables
- symvars
- `((global-xref--global . ,(executable-find (file-name-base 
global-xref-global) t))
-   (global-xref--gtags . ,(executable-find (file-name-base 
global-xref-gtags) t
-(connection-local-set-profiles criteria symvars)))
+ ((not (and (local-variable-p 'global-xref--global)
+(local-variable-p 'global-xref--gtags
+ (symvars (intern (concat "global-xref--" host "-vars")))
+ (enable-connection-local-variables t))
+(unless (alist-get symvars connection-local-profile-alist)
+  (with-connection-local-variables
+   (let ((criteria `(:machine ,host))
+(xref-global (if (local-variable-p 'global-xref-global)
+ global-xref-global
+   (file-name-nondirectory global-xref-global)))
+(xref-gtags (if (local-variable-p 'gtags-xref-global)
+global-xref-gtags
+  (file-name-nondirectory global-xref-gtags
+(connection-local-set-profile-variables
+ symvars
+ `((global-xref--global . ,(executable-find xref-global t))
+   (global-xref--gtags . ,(executable-find xref-gtags t
+(connection-local-set-profiles criteria symvars
+(hack-connection-local-variables-apply
+ (connection-local-criteria-for-default-directory
 
 ;; Async functions
 (defun global-xref--exec-async-sentinel (process event)
@@ -91,7 +106,7 @@ This is the sentinel set in `global-xref--exec-async'."
 (kill-buffer temp-buffer))
   (with-current-buffer temp-buffer
(while (accept-process-output process))
-   (message "global error output:\n%s" (buffer-string)
+   (message "Global error output:\n%s" (buffer-string)
   (message "Async %s: %s" (process-command process) event))
 
 (defun global-xref--exec-async (command args &optional sentinel)



[elpa] externals/gtags-mode ea16b9d8c7 23/61: global-xref-project-backend shouldn't call global-xref--find-root.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit ea16b9d8c748fc7a4403a222dd36e8f2c209edd9
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

global-xref-project-backend shouldn't call global-xref--find-root.

Only buffers with the mode enables may use these functions.
---
 global-xref.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 3939dd3709..fcd16232c6 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -284,9 +284,7 @@ any additional command line arguments to pass to GNU 
Global."
 ;; project integration ===
 (defun global-xref-project-backend (dir)
   "Return the project for DIR as an array."
-  (when-let ((default-directory dir)
-(root (or (global-xref--has-open-root dir)
-  (global-xref--find-root
+  (when-let ((root (global-xref--has-open-root dir)))
 (list 'global-xref root)))
 
 (cl-defmethod project-root ((project (head global-xref)))



[elpa] externals/gtags-mode 70b6c217d5 20/61: Add support for project.el.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 70b6c217d525afe881f57bdf6139e7e757ed76ca
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add support for project.el.

(global-xref--has-open-root) : New auxiliar functions.
(global-xref-project-backend) :
(project-root) :
(project-files) : New functions for the project backend.
---
 global-xref.el | 62 +++---
 1 file changed, 46 insertions(+), 16 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 312f9211c0..f539950752 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -159,13 +159,12 @@ occurred."
 ;; Api functions
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (let ((root (car (global-xref--exec-sync 'global-xref--global
-  '("--print-dbpath")
-(when root
-  (add-to-list 'global-xref--roots-list
-  (concat (file-remote-p default-directory)
-  (file-truename root)))
-  root)))
+  (when-let ((root (car (global-xref--exec-sync 'global-xref--global
+   '("--print-dbpath")
+(setq root (concat (file-remote-p default-directory)
+  (file-truename root)))
+(add-to-list 'global-xref--roots-list root)
+root))
 
 (defun global-xref--filter-find-symbol (args symbol creator)
   "Run `global-xref--exec-sync' with ARGS on SYMBOL and filter output with 
CREATOR.
@@ -184,7 +183,8 @@ name, code, file, line."
   (global-xref--exec-sync
'global-xref--global
(append args global-xref--output-format-options
-   (list (shell-quote-argument symbol)))
+   (unless (string-blank-p symbol)
+ (list (shell-quote-argument symbol
 
 ;; Interactive commands ==
 (defun global-xref-create (root-dir)
@@ -208,18 +208,22 @@ name, code, file, line."
  (list "--single-update"
   (file-name-nondirectory buffer-file-name)
 
+(defun global-xref--has-open-root (file)
+  "Check for a known prefix for FILE in `global-xref--roots-list'."
+  (let ((truename (file-truename file)))
+(catch 'found
+  (mapc (lambda (root)
+ (when (string-prefix-p root truename)
+   (throw 'found root)))
+   global-xref--roots-list)
+  nil)))
+
 (defun global-xref--find-file-hook ()
   "Try to enable `global-xref' when opening a file.
 Check the roots and enable `global-xref' if the found-file is in
 one of them."
-  (let ((truename (file-truename buffer-file-name)))
-(catch 'found
-  (mapc (lambda (x)
- (when (string-prefix-p x truename)
-   (global-xref-mode 1)
-   (throw 'found x)))
-   global-xref--roots-list)
-  nil)))
+  (when (global-xref--has-open-root buffer-file-name)
+(global-xref-mode 1)))
 
 ;; xref integration ==
 (defun global-xref--find-symbol (args symbol)
@@ -268,6 +272,30 @@ any additional command line arguments to pass to GNU 
Global."
  (lambda (name _code _file line)
(list name line #'global-xref--imenu-goto-function)
 
+;; project integration ===
+(defun global-xref-project-backend (dir)
+  "Return the project for DIR as an array."
+  (when-let ((default-directory dir)
+(root (or (global-xref--has-open-root dir)
+  (global-xref--find-root
+(list 'global-xref root)))
+
+(cl-defmethod project-root ((project (head global-xref)))
+  "Root for PROJECT."
+  (cadr project))
+
+(cl-defmethod project-files ((project (head global-xref)) &optional dirs)
+  "Root for PROJECT."
+  (let* ((root (cadr project))
+(remote (file-remote-p root)))
+(mapcan (lambda (dir)
+ (when (string-prefix-p root dir)
+   (global-xref--filter-find-symbol
+'("-a" "--path") (string-remove-prefix root dir)
+(lambda (_name _code file _line)
+  (concat remote file)
+   (or dirs (list root)
+
 ;;;###autoload
 (define-minor-mode global-xref-mode
   "Use GNU Global as backend for several Emacs features in this buffer."
@@ -280,6 +308,7 @@ any additional command line arguments to pass to GNU 
Global."
 (add-hook 'find-file-hook #'global-xref--find-file-hook t)
 (add-hook 'xref-backend-functions #'global-xref-xref-backend nil t)
 (add-hook 'after-save-hook #'global-xref--after-save-hook nil t)
+(add-hook 'project-find-functions #'global-xref-project-backend)
 (setq global-xref--imenu-default-function imenu-create-index-function)
 (setq imenu-create-index-function 
#'global-xref-imenu-create-index-function))
(t
@@ -287,6 +316,7 @@ any additional command line arguments to pass to GNU 
Global."
 (remove-hook 'find-f

[elpa] externals/gtags-mode 75aef71741 19/61: Fix messages.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 75aef71741ff430405901c41ad4dfca0175f3b4a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix messages.
---
 global-xref.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index bb5778cb1a..312f9211c0 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -152,8 +152,8 @@ occurred."
   (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
(if (eq status 0)
(funcall sentinel)
- (message "global error output:\n%s" (buffer-string))
- (error "Sync %s %s: exited abnormally with code %s" cmd args status)
+ (message "Global error output:\n%s" (buffer-string))
+ (message "Sync %s %s: exited abnormally with code %s" cmd args status)
  nil)
 
 ;; Api functions



[elpa] externals/gtags-mode c2e13cc742 33/61: Use a better name gtags-mode is free.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit c2e13cc74200f8968038f7474c18a52f25aef6c5
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use a better name gtags-mode is free.
---
 gtags-xref.el => gtags-mode.el | 226 -
 1 file changed, 113 insertions(+), 113 deletions(-)

diff --git a/gtags-xref.el b/gtags-mode.el
similarity index 55%
rename from gtags-xref.el
rename to gtags-mode.el
index c5e00bfca0..15b4c1f23f 100644
--- a/gtags-xref.el
+++ b/gtags-mode.el
@@ -1,9 +1,9 @@
-;;; gtags-xref.el --- GNU Global integration with xref, project and imenu. -*- 
lexical-binding: t; -*-
+;;; gtags-mode.el --- GNU Global integration with xref, project and imenu. -*- 
lexical-binding: t; -*-
 
 ;; Copyright (C) 2022 Jimmy Aguilar Mena
 
 ;; Author: Jimmy Aguilar Mena
-;; URL: https://github.com/Ergus/gtags-xref
+;; URL: https://github.com/Ergus/gtags-mode
 ;; Keywords: xref, project, imenu, gtags, global
 ;; Version: 1.0 alpha
 ;; Package-Requires: ((emacs "28"))
@@ -31,72 +31,72 @@
 (require 'cl-generic)
 (require 'files-x)
 
-(defgroup gtags-xref nil
-  "GNU Global grup for xref."
+(defgroup gtags-mode nil
+  "GNU Global group for xref."
   :group 'xref)
 
-(defcustom gtags-xref-global "global"
+(defcustom gtags-mode-global-executable "global"
   "GNU Global executable."
   :type 'string
   :local t)
 
-(defcustom gtags-xref-gtags "gtags"
-  "Gtags executable."
+(defcustom gtags-mode-gtags-executable "gtags"
+  "GNU Gtags executable."
   :type 'string
   :local t)
 
-(defcustom gtags-xref-lighter "Gtags-Xref"
+(defcustom gtags-mode-lighter "Gtags"
   "Gtags executable."
   :type 'string
   :risky t)
 
-(defvar gtags-xref--roots-list nil
+(defvar gtags-mode--roots-list nil
   "Full list of Global roots.
 The address is absolute for remote hosts.")
-(put 'gtags-xref--roots-list 'risky-local-variable t)
+(put 'gtags-mode--roots-list 'risky-local-variable t)
 
-(defvar-local gtags-xref--global (executable-find gtags-xref-global))
-(defvar-local gtags-xref--gtags (executable-find gtags-xref-gtags))
-(defvar-local gtags-xref--project-root nil
+(defvar-local gtags-mode--global (executable-find 
gtags-mode-global-executable))
+(defvar-local gtags-mode--gtags (executable-find gtags-mode-gtags-executable))
+(defvar-local gtags-mode--root nil
   "Project Global root for this buffer.
 the address is relative on remote hosts.")
 
-(defconst gtags-xref--output-format-regex
+(defconst gtags-mode--output-format-regex
   
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
-  "Regex to filter the output with `gtags-xref--output-format-options'.")
+  "Regex to filter the output with `gtags-mode--output-format-options'.")
 
-(defconst gtags-xref--output-format-options
+(defconst gtags-mode--output-format-options
   '("--result=ctags-x" "--path-style=absolute")
-  "Command line options to use with `gtags-xref--output-format-regex'.")
+  "Command line options to use with `gtags-mode--output-format-regex'.")
 
 ;; Connection functions
-(defun gtags-xref--set-connection-locals ()
+(defun gtags-mode--set-connection-locals ()
   "Set GLOBAL connection local variables when possible and needed."
   (when-let* ((remote (file-remote-p default-directory))
  (criteria (connection-local-criteria-for-default-directory))
- ((not (and (local-variable-p 'gtags-xref--global)
-(local-variable-p 'gtags-xref--gtags
- (symvars (intern (concat "gtags-xref--" remote "-vars")))
+ ((not (and (local-variable-p 'gtags-mode--global)
+(local-variable-p 'gtags-mode--gtags
+ (symvars (intern (concat "gtags-mode--" remote "-vars")))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)
   (with-connection-local-variables
-   (let ((xref-global (if (local-variable-p 'gtags-xref-global)
- gtags-xref-global
-   (file-name-nondirectory gtags-xref-global)))
-(xref-gtags (if (local-variable-p 'gtags-xref-global)
-gtags-xref-gtags
-  (file-name-nondirectory gtags-xref-gtags
+   (let ((global (if (local-variable-p 'gtags-mode-global-executable)
+gtags-mode-global-executable
+  (file-name-nondirectory gtags-mode-global-executable)))
+(gtags (if (local-variable-p 'gtags-mode-gtags-executable)
+   gtags-mode-gtags-executable
+ (file-name-nondirectory gtags-mode-gtags-executable
 (connection-local-set-profile-variables
  symvars
- `((gtags-xref--global . ,(executable-find xref-global t))
-   (gtags-xref--gtags . ,(executable-find xref-gtags t
+ `((gtags-mode--global . ,(executable-find global t))
+   (gtags-mode--gtags . ,(executable

[elpa] externals/gtags-mode 8734f6b54d 48/61: Reorder

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 8734f6b54d6e9c17dcc3d9a640235c8c262eabc9
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Reorder
---
 gtags-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 4b3aa3f972..e67d5980ea 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -73,9 +73,9 @@ The address is relative on remote hosts and includes the 
remote prefix.")
 (defun gtags-mode--set-connection-locals ()
   "Set GLOBAL connection local variables when possible and needed."
   (when-let* ((remote (file-remote-p default-directory))
- (criteria (connection-local-criteria-for-default-directory))
  ((not (and (local-variable-p 'gtags-mode--global)
 (local-variable-p 'gtags-mode--gtags
+ (criteria (connection-local-criteria-for-default-directory))
  (symvars (intern (concat "gtags-mode--" remote "-vars")))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)



[elpa] externals/gtags-mode 86777df9a3 50/61: Call gtags-mode--set-connection-locals before processes

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 86777df9a3f2ce624b8c15868d3aea4f05c47134
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Call gtags-mode--set-connection-locals before processes

Add some informative messages on failure.
---
 gtags-mode.el | 49 -
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 4071b5fb75..09f47805e9 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -123,31 +123,38 @@ This is the sentinel set in `gtags-mode--exec-async'."
 Start an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel.
 Returns the process object."
-  (when cmd
-(let* ((command (gtags-mode--quote (append `(,cmd) args) target))
-  (pr (make-process :name (format "%s-async" cmd)
-:buffer (generate-new-buffer " *temp*" t)
-:command command
-:sentinel #'gtags-mode--exec-async-sentinel
-:file-handler t)))
-  ;; In future not needed with `remote-commands'.
-  (set-process-plist pr `(:buffer ,(current-buffer) :command ,command))
-  pr)))
+  (gtags-mode--set-connection-locals)
+  (if-let* ((cmd (buffer-local-value cmd (current-buffer)))
+   (command (gtags-mode--quote (append `(,cmd) args) target))
+   (pr (make-process :name (format "%s-async" cmd)
+ :buffer (generate-new-buffer " *temp*" t)
+ :command command
+ :sentinel #'gtags-mode--exec-async-sentinel
+ :file-handler t)))
+  (progn
+   ;; In future not needed with `remote-commands'.
+   (set-process-plist pr `(:buffer ,(current-buffer) :command ,command))
+   pr)
+(message "Can't start async %s subprocess" cmd)
+nil))
 
 (defun gtags-mode--exec-sync (args &optional target)
   "Run global with ARGS on TARGET synchronously.
 On success return a list of strings or nil if any error occurred."
-  (when-let ((global gtags-mode--global) ;; Required for with-temp-buffer
-(cargs (gtags-mode--quote args target)))
-(with-temp-buffer
-  (let ((status (apply #'process-file global nil (current-buffer) nil 
cargs)))
-   (if (eq status 0)
-   (string-lines (string-trim (buffer-substring-no-properties
-   (point-min)
-   (point-max))) t)
- (message "Global sync error output:\n%s" (buffer-string))
- (message "Sync global %s: exited abnormally with code %s" cargs 
status)
- nil)
+  (gtags-mode--set-connection-locals)
+  (if-let ((cmd gtags-mode--global) ;; Required for with-temp-buffer
+  (cargs (gtags-mode--quote args target)))
+  (with-temp-buffer
+   (let ((status (apply #'process-file cmd nil (current-buffer) nil 
cargs)))
+ (if (eq status 0)
+ (string-lines (string-trim (buffer-substring-no-properties
+ (point-min)
+ (point-max))) t)
+   (message "Global sync error output:\n%s" (buffer-string))
+   (message "Sync global %s: exited abnormally with code %s" cargs 
status)
+   nil)))
+(message "Can't start sync %s subprocess" cmd)
+nil))
 
 ;; Utilities functions (a bit less low level) 
 (defun gtags-mode--get-plist (file)



[elpa] externals/gtags-mode 04c2d9fbaf 24/61: Use file-truename

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 04c2d9fbafbce3649b3fefca5b40bea304b9cf32
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use file-truename

project-files: Use file-truename
project-buffers : New function.
---
 global-xref.el | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index fcd16232c6..71f54376ab 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -293,16 +293,21 @@ any additional command line arguments to pass to GNU 
Global."
 
 (cl-defmethod project-files ((project (head global-xref)) &optional dirs)
   "Root for PROJECT."
-  (let* ((root (cadr project))
+  (let* ((root (project-root project))
 (remote (file-remote-p root)))
 (mapcan (lambda (dir)
- (when (string-prefix-p root dir)
+ (when-let* ((tdir (file-truename dir))
+ ((string-prefix-p root tdir)))
(global-xref--filter-find-symbol
-'("--path") (string-remove-prefix root dir)
+'("--path") (string-remove-prefix root tdir)
 (lambda (_name _code file _line)
   (concat remote file)
(or dirs (list root)
 
+(cl-defmethod project-buffers ((project (head global-xref)))
+  "Return the list of all live buffers that belong to PROJECT."
+  (global-xref--buffers-in-root (project-root project)))
+
 ;;;###autoload
 (define-minor-mode global-xref-mode
   "Use GNU Global as backend for several Emacs features in this buffer."



[elpa] externals/gtags-mode 13a0afbefd 31/61: Renamed to gtags-xref-mode.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 13a0afbefd3545ea82c7071e02029505519ff99f
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Renamed to gtags-xref-mode.
---
 global-xref.el => gtags-xref.el | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/global-xref.el b/gtags-xref.el
similarity index 100%
rename from global-xref.el
rename to gtags-xref.el



[elpa] externals/gtags-mode 54368ee7e0 38/61: Better use of the new plist.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 54368ee7e0ec39b6da719a7a1d6fd18115d40653
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Better use of the new plist.

Don't need to search as we could have a local copy.
---
 gtags-mode.el | 98 +++
 1 file changed, 45 insertions(+), 53 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index c03d3cc3a3..5ac06d392d 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -57,7 +57,7 @@ The address is absolute for remote hosts.")
 
 (defvar-local gtags-mode--global (executable-find 
gtags-mode-global-executable))
 (defvar-local gtags-mode--gtags (executable-find gtags-mode-gtags-executable))
-(defvar-local gtags-mode--root nil
+(defvar-local gtags-mode--plist nil
   "Project Global root for this buffer.
 The address is relative on remote hosts and includes the remote prefix.")
 
@@ -79,7 +79,7 @@ The address is relative on remote hosts and includes the 
remote prefix.")
  (symvars (intern (concat "gtags-mode--" remote "-vars")))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)
-  (with-connection-local-variables
+  (with-connection-local-variables  ;; because *-executable can be set as 
connection local
(let ((global (if (local-variable-p 'gtags-mode-global-executable)
 gtags-mode-global-executable
   (file-name-nondirectory gtags-mode-global-executable)))
@@ -108,8 +108,7 @@ This is the sentinel set in `gtags-mode--exec-async'."
(message "Global error output:\n%s" (buffer-string
 (when (buffer-live-p parent-buffer);; Always clear the cache
   (with-current-buffer parent-buffer
-   (gtags-mode--get-plist gtags-mode--root
-  (lambda (p) (plist-put p :cache nil))
+   (plist-put gtags-mode--plist :cache nil
   (message "Async %s: %s" (process-command process) event)) ;; Notify
 
 (defun gtags-mode--exec-async (cmd args)
@@ -133,56 +132,51 @@ On success return a list of strings or nil if any error 
occurred."
 (with-temp-buffer
   (let ((status (apply #'process-file global nil (current-buffer) nil 
args)))
(if (eq status 0)
-   (string-lines (buffer-string) t)
+   (string-lines (string-trim (buffer-substring-no-properties
+   (point-min)
+   (point-max))) t)
  (message "Global error output:\n%s" (buffer-string))
  (message "Sync global %s: exited abnormally with code %s" args status)
  nil)
 
 ;; Utilities functions (a bit less low level) 
-(defun gtags-mode--get-plist (file action)
+(defun gtags-mode--get-plist (file)
   "Apply ACTION on a plist with known prefix FILE from `gtags-mode--alist'."
   (let ((truename (file-truename file)))
 (catch 'found
   (mapc (lambda (plist)
- (when (string-prefix-p (plist-get plist :root) truename)
-   (throw 'found (funcall action plist
+ (when (string-prefix-p (plist-get plist :gtagsroot) truename)
+   (throw 'found plist)))
gtags-mode--alist)
   nil)))
 
-(defun gtags-mode--find-root ()
+(defun gtags-mode--find-or-create-plist ()
   "Return the GLOBAL project root.  Return nil if none."
-  (when-let ((root (car (gtags-mode--exec-sync '("--print-dbpath")
-(setq root (concat (file-remote-p default-directory)
-  (file-truename root)))
-(add-to-list 'gtags-mode--alist `(:root ,root :cache nil)
-nil (lambda (o1 o2)
-  (string= (plist-get o1 :root) (plist-get o2 :root
-root))
+  (when-let* ((root (car (gtags-mode--exec-sync '("--print-dbpath")
+(setq root (concat (file-remote-p default-directory) (file-truename root)))
+(or (gtags-mode--get-plist root)   ;; already exist
+   (car (push (list :gtagsroot root :cache nil) gtags-mode--alist)
 
 (defun gtags-mode--list-completions (prefix)
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
 completions usually from the cache when possible."
-  (if (and (stringp prefix) (not (string-blank-p prefix))) ;; not use cache
-  (gtags-mode--exec-sync (append '("--ignore-case" "--completion")
-`(,(shell-quote-argument prefix
-(gtags-mode--get-plist
- gtags-mode--root
- (lambda (plist);; set and return the cache
-   (if-let ((cache (plist-get plist :cache)))
-  cache
-(setq cache (gtags-mode--exec-sync '("--completion")))
-(plist-put plist :cache cache)
-cache)
-
-(defun gtags-mode--buffers-in-root (root)
-  "Return a list of buffers which variable `buffer-file-name' is inside ROOT."
-  (when root
+  (cond
+   ((and (stringp prefix) (not (string-blank-p p

[elpa] externals/gtags-mode 33938b17e7 41/61: New function

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 33938b17e7bbb5ed61a7162f770231b4071bddc2
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

New function

(gtags-mode--quote) : New function and use it.
(project-files) : Use a simpler format to reduce data transfers and 
postprocess.
---
 gtags-mode.el | 33 +++--
 1 file changed, 19 insertions(+), 14 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 284f23bf77..9f77be60bc 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -111,7 +111,12 @@ This is the sentinel set in `gtags-mode--exec-async'."
(plist-put gtags-mode--plist :cache nil
   (message "Async %s: %s" (process-command process) event)) ;; Notify
 
-(defun gtags-mode--exec-async (cmd args)
+(defsubst gtags-mode--quote (args symbol)
+  "Pre-process ARGS and quote SYMBOL."
+  (append args (and (stringp symbol) (not (string-blank-p symbol))
+   (list (shell-quote-argument symbol)
+
+(defun gtags-mode--exec-async (cmd args &optional target)
   "Run CMD with ARGS asynchronously and set SENTINEL to process.
 Start an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel.
@@ -119,24 +124,25 @@ Returns the process object."
   (when cmd
 (let ((pr (make-process :name (format "%s-async" cmd)
:buffer (generate-new-buffer " *temp*" t)
-   :command (append (list cmd) args)
+   :command (append `(,cmd) (gtags-mode--quote args 
target))
:sentinel #'gtags-mode--exec-async-sentinel
:file-handler t)))
   (process-put pr :buffer (current-buffer))
   pr)))
 
-(defun gtags-mode--exec-sync (args)
+(defun gtags-mode--exec-sync (args &optional target)
   "Run global with ARGS synchronously.
 On success return a list of strings or nil if any error occurred."
-  (when-let ((global gtags-mode--global))
+  (when-let ((global gtags-mode--global)
+(cargs (gtags-mode--quote args target)))
 (with-temp-buffer
-  (let ((status (apply #'process-file global nil (current-buffer) nil 
args)))
+  (let ((status (apply #'process-file global nil (current-buffer) nil 
cargs)))
(if (eq status 0)
(string-lines (string-trim (buffer-substring-no-properties
(point-min)
(point-max))) t)
  (message "Global error output:\n%s" (buffer-string))
- (message "Sync global %s: exited abnormally with code %s" args status)
+ (message "Sync global %s: exited abnormally with code %s" cargs 
status)
  nil)
 
 ;; Utilities functions (a bit less low level) 
@@ -191,9 +197,7 @@ name, code, file, line."
(match-string 3 line)   ;; file
(string-to-number (match-string 2 line) ;; line
   (gtags-mode--exec-sync
-   (append args gtags-mode--output-format-options
-   (unless (string-blank-p symbol)
- (list (shell-quote-argument symbol
+   (append args gtags-mode--output-format-options) symbol
 
 ;; Interactive commands ==
 (defun gtags-mode-create (root-dir)
@@ -280,17 +284,18 @@ Return as a list of xref location objects."
   (plist-get project :gtagsroot))
 
 (cl-defmethod project-files ((project (head :gtagsroot)) &optional dirs)
-  "List files inside all the PROJECT or in if specified DIRS ."
+  "List files inside all the PROJECT or in DIRS if specified."
   (let* ((root (project-root project))
 (remote (file-remote-p root))
 (results (mapcan
   (lambda (dir)
 (when-let* ((tdir (file-truename dir))
 ((string-prefix-p root tdir)))
-  (gtags-mode--filter-find-symbol
-   '("--path") (string-remove-prefix root tdir)
-   (lambda (_name _code file _line)
- (concat remote file)
+  (mapcar (lambda (file)
+(concat remote file)) ;; Add remote prefix
+  (gtags-mode--exec-sync
+   '("--path-style=absolute" "--path")
+   (string-remove-prefix root tdir)
   (or dirs (list root)
 (if (> (length dirs) 1) (delete-dups results) results)))
 



[elpa] externals/gtags-mode d1195ca318 40/61: Use memoization function

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit d1195ca31883130709575c4091d23562e4b07dca
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use memoization function
---
 gtags-mode.el | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 226b9a62ff..284f23bf77 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -161,13 +161,10 @@ On success return a list of strings or nil if any error 
occurred."
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
 completions usually from the cache when possible."
-  (cond
-   ((and (stringp prefix) (not (string-blank-p prefix))) ;; not use cache
-(gtags-mode--exec-sync (append '("--ignore-case" "--completion")
-`(,(shell-quote-argument prefix)
-   ((plist-get gtags-mode--plist :cache));; return cache
-   ((plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
-(plist-get gtags-mode--plist :cache ;; set and return cache
+  (or (and (stringp prefix) (not (string-blank-p prefix))
+  (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix))
+  (with-memoization (plist-get gtags-mode--plist :cache)
+   (gtags-mode--exec-sync '("--completion")
 
 (defun gtags-mode--buffers-in-root (plist)
   "Return a list of buffers which variable `buffer-file-name' is inside PLIST."



[elpa] externals/gtags-mode 95b730930b 27/61: Remove global-xref--sync-sentinel

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 95b730930b6d41aa4b61265257f5e3d477d4f1c4
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Remove global-xref--sync-sentinel

If not used, not needed. I only use global-xref--exec-sync to get a list
of lines and string-lines already do that.
---
 global-xref.el | 21 +++--
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index a549f3b223..2e26b8d289 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -122,31 +122,16 @@ SENTINEL is nil or not specified.  Returns the process 
object."
 (set-process-sentinel process sentinel)
 process))
 
-;; Sync functions
-(defun global-xref--sync-sentinel ()
-  "Return current buffer text as a list of strings."
-  (let (lines substring)
-(goto-char (point-min))
-(while (not (eobp))
-  (setq substring (buffer-substring-no-properties
-  (line-beginning-position)
-  (line-end-position)))
-  (unless (string-blank-p substring)
-   (push substring lines))
-  (forward-line 1))
-(nreverse lines)))
-
-(defun global-xref--exec-sync (command args &optional sentinel)
+(defun global-xref--exec-sync (command args)
   "Run COMMAND with ARGS synchronously, on success call SENTINEL.
 Starts a sync process; on success call SENTINEL or
 `global-xref--sync-sentinel' if SENTINEL is not specified or nil.
 Returns the output of SENTINEL or nil if any error occurred."
-  (when-let ((cmd (symbol-value command))
-(sentinel (or sentinel #'global-xref--sync-sentinel)))
+  (when-let ((cmd (symbol-value command)))
 (with-temp-buffer ;; When sync
   (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
(if (eq status 0)
-   (funcall sentinel)
+   (string-lines (buffer-string) t)
  (message "Global error output:\n%s" (buffer-string))
  (message "Sync %s %s: exited abnormally with code %s" cmd args status)
  nil)



[elpa] externals/gtags-mode 2e5ecb8042 39/61: Add check on mode enable.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 2e5ecb8042410e4905e9ae51a0caf715f8ea429a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add check on mode enable.

Don't enable the mode when not gtags db was found.
---
 gtags-mode.el | 40 ++--
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 5ac06d392d..226b9a62ff 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -317,25 +317,29 @@ Return as a list of xref location objects."
   (cond
(gtags-mode
 (gtags-mode--set-connection-locals)
-(setq gtags-mode--root (gtags-mode--find-root))
-(add-hook 'find-file-hook #'gtags-mode--find-file-hook)
-(add-hook 'project-find-functions #'gtags-mode-project-backend)
-(add-hook 'xref-backend-functions #'gtags-xref-backend nil t)
-(add-hook 'after-save-hook #'gtags-mode--after-save-hook nil t)
-(add-hook 'completion-at-point-functions #'gtags-mode-completion-function 
nil t)
-(setq gtags-mode--imenu-default-function imenu-create-index-function)
-(setq imenu-create-index-function #'gtags-mode-imenu-create-index-function)
-;; Enable the mode in all the files inside `gtags-mode--root'
-(when (called-interactively-p 'all)
-  (mapc (lambda (buff)
- (unless (buffer-local-value 'gtags-mode buff)
-   (with-current-buffer buff
- (gtags-mode 1
-   (gtags-mode--buffers-in-root gtags-mode--root
+(if (setq gtags-mode--plist (gtags-mode--find-or-create-plist))
+   (progn
+ (add-hook 'find-file-hook #'gtags-mode--find-file-hook)
+ (add-hook 'project-find-functions #'gtags-mode-project-backend)
+ (add-hook 'xref-backend-functions #'gtags-xref-backend nil t)
+ (add-hook 'after-save-hook #'gtags-mode--after-save-hook nil t)
+ (add-hook 'completion-at-point-functions 
#'gtags-mode-completion-function nil t)
+ (setq gtags-mode--imenu-default-function imenu-create-index-function)
+ (setq imenu-create-index-function 
#'gtags-mode-imenu-create-index-function)
+ ;; Enable the mode in all the files inside `gtags-mode--plist'
+ (when (called-interactively-p 'all)
+   (mapc (lambda (buff)
+   (unless (buffer-local-value 'gtags-mode buff)
+ (with-current-buffer buff
+   (gtags-mode 1
+ (gtags-mode--buffers-in-root gtags-mode--plist
+  (when (called-interactively-p 'all)
+   (message "Couldn't enable gtags-mode. Not root found."))
+  (setq gtags-mode -1)))
(t
-(setq gtags-mode--root nil)
-(remove-hook 'find-file-hook #'gtags-mode--find-file-hook)
-(remove-hook 'project-find-functions #'gtags-mode-project-backend)
+(setq gtags-mode--plist nil)
+;; (remove-hook 'find-file-hook #'gtags-mode--find-file-hook)
+;; (remove-hook 'project-find-functions #'gtags-mode-project-backend)
 (remove-hook 'xref-backend-functions #'gtags-xref-backend t)
 (remove-hook 'after-save-hook #'gtags-mode--after-save-hook t)
 (remove-hook 'completion-at-point-functions 
#'gtags-mode-completion-function t)



[elpa] externals/gtags-mode 599dfb8002 18/61: Improve debug of async processes.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 599dfb80029eed62d0a2754cc64fecb4e7b708c5
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Improve debug of async processes.

Check process-exit-status too.
Fix the path in local updates
---
 global-xref.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 2ba6858128..bb5778cb1a 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -101,7 +101,8 @@ the address is relative on remote hosts.")
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `global-xref--exec-async'."
   (let ((temp-buffer (process-buffer process)))
-(if (eq (process-status process) 'exit)
+(if (and (eq (process-status process) 'exit)
+(eq (process-exit-status process) 0))
(and (buffer-name temp-buffer)
 (kill-buffer temp-buffer))
   (with-current-buffer temp-buffer
@@ -203,7 +204,9 @@ name, code, file, line."
   "After save hook to update GLOBAL database with changed data."
   (when (and buffer-file-name global-xref--project-root)
 (global-xref--exec-async
- 'global-xref--global `("--single-update" ,buffer-file-name
+ 'global-xref--global
+ (list "--single-update"
+  (file-name-nondirectory buffer-file-name)
 
 (defun global-xref--find-file-hook ()
   "Try to enable `global-xref' when opening a file.



[elpa] externals/gtags-mode 3d7bf179bb 29/61: Use make-process instead of start-file-process.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 3d7bf179bb8b77e49900af039e7837a94b1948ec
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use make-process instead of start-file-process.
---
 global-xref.el | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 771a735146..b5bd14492c 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -112,15 +112,12 @@ This is the sentinel set in `global-xref--exec-async'."
 Starts an asynchronous process and sets
 `global-xref--exec-async-sentinel' as the process sentinel if
 SENTINEL is nil or not specified.  Returns the process object."
-  (when-let* ((cmd (symbol-value command))
- (process (apply #'start-file-process
- (format "%s-async" cmd)
- (generate-new-buffer " *temp*" t)
- cmd args))
- (sentinel (or sentinel
-   #'global-xref--exec-async-sentinel)))
-(set-process-sentinel process sentinel)
-process))
+  (when-let ((cmd (symbol-value command)))
+(make-process :name (format "%s-async" cmd)
+ :buffer (generate-new-buffer " *temp*" t)
+ :command (append (list cmd) args)
+ :sentinel #'global-xref--exec-async-sentinel
+ :file-handler t)))
 
 (defun global-xref--exec-sync (command args)
   "Run COMMAND with ARGS synchronously, on success call SENTINEL.



[elpa] externals/gtags-mode 55b0cbadb6 01/61: First commit.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 55b0cbadb6c39d56372db4c8af0b34e94bdb454d
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

First commit.

All basic functionalities are working.
---
 global-xref.el | 233 +
 1 file changed, 233 insertions(+)

diff --git a/global-xref.el b/global-xref.el
new file mode 100644
index 00..12e4f0b958
--- /dev/null
+++ b/global-xref.el
@@ -0,0 +1,233 @@
+;;; global-xref.el --- GNU Global integration with xref and imenu. -*- 
lexical-binding: t; -*-
+
+;; Copyright (C) 2022 Jimmy Aguilar Mena
+
+;; Author: Jimmy Aguilar Mena
+;; URL: https://github.com/Ergus/global-xref
+;; Keywords: xref, imenu, gtags, global
+;; Version: 1.0 alpha
+;; Package-Requires: ((emacs "28"))
+
+;; Copyright (C) 2022  Jimmy Aguilar Mena
+
+;; 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:
+
+;; GNU Global integration with xref and imenu.
+
+;;; Code:
+
+(require 'xref)
+(require 'cl-generic)
+
+(defgroup global-xref nil
+  "GNU Global grup for xref."
+  :group 'xref)
+
+(defcustom global-xref-global "global"
+  "GNU Global executable."
+  :type 'string)
+
+(defcustom global-xref-gtags "gtags"
+  "Gtags executable."
+  :type 'string)
+
+(defcustom global-xref-lighter "Global-Xref"
+  "Gtags executable."
+  :type 'string)
+
+(defun global-xref--buffer-to-list ()
+  "Return lines in current buffer in a list."
+  (let ((lines))
+(goto-char (point-min))
+(while (not (eobp))
+  (push (buffer-substring-no-properties
+(line-beginning-position) (line-end-position))
+   lines)
+  (forward-line 1))
+(nreverse lines)))
+
+(defvar-local global-xref--global (executable-find global-xref-global))
+(defvar-local global-xref--gtags (executable-find global-xref-gtags))
+
+(defvar-local global-xref--project-root nil
+  "Project Global root for this buffer.")
+
+(defun global-xref--process-file (args &optional postfunction)
+  "Run GNU Global with `process-file' and ARGS.
+Return the output as a string or passes it to POSTFUNCTION.
+Return nil if an error occurred."
+  (with-connection-local-variables
+   (when global-xref-global
+ (with-temp-buffer
+   (let ((status (apply #'process-file global-xref--global nil 
(current-buffer) nil args)))
+(if (eq status 0)
+(if (functionp postfunction)
+(funcall postfunction)
+  (string-trim (buffer-substring-no-properties (point-min) 
(point-max
+  (error "%s exited with status %s" global-xref--global status)
+  (let ((inhibit-message t))
+(message "global error output:\n%s" (buffer-string)))
+  nil))
+
+(defsubst global-xref--to-list (args)
+  "Run GNU Global with `process-file' and ARGS return a list."
+  (global-xref--process-file args #'global-xref--buffer-to-list))
+
+(defun global-xref--set-connection-locals ()
+  "Set GLOBAL connection local variables when possible."
+  (when-let* ((host (file-remote-p default-directory 'host))
+ (symvars (intern (concat "global-xref-" host "-vars")))
+ (criteria `(:machine ,host))
+ (connection-local-variables-alist t))
+(hack-connection-local-variables criteria)
+(unless (alist-get 'global-xref--global connection-local-variables-alist)
+  (connection-local-set-profile-variables
+   symvars
+   `((global-xref--global . ,(executable-find (file-name-base 
global-xref-global) t))
+(global-xref--gtags . ,(executable-find (file-name-base 
global-xref-gtags) t
+  (connection-local-set-profiles criteria symvars
+
+(defun global-xref--find-root ()
+  "Return the GLOBAL project root.  Return nil if none."
+  (global-xref--process-file '("--print-dbpath")))
+
+(defun global-xref--filter-find-symbol (creator args symbol)
+  "Run GNU Global and apply CREATOR to global-xref--to-list output.
+Return the results as a list."
+  (remove nil
+ (mapcar (lambda (gtags-x-line)
+   (when (string-match
+  "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ 
\t\]+\\)[ \t]+\\(.*\\)"
+  gtags-x-line)
+ (funcall creator
+  (match-string 1 gtags-x-line)   ;; name
+  (match-string 4 gtags-x-line)   ;; code
+   

[elpa] externals/gtags-mode 9763f8fb69 03/61: Add async processes to create and update database cleanly.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 9763f8fb69458432edd670b0f4074882a0cc0ee3
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add async processes to create and update database cleanly.
---
 global-xref.el | 132 +++--
 1 file changed, 82 insertions(+), 50 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 12e4f0b958..52092e0f4a 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -59,32 +59,59 @@
   (forward-line 1))
 (nreverse lines)))
 
+(defvar global-xref--roots-list nil)
+
 (defvar-local global-xref--global (executable-find global-xref-global))
 (defvar-local global-xref--gtags (executable-find global-xref-gtags))
-
 (defvar-local global-xref--project-root nil
   "Project Global root for this buffer.")
 
-(defun global-xref--process-file (args &optional postfunction)
-  "Run GNU Global with `process-file' and ARGS.
-Return the output as a string or passes it to POSTFUNCTION.
-Return nil if an error occurred."
+(defun global-xref--exec (command args async postfunction)
+  "Run COMMAND-SYM with and ARGS, in ASYNC way.
+When ASYNC is 'nil' executes command synchronously; returns the
+output of the command as a string or calls POSTFUNCTION in the
+command's buffer and returns the result.  returns nil if an error
+occurred.
+When ASYNC is non-nil starts an async process and executes the
+POSTFUNCTION in a sentinel.  Returns the process handler in all
+the cases"
   (with-connection-local-variables
-   (when global-xref-global
- (with-temp-buffer
-   (let ((status (apply #'process-file global-xref--global nil 
(current-buffer) nil args)))
-(if (eq status 0)
-(if (functionp postfunction)
-(funcall postfunction)
-  (string-trim (buffer-substring-no-properties (point-min) 
(point-max
-  (error "%s exited with status %s" global-xref--global status)
-  (let ((inhibit-message t))
-(message "global error output:\n%s" (buffer-string)))
-  nil))
+   (when-let (cmd (symbol-value command))
+ (if async ;; When async
+(let ((process (apply #'start-file-process
+  (format "%s-async" cmd)
+  (generate-new-buffer " *temp*" t) cmd args)))
+  (set-process-sentinel
+   process
+   (lambda (process event)
+ (if-let* (((eq (process-status process) 'exit))
+   (temp-buffer (process-buffer process)))
+   (with-current-buffer temp-buffer
+ (while (accept-process-output process))
+ (when (functionp postfunction)
+   (unwind-protect
+   (funcall postfunction)
+ (and (buffer-name temp-buffer)
+  (kill-buffer temp-buffer)
+   (let ((inhibit-message t))
+ (message "global error output:\n%s" (buffer-string
+ (message "Async %s: %s" (process-command process) event)))
+  process)
+
+   (with-temp-buffer ;; When sync
+(let ((status (apply #'process-file cmd nil (current-buffer) nil 
args)))
+  (if (eq status 0)
+  (if (functionp postfunction)
+  (funcall postfunction)
+(string-trim (buffer-substring-no-properties (point-min) 
(point-max
+(error "Sync %s: exited abnormally with code %s" cmd status)
+(let ((inhibit-message t))
+  (message "global error output:\n%s" (buffer-string)))
+nil)))
 
 (defsubst global-xref--to-list (args)
   "Run GNU Global with `process-file' and ARGS return a list."
-  (global-xref--process-file args #'global-xref--buffer-to-list))
+  (global-xref--exec 'global-xref--global args nil 
#'global-xref--buffer-to-list))
 
 (defun global-xref--set-connection-locals ()
   "Set GLOBAL connection local variables when possible."
@@ -102,48 +129,47 @@ Return nil if an error occurred."
 
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (global-xref--process-file '("--print-dbpath")))
+  (let ((root (global-xref--exec 'global-xref--global '("--print-dbpath") nil 
nil)))
+(when root
+  (add-to-list 'global-xref--roots-list root)
+  root)))
 
 (defun global-xref--filter-find-symbol (creator args symbol)
   "Run GNU Global and apply CREATOR to global-xref--to-list output.
 Return the results as a list."
-  (remove nil
- (mapcar (lambda (gtags-x-line)
-   (when (string-match
-  "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ 
\t\]+\\)[ \t]+\\(.*\\)"
-  gtags-x-line)
- (funcall creator
-  (match-string 1 gtags-x-line)   ;; name
-  (match-string 4 gtags-x-line)   ;; code
-  (match-string 3 gtags-x-line)   ;; f

[elpa] externals/gtags-mode 442f819924 07/61: General fixes.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 442f819924cc6921bfe2dbd291073766020b9719
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

General fixes.
---
 global-xref.el | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 30b2d46918..109c162f13 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -60,6 +60,7 @@
 (nreverse lines)))
 
 (defvar global-xref--roots-list nil)
+(put 'global-xref--roots-list 'risky-local-variable t)
 
 (defvar-local global-xref--global (executable-find global-xref-global))
 (defvar-local global-xref--gtags (executable-find global-xref-gtags))
@@ -86,13 +87,13 @@ the cases"
(lambda (process event)
  (if-let* (((eq (process-status process) 'exit))
(temp-buffer (process-buffer process)))
-   (with-current-buffer temp-buffer
- (while (accept-process-output process))
- (when (functionp postfunction)
-   (unwind-protect
-   (funcall postfunction)
- (and (buffer-name temp-buffer)
-  (kill-buffer temp-buffer)
+ (with-current-buffer temp-buffer
+   (while (accept-process-output process))
+   (when (functionp postfunction)
+ (unwind-protect
+ (funcall postfunction)
+   (and (buffer-name temp-buffer)
+(kill-buffer temp-buffer)
(let ((inhibit-message t))
  (message "global error output:\n%s" (buffer-string
  (message "Async %s: %s" (process-command process) event)))
@@ -104,7 +105,7 @@ the cases"
   (if (functionp postfunction)
   (funcall postfunction)
 (string-trim (buffer-substring-no-properties (point-min) 
(point-max
-(error "Sync %s: exited abnormally with code %s" cmd status)
+(error "Sync %s %s: exited abnormally with code %s" cmd args 
status)
 (let ((inhibit-message t))
   (message "global error output:\n%s" (buffer-string)))
 nil)))



[elpa] externals/gtags-mode 82b7f79aff 08/61: Simplify code.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 82b7f79aff91f1b5b6e52fcb61431d388fce4645
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Simplify code.

Remove unneeded features and redundant functions.
---
 global-xref.el | 70 --
 1 file changed, 24 insertions(+), 46 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 109c162f13..b1277ae29c 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -67,15 +67,14 @@
 (defvar-local global-xref--project-root nil
   "Project Global root for this buffer.")
 
-(defun global-xref--exec (command args async postfunction)
+(defun global-xref--exec (command args async &optional postfunction)
   "Run COMMAND-SYM with and ARGS, in ASYNC way.
 When ASYNC is 'nil' executes command synchronously; returns the
 output of the command as a string or calls POSTFUNCTION in the
 command's buffer and returns the result.  returns nil if an error
 occurred.
 When ASYNC is non-nil starts an async process and executes the
-POSTFUNCTION in a sentinel.  Returns the process handler in all
-the cases"
+ignores.  Returns the process handler."
   (with-connection-local-variables
(when-let (cmd (symbol-value command))
  (if async ;; When async
@@ -85,33 +84,27 @@ the cases"
   (set-process-sentinel
process
(lambda (process event)
- (if-let* (((eq (process-status process) 'exit))
-   (temp-buffer (process-buffer process)))
+ (let ((temp-buffer (process-buffer process)))
+   (while (accept-process-output process))
+   (if (eq (process-status process) 'exit)
+   (and (buffer-name temp-buffer)
+(kill-buffer temp-buffer))
  (with-current-buffer temp-buffer
-   (while (accept-process-output process))
-   (when (functionp postfunction)
- (unwind-protect
- (funcall postfunction)
-   (and (buffer-name temp-buffer)
-(kill-buffer temp-buffer)
-   (let ((inhibit-message t))
- (message "global error output:\n%s" (buffer-string
+   (message "global error output:\n%s" (buffer-string)
  (message "Async %s: %s" (process-command process) event)))
   process)
-
(with-temp-buffer ;; When sync
 (let ((status (apply #'process-file cmd nil (current-buffer) nil 
args)))
   (if (eq status 0)
   (if (functionp postfunction)
   (funcall postfunction)
 (string-trim (buffer-substring-no-properties (point-min) 
(point-max
+(message "global error output:\n%s" (buffer-string))
 (error "Sync %s %s: exited abnormally with code %s" cmd args 
status)
-(let ((inhibit-message t))
-  (message "global error output:\n%s" (buffer-string)))
 nil)))
 
 (defsubst global-xref--to-list (args)
-  "Run GNU Global with `process-file' and ARGS return a list."
+  "Run GLOBAL with `process-file' and ARGS; return a list."
   (global-xref--exec 'global-xref--global args nil 
#'global-xref--buffer-to-list))
 
 (defun global-xref--set-connection-locals ()
@@ -130,7 +123,7 @@ the cases"
 
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (let ((root (global-xref--exec 'global-xref--global '("--print-dbpath") nil 
nil)))
+  (let ((root (global-xref--exec 'global-xref--global '("--print-dbpath") 
nil)))
 (when root
   (add-to-list 'global-xref--roots-list
   (concat (file-remote-p default-directory)
@@ -142,15 +135,15 @@ the cases"
 Return the results as a list."
   (remove
nil
-   (mapcar (lambda (gtags-x-line)
+   (mapcar (lambda (line)
 (when (string-match
"^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t\]+\\)[ 
\t]+\\(.*\\)"
-   gtags-x-line)
+   line)
   (funcall creator
-   (match-string 1 gtags-x-line)   ;; name
-   (match-string 4 gtags-x-line)   ;; code
-   (match-string 3 gtags-x-line)   ;; file
-   (string-to-number (match-string 2 gtags-x-line)) ;; line
+   (match-string 1 line)   ;; name
+   (match-string 4 line)   ;; code
+   (match-string 3 line)   ;; file
+   (string-to-number (match-string 2 line)) ;; line
)))
   (global-xref--to-list
(append args (list "--result=ctags-x" "--path-style=absolute"
@@ -161,35 +154,20 @@ Return the results as a list."
   "Create a GLOBAL database in ROOT-DIR asynchronously."
   (interactive "DCreate db in directory: ")
   (let ((default-directory root-dir))
-(global-xref--exec
- 'global-xr

[elpa] externals/gtags-mode dc50f340d4 12/61: Small fixes in documentation and other details.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit dc50f340d47f31849a8dc44833a281058a9a1b4e
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Small fixes in documentation and other details.

Remove unneeded accept-process-output.
---
 global-xref.el | 44 
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 81318bffc9..7734266120 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -86,26 +86,27 @@ the address is relative on remote hosts.")
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `global-xref--exec-async'."
   (let ((temp-buffer (process-buffer process)))
-(while (accept-process-output process))
 (if (eq (process-status process) 'exit)
(and (buffer-name temp-buffer)
 (kill-buffer temp-buffer))
   (with-current-buffer temp-buffer
-   (while (accept-process-output process))
(while (accept-process-output process))
(message "global error output:\n%s" (buffer-string)
   (message "Async %s: %s" (process-command process) event))
 
-(defun global-xref--exec-async (command args)
-  "Run COMMAND with ARGS asynchronously.
-Starts an async process and sets an informative process sentinel.
-Returns the process handler."
+(defun global-xref--exec-async (command args &optional sentinel)
+  "Run COMMAND with ARGS asynchronously and set SENTINEL to process.
+Starts an asynchronous process and sets
+`global-xref--exec-async-sentinel' as the process sentinel if
+SENTINEL is 'nil' or not specified.  Returns the process
+handler."
   (with-connection-local-variables
(when-let* ((cmd (symbol-value command))
   (process (apply #'start-file-process
   (format "%s-async" cmd)
-  (generate-new-buffer " *temp*" t) cmd args)))
- (set-process-sentinel process #'global-xref--exec-async-sentinel)
+  (generate-new-buffer " *temp*" t) cmd args))
+  (sentinel (or sentinel #'global-xref--exec-async-sentinel)))
+ (set-process-sentinel process sentinel)
  process)))
 
 ;; Sync functions
@@ -122,16 +123,19 @@ Returns the process handler."
   (forward-line 1))
 (nreverse lines)))
 
-(defun global-xref--exec-sync (command args)
-  "Run COMMAND with ARGS synchronously.
-Starts a sync process returns the output of the command as a list
-of strings or nil if any error occurred."
+(defun global-xref--exec-sync (command args &optional sentinel)
+  "Run COMMAND with ARGS synchronously, on success call SENTINEL.
+Starts a sync process; on success call SENTINEL or
+`global-xref--sync-sentinel' if SENTINEL is not specified or
+'nil'.  Returns the output of SENTINEL or nil if any error
+occurred."
   (with-connection-local-variables
-   (when-let ((cmd (symbol-value command)))
+   (when-let ((cmd (symbol-value command))
+ (sentinel (or sentinel #'global-xref--sync-sentinel)))
  (with-temp-buffer ;; When sync
(let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
 (if (eq status 0)
-(global-xref--sync-sentinel)
+(funcall sentinel)
   (message "global error output:\n%s" (buffer-string))
   (error "Sync %s %s: exited abnormally with code %s" cmd args status)
   nil))
@@ -147,9 +151,9 @@ of strings or nil if any error occurred."
   root)))
 
 (defun global-xref--filter-find-symbol (args symbol creator)
-  "Run global-xref--exec-sync with ARGS on SYMBOL and filter output with 
CREATOR.
+  "Run `global-xref--exec-sync' with ARGS on SYMBOL and filter output with 
CREATOR.
 Returns the results as a list of CREATORS outputs similar to
-mapcar.  Creator should be a function with 4 input arguments:
+`mapcar'.  Creator should be a function with 4 input arguments:
 name, code, file, line."
   (remove
nil
@@ -164,11 +168,11 @@ name, code, file, line."
 (global-xref--exec-sync
  'global-xref--global
  (append args global-xref--output-format-options
-(list (shell-quote-argument symbol)))
+`(,(shell-quote-argument symbol)))
 
 ;; Interactive commands ==
-(defun global-xref-create-db (root-dir)
-  "Create a GLOBAL database in ROOT-DIR asynchronously."
+(defun global-xref-create (root-dir)
+  "Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
   (interactive "DCreate db in directory: ")
   (let ((default-directory root-dir))
 (global-xref--exec-async 'global-xref--gtags nil)))
@@ -244,7 +248,7 @@ any additional command line arguments to pass to GNU 
Global."
 (global-xref--filter-find-symbol
  '("--file") (file-name-nondirectory buffer-file-name)
  (lambda (name _code _file line)
-   (list name line #'global-xref--imenu-goto-function)
+   `(,name ,line #'global-xref--imenu-goto-function)
 
 ;;;###autoload
 (define-minor-mode glo

[elpa] externals/gtags-mode 053184f8b5 14/61: Don't call with-connection-local-variables

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 053184f8b5dc9afdf612b3f00fc334210263575a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Don't call with-connection-local-variables

With the new changes in the code it is not needed.
---
 global-xref.el | 34 --
 1 file changed, 16 insertions(+), 18 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 0feba4043f..8e3498ad86 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -115,14 +115,13 @@ Starts an asynchronous process and sets
 `global-xref--exec-async-sentinel' as the process sentinel if
 SENTINEL is 'nil' or not specified.  Returns the process
 handler."
-  (with-connection-local-variables
-   (when-let* ((cmd (symbol-value command))
-  (process (apply #'start-file-process
-  (format "%s-async" cmd)
-  (generate-new-buffer " *temp*" t) cmd args))
-  (sentinel (or sentinel #'global-xref--exec-async-sentinel)))
- (set-process-sentinel process sentinel)
- process)))
+  (when-let* ((cmd (symbol-value command))
+ (process (apply #'start-file-process
+ (format "%s-async" cmd)
+ (generate-new-buffer " *temp*" t) cmd args))
+ (sentinel (or sentinel #'global-xref--exec-async-sentinel)))
+(set-process-sentinel process sentinel)
+process))
 
 ;; Sync functions
 (defun global-xref--sync-sentinel ()
@@ -144,16 +143,15 @@ Starts a sync process; on success call SENTINEL or
 `global-xref--sync-sentinel' if SENTINEL is not specified or
 'nil'.  Returns the output of SENTINEL or nil if any error
 occurred."
-  (with-connection-local-variables
-   (when-let ((cmd (symbol-value command))
- (sentinel (or sentinel #'global-xref--sync-sentinel)))
- (with-temp-buffer ;; When sync
-   (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
-(if (eq status 0)
-(funcall sentinel)
-  (message "global error output:\n%s" (buffer-string))
-  (error "Sync %s %s: exited abnormally with code %s" cmd args status)
-  nil))
+  (when-let ((cmd (symbol-value command))
+(sentinel (or sentinel #'global-xref--sync-sentinel)))
+(with-temp-buffer ;; When sync
+  (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
+   (if (eq status 0)
+   (funcall sentinel)
+ (message "global error output:\n%s" (buffer-string))
+ (error "Sync %s %s: exited abnormally with code %s" cmd args status)
+ nil)
 
 ;; Api functions
 (defun global-xref--find-root ()



[elpa] externals/gtags-mode cd79d73561 26/61: Fix following Michael Albinus recommendations.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit cd79d73561dd56f361312e5413a4c5508008353a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix following Michael Albinus recommendations.
---
 Readme.md  |  2 +-
 global-xref.el | 27 +++
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/Readme.md b/Readme.md
index 50cf6ccdc6..30e8344413 100644
--- a/Readme.md
+++ b/Readme.md
@@ -4,5 +4,5 @@ Readme
 This is a simple project to enable GNU global integration with Emacs
 xref and imenu with emphasis on tramp support and simplicity.
 
-Just load and enable the mode: `global-tags-mode` or call it in a
+Just load and enable the mode: `global-xref-mode` or call it in a
 hook.
diff --git a/global-xref.el b/global-xref.el
index 5f3e3b02b8..a549f3b223 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -8,8 +8,6 @@
 ;; Version: 1.0 alpha
 ;; Package-Requires: ((emacs "28"))
 
-;; Copyright (C) 2022  Jimmy Aguilar Mena
-
 ;; 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
@@ -53,8 +51,8 @@
   :risky t)
 
 (defvar global-xref--roots-list nil
-  "Full list of project Global root.
-The address is absolute on remote hsts.")
+  "Full list of Global roots.
+The address is absolute for remote hosts.")
 (put 'global-xref--roots-list 'risky-local-variable t)
 
 (defvar-local global-xref--global (executable-find global-xref-global))
@@ -64,7 +62,7 @@ The address is absolute on remote hsts.")
 the address is relative on remote hosts.")
 
 (defconst global-xref--output-format-regex
-  "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t\]+\\)[ \t]+\\(.*\\)"
+  
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
   "Regex to filter the output with `global-xref--output-format-options'.")
 
 (defconst global-xref--output-format-options
@@ -74,15 +72,15 @@ the address is relative on remote hosts.")
 ;; Connection functions
 (defun global-xref--set-connection-locals ()
   "Set GLOBAL connection local variables when possible and needed."
-  (when-let* ((host (file-remote-p default-directory 'host))
+  (when-let* ((remote (file-remote-p default-directory))
+ (criteria (connection-local-criteria-for-default-directory))
  ((not (and (local-variable-p 'global-xref--global)
 (local-variable-p 'global-xref--gtags
- (symvars (intern (concat "global-xref--" host "-vars")))
+ (symvars (intern (concat "global-xref--" remote "-vars")))
  (enable-connection-local-variables t))
 (unless (alist-get symvars connection-local-profile-alist)
   (with-connection-local-variables
-   (let ((criteria `(:machine ,host))
-(xref-global (if (local-variable-p 'global-xref-global)
+   (let ((xref-global (if (local-variable-p 'global-xref-global)
  global-xref-global
(file-name-nondirectory global-xref-global)))
 (xref-gtags (if (local-variable-p 'gtags-xref-global)
@@ -93,8 +91,7 @@ the address is relative on remote hosts.")
  `((global-xref--global . ,(executable-find xref-global t))
(global-xref--gtags . ,(executable-find xref-gtags t
 (connection-local-set-profiles criteria symvars
-(hack-connection-local-variables-apply
- (connection-local-criteria-for-default-directory
+(hack-connection-local-variables-apply criteria)))
 
 ;; Async functions
 (defun global-xref--exec-async-sentinel (process event)
@@ -114,8 +111,7 @@ This is the sentinel set in `global-xref--exec-async'."
   "Run COMMAND with ARGS asynchronously and set SENTINEL to process.
 Starts an asynchronous process and sets
 `global-xref--exec-async-sentinel' as the process sentinel if
-SENTINEL is 'nil' or not specified.  Returns the process
-handler."
+SENTINEL is nil or not specified.  Returns the process object."
   (when-let* ((cmd (symbol-value command))
  (process (apply #'start-file-process
  (format "%s-async" cmd)
@@ -143,9 +139,8 @@ handler."
 (defun global-xref--exec-sync (command args &optional sentinel)
   "Run COMMAND with ARGS synchronously, on success call SENTINEL.
 Starts a sync process; on success call SENTINEL or
-`global-xref--sync-sentinel' if SENTINEL is not specified or
-'nil'.  Returns the output of SENTINEL or nil if any error
-occurred."
+`global-xref--sync-sentinel' if SENTINEL is not specified or nil.
+Returns the output of SENTINEL or nil if any error occurred."
   (when-let ((cmd (symbol-value command))
 (sentinel (or sentinel #'global-xref--sync-sentinel)))
 (with-temp-buffer ;; When sync



[elpa] externals/gtags-mode a14940cd98 35/61: Reorder some code and simplify cache code

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit a14940cd9891e5dbd0b830800223654b8aeba876
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Reorder some code and simplify cache code
---
 gtags-mode.el | 77 +--
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 6db74cec32..ad55af0ad8 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -55,16 +55,6 @@
 The address is absolute for remote hosts.")
 (put 'gtags-mode--alist 'risky-local-variable t)
 
-(defun gtags-mode--get-plist (file action)
-  "Apply ACTION on a plist with known prefix FILE from `gtags-mode--alist'."
-  (let ((truename (file-truename file)))
-(catch 'found
-  (mapc (lambda (plist)
- (when (string-prefix-p (plist-get plist :root) truename)
-   (throw 'found (funcall action plist
-   gtags-mode--alist)
-  nil)))
-
 (defvar-local gtags-mode--global (executable-find 
gtags-mode-global-executable))
 (defvar-local gtags-mode--gtags (executable-find gtags-mode-gtags-executable))
 (defvar-local gtags-mode--root nil
@@ -136,25 +126,34 @@ SENTINEL is nil or not specified.  Returns the process 
object."
   (process-put pr :buffer (current-buffer))
   pr)))
 
-(defun gtags-mode--exec-sync (cmd args)
+(defun gtags-mode--exec-sync (args)
   "Run CMD with ARGS synchronously, on success call SENTINEL.
 Starts a sync process; on success call SENTINEL or
 `gtags-mode--sync-sentinel' if SENTINEL is not specified or nil.
 Returns the output of SENTINEL or nil if any error occurred."
   (when cmd
 (with-temp-buffer ;; When sync
-  (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
+  (let ((status (apply #'process-file gtags-mode--global nil 
(current-buffer) nil args)))
(if (eq status 0)
(string-lines (buffer-string) t)
  (message "Global error output:\n%s" (buffer-string))
  (message "Sync %s %s: exited abnormally with code %s" cmd args status)
  nil)
 
-;; Api functions
+;; Utilities functions (a bit less low level) 
+(defun gtags-mode--get-plist (file action)
+  "Apply ACTION on a plist with known prefix FILE from `gtags-mode--alist'."
+  (let ((truename (file-truename file)))
+(catch 'found
+  (mapc (lambda (plist)
+ (when (string-prefix-p (plist-get plist :root) truename)
+   (throw 'found (funcall action plist
+   gtags-mode--alist)
+  nil)))
+
 (defun gtags-mode--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (when-let ((root (car (gtags-mode--exec-sync gtags-mode--global
-  '("--print-dbpath")
+  (when-let ((root (car (gtags-mode--exec-sync '("--print-dbpath")
 (setq root (concat (file-remote-p default-directory)
   (file-truename root)))
 (add-to-list 'gtags-mode--alist `(:root ,root :cache nil)
@@ -165,19 +164,28 @@ Returns the output of SENTINEL or nil if any error 
occurred."
 (defun gtags-mode--list-completions (prefix)
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
-completions usually from the cache."
-  (cond
-   ((and (stringp prefix) (not (string-blank-p prefix)))
-(gtags-mode--exec-sync gtags-mode--global
-  (append '("--ignore-case" "--completion")
-  `(,(shell-quote-argument prefix)
-   ((plist-get (gtags-mode--get-plist gtags-mode--root #'identity) :cache))
-   (t (gtags-mode--get-plist
-   gtags-mode--root
-   (lambda (plist)
-(plist-put plist
-   :cache (gtags-mode--exec-sync gtags-mode--global 
'("--completion")))
-plist)
+completions usually from the cache when possible."
+  (if (and (stringp prefix) (not (string-blank-p prefix))) ;; not use cache
+  (gtags-mode--exec-sync (append '("--ignore-case" "--completion")
+`(,(shell-quote-argument prefix
+(gtags-mode--get-plist
+ gtags-mode--root
+ (lambda (plist);; set and return the cache
+   (let* ((cache (plist-get plist :cache))
+ (completions (or cache
+  (gtags-mode--exec-sync '("--completion")
+(unless cache
+  (plist-put plist :cache completions))
+completions)
+
+(defun gtags-mode--buffers-in-root (root)
+  "Return a list of buffers which variable `buffer-file-name' is inside ROOT."
+  (mapcan (lambda (buf)
+   (when-let* ((bname (buffer-local-value 'buffer-file-name buf))
+   (tname (file-truename bname))
+   ((string-prefix-p root tname)))
+ (list buf)))
+ (buffer-list)))
 
 (defun gtags-mode--filter-find-symbol (args symbol creator)
   "Run `gtags-mode--exec-sync' with ARGS on SYMBOL and filter output with 
CREAT

[elpa] externals/gtags-mode 148041bbe9 55/61: Cleanup and reorder code.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 148041bbe92952d808dcb5dd50b4a7ba2b1a8890
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Cleanup and reorder code.

Also fix some corner cases and add advise to imenu because the variable
is buffer local.
---
 gtags-mode.el | 138 ++
 1 file changed, 62 insertions(+), 76 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 4cfc89a9ec..e06bd6a5b3 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -125,7 +125,6 @@ This is the sentinel set in `gtags-mode--exec-async'."
 Start an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel.
 Returns the process object."
-  (gtags-mode--set-connection-locals)
   (if-let* ((cmd (buffer-local-value cmd (current-buffer)))
(command (gtags-mode--quote (append `(,cmd) args) target))
(pr (make-process :name (format "%s-async" cmd)
@@ -143,7 +142,6 @@ Returns the process object."
 (defun gtags-mode--exec-sync (args &optional target)
   "Run global with ARGS on TARGET synchronously.
 On success return a list of strings or nil if any error occurred."
-  (gtags-mode--set-connection-locals)
   (if-let ((cmd gtags-mode--global) ;; Required for with-temp-buffer
   (cargs (gtags-mode--quote args target)))
   (with-temp-buffer
@@ -159,75 +157,70 @@ On success return a list of strings or nil if any error 
occurred."
 nil))
 
 ;; Utilities functions (a bit less low level) 
-(defun gtags-mode--get-plist (file)
-  "Return a plist for a FILE when it is known in `gtags-mode--alist'."
-  (let ((truename (file-truename file)))
+(defun gtags-mode--get-plist (directory)
+  "Return the plist for DIRECTORY from `gtags-mode--alist'."
+  (let ((truename (file-truename directory)))
 (catch 'found
-  (mapc (lambda (plist)
- (when (string-prefix-p (plist-get plist :gtagsroot) truename)
-   (throw 'found plist)))
-   gtags-mode--alist)
+  (dolist (plist gtags-mode--alist)
+   (when (string-prefix-p (plist-get plist :gtagsroot) truename)
+ (throw 'found plist)))
   nil)))
 
-(defun gtags-mode--find-or-create-plist ()
-  "Return the GLOBAL project root for `default-directory'.
-Return nil if none."
-  (when-let* ((root (car (gtags-mode--exec-sync '("--print-dbpath")
-(setq root (concat (file-remote-p default-directory) (file-truename root)))
+(defun gtags-mode--create-plist (directory)
+  "Return dbpath for DIRECTORY or nil if none."
+  (when-let* ((default-directory (file-truename directory))
+ (root (car (gtags-mode--exec-sync '("--print-dbpath")
+(setq root (file-truename (concat (file-remote-p default-directory) root)))
 (or (gtags-mode--get-plist root)   ;; already exist
(car (push `(:gtagsroot ,root :cache nil) gtags-mode--alist)
 
+(defun gtags-mode--local-plist ()
+  "Set and return the buffer local value of `gtags-mode--plist'."
+  (if (local-variable-p 'gtags-mode--plist)
+  gtags-mode--plist
+(gtags-mode--set-connection-locals)
+(setq-local gtags-mode--plist (or (gtags-mode--get-plist default-directory)
+ (gtags-mode--create-plist 
default-directory)
+
 (defun gtags-mode--list-completions (prefix)
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
 completions usually from the cache when possible."
   (cond ;; TODO: use with-memoization in the future it will be on emacs 29.1
+   ((not (gtags-mode--local-plist))
+(error "Calling `gtags-mode--list-completions' with no gtags-mode--plist"))
((and (stringp prefix) (not (string-blank-p prefix))
 (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix)))
((plist-get gtags-mode--plist :cache))
-   (gtags-mode--plist
-(plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
-(plist-get gtags-mode--plist :cache
+   (t (plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
+  (plist-get gtags-mode--plist :cache
 
 (defun gtags-mode--filter-find-symbol (args symbol creator)
   "Run `gtags-mode--exec-sync' with ARGS on SYMBOL and filter output with 
CREATOR.
 Returns the results as a list of CREATORS outputs similar to
 `mapcar'.  Creator should be a function with 4 input arguments:
 name, code, file, line."
-  (delete nil
- (mapcar
-  (lambda (line)
-(when (string-match gtags-mode--output-format-regex line)
-  (funcall creator
-   (match-string-no-properties 1 line)   ;; name
-   (match-string-no-properties 4 line)   ;; code
-   (match-string-no-properties 3 line)   ;; file
-   (string-to-number (match-string-no-properties 2 
line) ;; line
-  (gtags-mode--exec-sync
-   (append args gtags-mode--output-f

[elpa] externals/gtags-mode 5525174de9 34/61: Many changes:

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 5525174de97fc4c0d16fca6c9e3997924a52ee9c
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Many changes:

(gtags-mode--roots-list) : Renamed to gtags-mode--alist. It is now a list
of plists.
(gtags-mode--has-open-root) : Renamed to gtags-mode--get-plist. It now
returns the plist associated with root after appliying the action.
(gtags-mode--exec-async-sentinel) : Now executes an action to clear the
completions cache in the associated plist.
(gtags-mode--exec-async) : Use process-put to remember the caller
buffer.
(gtags-mode--list-completions) : New function to return the completion
list associated with a string, or return-generate the cache
conveniently.
(gtags-mode--find-file-hook) : Update to new functions
(xref-backend-identifier-completion-table) : Use the new function
gtags-mode--list-completions.
(project-files) : Delete duplicates when multiple outputs.
(gtags-mode-completion-function) : New function to provide a capf
backend.
---
 gtags-mode.el | 118 ++
 1 file changed, 78 insertions(+), 40 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 15b4c1f23f..6db74cec32 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -50,16 +50,26 @@
   :type 'string
   :risky t)
 
-(defvar gtags-mode--roots-list nil
+(defvar gtags-mode--alist nil
   "Full list of Global roots.
 The address is absolute for remote hosts.")
-(put 'gtags-mode--roots-list 'risky-local-variable t)
+(put 'gtags-mode--alist 'risky-local-variable t)
+
+(defun gtags-mode--get-plist (file action)
+  "Apply ACTION on a plist with known prefix FILE from `gtags-mode--alist'."
+  (let ((truename (file-truename file)))
+(catch 'found
+  (mapc (lambda (plist)
+ (when (string-prefix-p (plist-get plist :root) truename)
+   (throw 'found (funcall action plist
+   gtags-mode--alist)
+  nil)))
 
 (defvar-local gtags-mode--global (executable-find 
gtags-mode-global-executable))
 (defvar-local gtags-mode--gtags (executable-find gtags-mode-gtags-executable))
 (defvar-local gtags-mode--root nil
   "Project Global root for this buffer.
-the address is relative on remote hosts.")
+The address is relative on remote hosts and includes the remote prefix.")
 
 (defconst gtags-mode--output-format-regex
   
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
@@ -97,15 +107,20 @@ the address is relative on remote hosts.")
 (defun gtags-mode--exec-async-sentinel (process event)
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `gtags-mode--exec-async'."
-  (let ((temp-buffer (process-buffer process)))
-(if (and (eq (process-status process) 'exit)
+  (let ((temp-buffer (process-buffer process))
+   (parent-buffer (process-get process :buffer)))
+(if (and (eq (process-status process) 'exit)   ;; if success
 (eq (process-exit-status process) 0))
-   (and (buffer-name temp-buffer)
+   (and (buffer-name temp-buffer) ;; kill temp buffer
 (kill-buffer temp-buffer))
-  (with-current-buffer temp-buffer
+  (with-current-buffer temp-buffer ;; else print error
(while (accept-process-output process))
-   (message "Global error output:\n%s" (buffer-string)
-  (message "Async %s: %s" (process-command process) event))
+   (message "Global error output:\n%s" (buffer-string
+(when (buffer-live-p parent-buffer);; Always clear the cache
+  (with-current-buffer parent-buffer
+   (gtags-mode--get-plist gtags-mode--root
+  (lambda (p) (plist-put p :cache nil))
+  (message "Async %s: %s" (process-command process) event)) ;; Notify
 
 (defun gtags-mode--exec-async (cmd args)
   "Run CMD with ARGS asynchronously and set SENTINEL to process.
@@ -113,11 +128,13 @@ Starts an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel if
 SENTINEL is nil or not specified.  Returns the process object."
   (when cmd
-(make-process :name (format "%s-async" cmd)
- :buffer (generate-new-buffer " *temp*" t)
- :command (append (list cmd) args)
- :sentinel #'gtags-mode--exec-async-sentinel
- :file-handler t)))
+(let ((pr (make-process :name (format "%s-async" cmd)
+   :buffer (generate-new-buffer " *temp*" t)
+   :command (append (list cmd) args)
+   :sentinel #'gtags-mode--exec-async-sentinel
+   :file-handler t)))
+  (process-put pr :buffer (current-buffer))
+  pr)))
 
 (defun gtags-mode--exec-sync (cmd args)
   "Run CMD with ARGS synchronously, on success call SENTINEL.
@@ -137,12 +154,31 @@ Returns the output of SENTINEL or nil if any error 
oc

[elpa] externals/gtags-mode 3012f128ea 59/61: Change "Gtags" to " Gtags" for minor-mode name

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 3012f128ea28f2d5c251d639fdf6431651ce493a
Author: Pankaj Jangid 
Commit: GitHub 

Change "Gtags" to " Gtags" for minor-mode name

There is a standard practice of adding a single space before minor-mode 
names. Added single space so that it looks good on mode-line.
---
 gtags-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 2a0b2f4193..8983262566 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -45,7 +45,7 @@
   :type 'string
   :local t)
 
-(defcustom gtags-mode-lighter "Gtags"
+(defcustom gtags-mode-lighter " Gtags"
   "Gtags executable."
   :type 'string
   :risky t)



[elpa] externals/gtags-mode f312adbbab 43/61: Use match-string-no-properties is better.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit f312adbbab59a407dea36510c6ce34f55f4f53a1
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use match-string-no-properties is better.
---
 gtags-mode.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 267d046096..5e8a1f887e 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -194,10 +194,10 @@ name, code, file, line."
   (lambda (line)
 (when (string-match gtags-mode--output-format-regex line)
   (funcall creator
-   (match-string 1 line)   ;; name
-   (match-string 4 line)   ;; code
-   (match-string 3 line)   ;; file
-   (string-to-number (match-string 2 line) ;; line
+   (match-string-no-properties 1 line)   ;; name
+   (match-string-no-properties 4 line)   ;; code
+   (match-string-no-properties 3 line)   ;; file
+   (string-to-number (match-string-no-properties 2 
line) ;; line
   (gtags-mode--exec-sync
(append args gtags-mode--output-format-options) symbol
 



[elpa] externals/gtags-mode c823dcffc9 49/61: Assert not call plist-put for nil

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit c823dcffc9a5fa96f425679a1721bfc3c03a68d5
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Assert not call plist-put for nil
---
 gtags-mode.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index e67d5980ea..4071b5fb75 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -108,7 +108,8 @@ This is the sentinel set in `gtags-mode--exec-async'."
(message "Global async error output:\n%s" (buffer-string
 (when (buffer-live-p parent-buffer);; Always clear the cache
   (with-current-buffer parent-buffer
-   (plist-put gtags-mode--plist :cache nil)))
+   (when gtags-mode--plist
+ (plist-put gtags-mode--plist :cache nil
 ;; TODO: use `remote-command' in the future, it will be on emacs 29.1
 (message "Async %s: %s" (process-get process :command) event))) ;; Notify
 



[elpa] externals/gtags-mode 9dcb18fbe7 58/61: Use cscope output; it is easier to parse.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 9dcb18fbe730e0492d794b3ac97c513882207304
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use cscope output; it is easier to parse.

Use --path-style=through because it asserts relative results and
reduces the size of the output to process/transfer.
---
 gtags-mode.el | 42 ++
 1 file changed, 22 insertions(+), 20 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index ed66559ab6..2a0b2f4193 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -61,11 +61,11 @@ The address is absolute for remote hosts.")
   "Project Global root for this buffer.")
 
 (defconst gtags-mode--output-format-regex
-  
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
+  "^\\([^ ]+\\) \\([^ ]+\\) \\([[:digit:]]+\\) \\(.*\\)"
   "Regex to filter the output with `gtags-mode--output-format-options'.")
 
 (defconst gtags-mode--output-format-options
-  '("--result=ctags-x" "--path-style=absolute" "--color=never")
+  '("--result=cscope" "--path-style=through" "--color=never")
   "Command line options to use with `gtags-mode--output-format-regex'.")
 
 ;; Connection functions
@@ -199,16 +199,19 @@ completions usually from the cache when possible."
 Returns the results as a list of CREATORS outputs similar to
 `mapcar'.  Creator should be a function with 4 input arguments:
 name, code, file, line."
-  (delete nil (mapcar
-  (lambda (line)
-(when (string-match gtags-mode--output-format-regex line)
-  (funcall creator
-   (match-string-no-properties 1 line)   ;; name
-   (match-string-no-properties 4 line)   ;; code
-   (match-string-no-properties 3 line)   ;; file
-   (string-to-number (match-string-no-properties 2 
line) ;; line
-  (gtags-mode--exec-sync
-   (append args gtags-mode--output-format-options) symbol
+  (if-let ((root (plist-get (gtags-mode--local-plist) :gtagsroot)))
+  (delete nil (mapcar
+  (lambda (line)
+(when (string-match gtags-mode--output-format-regex line)
+  (funcall creator
+   (match-string-no-properties 2 line)   ;; name
+   (match-string-no-properties 4 line)   ;; code
+   (concat root (substring-no-properties
+ line (1+ (match-beginning 1)) 
(match-end 1))) ;; file
+   (string-to-number (match-string-no-properties 3 
line) ;; line
+  (gtags-mode--exec-sync
+   (append args gtags-mode--output-format-options) symbol)))
+(error "Calling gtags-mode--filter-find-symbol without GTAGSROOT")))
 
 (defun gtags-mode--update-buffers-plist ()
   "Actions to perform after creating a database.
@@ -247,11 +250,10 @@ This iterates over the buffers and tries to reset
 (defun gtags-mode--xref-find-symbol (args symbol)
   "Run GNU Global to create xref input list with ARGS on SYMBOL.
 Return as a list of xref location objects."
-  (let ((remote (file-remote-p default-directory)))
-(gtags-mode--filter-find-symbol
- args symbol
- (lambda (_name code file line)
-   (xref-make code (xref-make-file-location (concat remote file) line 
0))
+  (gtags-mode--filter-find-symbol
+   args symbol
+   (lambda (_name code file line)
+ (xref-make code (xref-make-file-location file line 0)
 
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (head 
:gtagsroot)))
   "List all symbols."
@@ -294,13 +296,13 @@ Return as a list of xref location objects."
 (cl-defmethod project-files ((project (head :gtagsroot)) &optional dirs)
   "List files inside all the PROJECT or in DIRS if specified."
   (let* ((root (project-root project))
-(remote (file-remote-p root))
 (results (mapcan
   (lambda (dir)
 (when (string-prefix-p root dir)
-  (mapcar (lambda (file) (concat remote file)) ;; Add 
remote prefix
+  (mapcar (lambda (file)
+(concat root (substring-no-properties file 1)))
   (gtags-mode--exec-sync
-   '("--path-style=absolute" "--path")
+   '("--path-style=through" "--path")
(string-remove-prefix root dir)
   (or dirs `(,root)
 (if (> (length dirs) 1) (delete-dups results) results)))



[elpa] externals/gtags-mode 9b67043bcf 44/61: Use a workaround to pint proper information

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 9b67043bcf194b24fd80400b6ff4a86033c1e4d2
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use a workaround to pint proper information

In async processes the remote commands are not printed properly a new
feature in tramp was added for this, but it is too new, so it is better
to use a workaround.
---
 Readme.md |  9 ++---
 gtags-mode.el | 20 
 2 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/Readme.md b/Readme.md
index 30e8344413..878638b36b 100644
--- a/Readme.md
+++ b/Readme.md
@@ -2,7 +2,10 @@ Readme
 ==
 
 This is a simple project to enable GNU global integration with Emacs
-xref and imenu with emphasis on tramp support and simplicity.
+xref, project, completion-at-point (capf) and imenu with emphasis on
+tramp support and simplicity.
+
+Just load and enable the mode: `gtags-mode` or call it in a hook as
+usual.
+
 
-Just load and enable the mode: `global-xref-mode` or call it in a
-hook.
diff --git a/gtags-mode.el b/gtags-mode.el
index 5e8a1f887e..7c73e4af38 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -98,7 +98,8 @@ The address is relative on remote hosts and includes the 
remote prefix.")
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `gtags-mode--exec-async'."
   (let ((temp-buffer (process-buffer process))
-   (parent-buffer (process-get process :buffer)))
+   (parent-buffer (process-get process :buffer))
+   (command (process-get process :command)))
 (if (and (eq (process-status process) 'exit)   ;; if success
 (eq (process-exit-status process) 0))
(and (buffer-name temp-buffer) ;; kill temp buffer
@@ -108,8 +109,9 @@ This is the sentinel set in `gtags-mode--exec-async'."
(message "Global error output:\n%s" (buffer-string
 (when (buffer-live-p parent-buffer);; Always clear the cache
   (with-current-buffer parent-buffer
-   (plist-put gtags-mode--plist :cache nil
-  (message "Async %s: %s" (process-command process) event)) ;; Notify
+   (plist-put gtags-mode--plist :cache nil)))
+;; TODO: use `remote-command' in the future, it will be on emacs 29.1
+(message "Async %s: %s" command event))) ;; Notify
 
 (defsubst gtags-mode--quote (args symbol)
   "Pre-process ARGS and quote SYMBOL."
@@ -122,12 +124,14 @@ Start an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel.
 Returns the process object."
   (when cmd
-(let ((pr (make-process :name (format "%s-async" cmd)
-   :buffer (generate-new-buffer " *temp*" t)
-   :command (append `(,cmd) (gtags-mode--quote args 
target))
-   :sentinel #'gtags-mode--exec-async-sentinel
-   :file-handler t)))
+(let* ((command (append `(,cmd) (gtags-mode--quote args target)))
+  (pr (make-process :name (format "%s-async" cmd)
+:buffer (generate-new-buffer " *temp*" t)
+:command command
+:sentinel #'gtags-mode--exec-async-sentinel
+:file-handler t)))
   (process-put pr :buffer (current-buffer))
+  (process-put pr :command command) ;; In future not needed with 
`remote-commands'.
   pr)))
 
 (defun gtags-mode--exec-sync (args &optional target)



[elpa] externals/gtags-mode 1f2f3d272b 57/61: Fix performance issue.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 1f2f3d272b6e73e3541acf6c4c5ee2a8f2cab52a
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix performance issue.

file-true-name is too expensive. It was consuming 98% of the time in a
find-reference with tramp.
---
 gtags-mode.el | 36 
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 8d137c1454..ed66559ab6 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -65,7 +65,7 @@ The address is absolute for remote hosts.")
   "Regex to filter the output with `gtags-mode--output-format-options'.")
 
 (defconst gtags-mode--output-format-options
-  '("--result=ctags-x" "--path-style=absolute --color=never")
+  '("--result=ctags-x" "--path-style=absolute" "--color=never")
   "Command line options to use with `gtags-mode--output-format-regex'.")
 
 ;; Connection functions
@@ -157,20 +157,19 @@ On success return a list of strings or nil if any error 
occurred."
 nil))
 
 ;; Utilities functions (a bit less low level) 
-(defun gtags-mode--get-plist (directory)
+(defun gtags-mode--get-plist (dir)
   "Return the plist for DIRECTORY from `gtags-mode--alist'."
-  (let ((truename (file-truename directory)))
-(catch 'found
-  (dolist (plist gtags-mode--alist)
-   (when (string-prefix-p (plist-get plist :gtagsroot) truename)
- (throw 'found plist)))
-  nil)))
-
-(defun gtags-mode--create-plist (directory)
+  (catch 'found
+(dolist (plist gtags-mode--alist)
+  (when (string-prefix-p (plist-get plist :gtagsroot) dir)
+   (throw 'found plist)))
+nil))
+
+(defun gtags-mode--create-plist (dir)
   "Return dbpath for DIRECTORY or nil if none."
-  (when-let* ((default-directory (file-truename directory))
+  (when-let* ((default-directory dir)
  (root (car (gtags-mode--exec-sync '("--print-dbpath")
-(setq root (file-truename (concat (file-remote-p default-directory) root)))
+(setq root (concat (file-remote-p default-directory) root))
 (or (gtags-mode--get-plist root)   ;; already exist
(car (push `(:gtagsroot ,root :cache nil) gtags-mode--alist)
 
@@ -252,8 +251,7 @@ Return as a list of xref location objects."
 (gtags-mode--filter-find-symbol
  args symbol
  (lambda (_name code file line)
-   (xref-make code (xref-make-file-location
-   (file-truename (concat remote file)) line 0))
+   (xref-make code (xref-make-file-location (concat remote file) line 
0))
 
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (head 
:gtagsroot)))
   "List all symbols."
@@ -287,7 +285,7 @@ Return as a list of xref location objects."
 ;; project integration ===
 (defun gtags-mode-project-backend (dir)
   "Return the project for DIR as an array."
-  (gtags-mode--get-plist dir))
+  (gtags-mode--get-plist (file-truename dir)))
 
 (cl-defmethod project-root ((project (head :gtagsroot)))
   "Root for PROJECT."
@@ -299,13 +297,11 @@ Return as a list of xref location objects."
 (remote (file-remote-p root))
 (results (mapcan
   (lambda (dir)
-(when-let* ((tdir (file-truename dir))
-((string-prefix-p root tdir)))
-  (mapcar (lambda (file)
-(concat remote file)) ;; Add remote prefix
+(when (string-prefix-p root dir)
+  (mapcar (lambda (file) (concat remote file)) ;; Add 
remote prefix
   (gtags-mode--exec-sync
'("--path-style=absolute" "--path")
-   (string-remove-prefix root tdir)
+   (string-remove-prefix root dir)
   (or dirs `(,root)
 (if (> (length dirs) 1) (delete-dups results) results)))
 



[elpa] externals/gtags-mode updated (317ed00754 -> 1a16fcb85b)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/gtags-mode.

  from  317ed00754 Assert we retun nil on error
   new  225290efef Autoload gtags-mode-create
   new  1f64203a03 Use seq-find to simplify search of plist
   new  1a16fcb85b Add some documentation...


Summary of changes:
 .gitignore|  1 +
 Readme.md | 47 +++
 gtags-mode.el | 46 --
 3 files changed, 76 insertions(+), 18 deletions(-)
 create mode 100644 .gitignore



[elpa] externals/gtags-mode 1a16fcb85b 3/3: Add some documentation...

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 1a16fcb85bf46adb739108a2bb49d9ef305b3e38
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add some documentation...
---
 .gitignore|  1 +
 Readme.md | 47 +++
 gtags-mode.el | 30 --
 3 files changed, 68 insertions(+), 10 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00..016d3b1692
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.elc
\ No newline at end of file
diff --git a/Readme.md b/Readme.md
index 878638b36b..2c5533e466 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,11 +1,50 @@
 Readme
 ==
 
-This is a simple project to enable GNU global integration with Emacs
-xref, project, completion-at-point (capf) and imenu with emphasis on
-tramp support and simplicity.
+This package provides GNU Global integration with xref, project,
+completion-at-point (capf) and imenu in emacs.
+
+There are some other packages with their own approach and set of more
+complete/complex features, maps and functionalities; like ggtags,
+gtags.el, gxref, agtags and some others. They are listed with a brief
+description in: [related 
sites](https://www.gnu.org/software/global/links.html).
+
+This package let all the work to the EMACS tools available for such
+functionalities and avoids external dependencies.  Unlike other
+packages; this module does not create extra special maps, bindings or
+menus, but just adds support to the mentioned features to use
+gtags/global as a backend when possible.  We do special emphasis on
+minimalism, simplicity, efficiency and tramp support.
+
+This package may be extended in the future with new features and to
+support other tools, but only if they are required and included in
+an emacs distribution and don't need external dependencies.
+
+Usage
+-
 
 Just load and enable the mode: `gtags-mode` or call it in a hook as
-usual.
+usual. The mode is a global-minor-mode.
+
+There are only 3 extra commands that the user may need to know:
+
+- **gtags-mode** : To enable the global minor mode.
+- **gtags-mode-create** : To create a gtags database in case it doesn't exist 
for the current project.
+- **gtags-mode-update** : To manually update an existent database; specially 
useful if the project has been modified outside emacs.
+
+Configuration
+-
+
+This packages tries to do its best to not require user configuration.
+The package provides a minimal set of configuration options in case
+the global/gtags executable are not in the usual locations, so the
+user can set them. **gtags-mode-global-executable**
+**gtags-mode-gtags-executable** are buffer local configuration options
+to set the path or names in case the user needs it or the user setup
+is do special that the command *executable-find* fails searching.
 
+TRAMP users can use *connection-local-variables* to set these values
+per individual hosts or users if needed.
 
+The custom variable **gtags-mode-lighter** can be used to change the
+default mode-line message to use when the mode is enabled.
diff --git a/gtags-mode.el b/gtags-mode.el
index 9b48e2cea0..d822e70cea 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -1,11 +1,11 @@
 ;;; gtags-mode.el --- GNU Global integration with xref, project and imenu. -*- 
lexical-binding: t; -*-
 
-;; Copyright (C) 2022 Jimmy Aguilar Mena
+;; Copyright (C) 2022  Free Software Foundation, Inc.
 
 ;; Author: Jimmy Aguilar Mena
 ;; URL: https://github.com/Ergus/gtags-mode
 ;; Keywords: xref, project, imenu, gtags, global
-;; Version: 1.0 alpha
+;; Version: 1.0-alpha
 ;; Package-Requires: ((emacs "28"))
 
 ;; This program is free software: you can redistribute it and/or modify
@@ -23,12 +23,28 @@
 
 ;;; Commentary:
 
-;; GNU Global integration with xref, project and imenu.
+;; GNU Global integration with xref, project, completion-at-point
+;; (capf) and imenu.
+
+;; There are many other packages with their own approach and set of
+;; more complete/complex features, maps and functionalities; like
+;; ggtags, gtags.el, gxref, agtags and some others referenced in:
+;; https://www.gnu.org/software/global/links.html
+
+;; This package let all the work to the EMACS tools available for such
+;; functions and avoids external dependencies.  Unlike the other
+;; packages; this module does not create extra special maps, bindings
+;; or menus, but just adds support to the mentioned features to use
+;; gtags/global as a backend when possible.  We do special emphasis on
+;; minimalism, simplicity, efficiency and tramp support.
+
+;; This package may be extended in the future with new features and to
+;; support other tools, but only if they are required and included in
+;; an EMACS distribution and don't need external dependencies.
 
 ;;; Code:
 
 (require 'xref)
-(require 'cl-generic)
 (require 'files-x)
 
 (defgroup gtags-mode nil
@@ -324,13 +340,15 @@ Return as a list of xref location objects."
   "Generate completion list."
   (if (gtags-mode--lo

[elpa] externals/gtags-mode 1f64203a03 2/3: Use seq-find to simplify search of plist

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 1f64203a03414f48a96d45a238ec5695bc6bc928
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use seq-find to simplify search of plist
---
 gtags-mode.el | 14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 00e4f8bc55..9b48e2cea0 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -151,22 +151,20 @@ On success return a list of strings or nil if any error 
occurred."
  (point-min)
  (point-max))) t)
(message "Global sync error output:\n%s" (buffer-string))
-   (message "Sync global %s: exited abnormally with code %s" cargs 
status)
+   (message "Sync %s %s: exited abnormally with code %s" cmd cargs 
status)
nil)))
 (message "Can't start sync %s subprocess" cmd)
 nil))
 
 ;; Utilities functions (a bit less low level) 
 (defun gtags-mode--get-plist (dir)
-  "Return the plist for DIRECTORY from `gtags-mode--alist'."
-  (catch 'found
-(dolist (plist gtags-mode--alist)
-  (when (string-prefix-p (plist-get plist :gtagsroot) dir)
-   (throw 'found plist)))
-nil))
+  "Return the plist for DIR from `gtags-mode--alist'."
+  (seq-find (lambda (plist)
+ (string-prefix-p (plist-get plist :gtagsroot) dir))
+   gtags-mode--alist))
 
 (defun gtags-mode--create-plist (dir)
-  "Return dbpath for DIRECTORY or nil if none."
+  "Return dbpath for DIR or nil if none."
   (when-let* ((default-directory dir)
  (root (car (gtags-mode--exec-sync '("--print-dbpath")
 (setq root (concat (file-remote-p default-directory) root))



[elpa] externals/gtags-mode 225290efef 1/3: Autoload gtags-mode-create

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 225290efef2948db32bf1443cde14f8d33fe5a39
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Autoload gtags-mode-create
---
 gtags-mode.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gtags-mode.el b/gtags-mode.el
index 39518a07d4..00e4f8bc55 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -226,6 +226,8 @@ This iterates over the buffers and tries to reset
(gtags-mode--local-plist)
 
 ;; Interactive commands ==
+
+;;;###autoload
 (defun gtags-mode-create (root-dir)
   "Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
   (interactive "DCreate GLOBAL files in directory: ")



[elpa] externals/gtags-mode c88225e3f1 02/61: Add Readme.md

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit c88225e3f1cdae29a39bc2b79442048d335b54c0
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add Readme.md
---
 Readme.md | 8 
 1 file changed, 8 insertions(+)

diff --git a/Readme.md b/Readme.md
new file mode 100644
index 00..50cf6ccdc6
--- /dev/null
+++ b/Readme.md
@@ -0,0 +1,8 @@
+Readme
+==
+
+This is a simple project to enable GNU global integration with Emacs
+xref and imenu with emphasis on tramp support and simplicity.
+
+Just load and enable the mode: `global-tags-mode` or call it in a
+hook.



[elpa] externals/gtags-mode 1aaac5fead 10/61: Simplify code to so only the needed.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 1aaac5fead13dcfd19b56a8108502f6d5ce1b5c8
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Simplify code to so only the needed.

(global-xref--exec-sync) :
(global-xref--exec-async) : Separate sync from async calls in different
functions.
(global-xref--buffer-to-list) : Removed because sync call always return
a list.
(global-xref--find-root) : Use car.
(global-xref--filter-find-symbol) : Change the arguments order.
(global-xref--output-format-regex) :
(global-xref--output-format-options) : New cons.
---
 global-xref.el | 179 +
 1 file changed, 91 insertions(+), 88 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 54f491f4a2..e75a84bb01 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -48,126 +48,130 @@
   "Gtags executable."
   :type 'string)
 
-(defun global-xref--buffer-to-list ()
-  "Return lines in current buffer in a list."
-  (let ((lines))
-(goto-char (point-min))
-(while (not (eobp))
-  (push (buffer-substring-no-properties
-(line-beginning-position) (line-end-position))
-   lines)
-  (forward-line 1))
-(nreverse lines)))
-
-(defvar global-xref--roots-list nil)
+(defvar global-xref--roots-list nil
+  "Full list of project Global root.
+The address is absolute on remote hsts.")
 (put 'global-xref--roots-list 'risky-local-variable t)
 
 (defvar-local global-xref--global (executable-find global-xref-global))
 (defvar-local global-xref--gtags (executable-find global-xref-gtags))
 (defvar-local global-xref--project-root nil
-  "Project Global root for this buffer.")
-
-(defun global-xref--exec (command args async &optional postfunction)
-  "Run COMMAND-SYM with and ARGS, in ASYNC way.
-When ASYNC is 'nil' executes command synchronously; returns the
-output of the command as a string or calls POSTFUNCTION in the
-command's buffer and returns the result.  returns nil if an error
-occurred.
-When ASYNC is non-nil starts an async process and executes the
-ignores.  Returns the process handler."
+  "Project Global root for this buffer.
+the address is relative on remote hosts.")
+
+(defconst global-xref--output-format-regex
+  "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t\]+\\)[ \t]+\\(.*\\)"
+  "Regex to filter the output with `global-xref--output-format-options'.")
+
+(defconst global-xref--output-format-options
+  '("--result=ctags-x" "--path-style=absolute")
+  "Command line options to use with `global-xref--output-format-regex'.")
+
+(defun global-xref--exec-async (command args)
+  "Run COMMAND with ARGS asynchronously.
+Starts an async process and sets an informative process sentinel.
+Returns the process handler."
   (with-connection-local-variables
-   (when-let (cmd (symbol-value command))
- (if async ;; When async
-(let ((process (apply #'start-file-process
+   (when-let* ((cmd (symbol-value command))
+  (process (apply #'start-file-process
   (format "%s-async" cmd)
   (generate-new-buffer " *temp*" t) cmd args)))
-  (set-process-sentinel
-   process
-   (lambda (process event)
- (let ((temp-buffer (process-buffer process)))
-   (while (accept-process-output process))
-   (if (eq (process-status process) 'exit)
-   (and (buffer-name temp-buffer)
-(kill-buffer temp-buffer))
- (with-current-buffer temp-buffer
-   (message "global error output:\n%s" (buffer-string)
- (message "Async %s: %s" (process-command process) event)))
-  process)
-   (with-temp-buffer ;; When sync
-(let ((status (apply #'process-file cmd nil (current-buffer) nil 
args)))
-  (if (eq status 0)
-  (if (functionp postfunction)
-  (funcall postfunction)
-(string-trim (buffer-substring-no-properties (point-min) 
(point-max
-(message "global error output:\n%s" (buffer-string))
-(error "Sync %s %s: exited abnormally with code %s" cmd args 
status)
-nil)))
-
-(defsubst global-xref--to-list (args)
-  "Run GLOBAL with `process-file' and ARGS; return a list."
-  (global-xref--exec 'global-xref--global args nil 
#'global-xref--buffer-to-list))
+ (set-process-sentinel
+  process
+  (lambda (process event)
+   (let ((temp-buffer (process-buffer process)))
+ (while (accept-process-output process))
+ (if (eq (process-status process) 'exit)
+ (and (buffer-name temp-buffer)
+  (kill-buffer temp-buffer))
+   (with-current-buffer temp-buffer
+ (message "global error output:\n%s" (buffer-string)
+   (message "Async %s: %s" (process-command process) event)))
+ process)))
+
+(defun global-xref--exec-sync (command args)
+  "

[elpa] externals/gtags-mode 688f1e8886 16/61: Break long lines.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 688f1e8886e6f93f3298be46a7b4a7709d69c739
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Break long lines.
---
 global-xref.el | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 53b6690a49..e3cef04aff 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -118,8 +118,10 @@ handler."
   (when-let* ((cmd (symbol-value command))
  (process (apply #'start-file-process
  (format "%s-async" cmd)
- (generate-new-buffer " *temp*" t) cmd args))
- (sentinel (or sentinel #'global-xref--exec-async-sentinel)))
+ (generate-new-buffer " *temp*" t)
+ cmd args))
+ (sentinel (or sentinel
+   #'global-xref--exec-async-sentinel)))
 (set-process-sentinel process sentinel)
 process))
 
@@ -156,7 +158,8 @@ occurred."
 ;; Api functions
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (let ((root (car (global-xref--exec-sync 'global-xref--global 
'("--print-dbpath")
+  (let ((root (car (global-xref--exec-sync 'global-xref--global
+  '("--print-dbpath")
 (when root
   (add-to-list 'global-xref--roots-list
   (concat (file-remote-p default-directory)



[elpa] externals/gtags-mode 192258fa32 17/61: Use list instead of quotes.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 192258fa3234fb984c57e34e5e62df6d5af090f4
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Use list instead of quotes.
---
 global-xref.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index e3cef04aff..2ba6858128 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -183,7 +183,7 @@ name, code, file, line."
   (global-xref--exec-sync
'global-xref--global
(append args global-xref--output-format-options
-   `(,(shell-quote-argument symbol)))
+   (list (shell-quote-argument symbol)))
 
 ;; Interactive commands ==
 (defun global-xref-create (root-dir)
@@ -263,7 +263,7 @@ any additional command line arguments to pass to GNU 
Global."
 (global-xref--filter-find-symbol
  '("--file") (file-name-nondirectory buffer-file-name)
  (lambda (name _code _file line)
-   `(,name ,line #'global-xref--imenu-goto-function)
+   (list name line #'global-xref--imenu-goto-function)
 
 ;;;###autoload
 (define-minor-mode global-xref-mode



[elpa] externals/gtags-mode 10a710a3dd 54/61: Fix and simplify

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 10a710a3ddb4324b168c47f8b75355efff25de31
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix and simplify
---
 gtags-mode.el | 48 
 1 file changed, 20 insertions(+), 28 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index d4945152a8..4cfc89a9ec 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -58,8 +58,7 @@ The address is absolute for remote hosts.")
 (defvar-local gtags-mode--global (executable-find 
gtags-mode-global-executable))
 (defvar-local gtags-mode--gtags (executable-find gtags-mode-gtags-executable))
 (defvar-local gtags-mode--plist nil
-  "Project Global root for this buffer.
-The address is relative on remote hosts and includes the remote prefix.")
+  "Project Global root for this buffer.")
 
 (defconst gtags-mode--output-format-regex
   
"^\\([^[:blank:]]+\\)[[:blank:]]+\\([[:digit:]]+\\)[[:blank:]]+\\([^[:blank:]]+\\)[[:blank:]]+\\(.*\\)"
@@ -71,7 +70,7 @@ The address is relative on remote hosts and includes the 
remote prefix.")
 
 ;; Connection functions
 (defun gtags-mode--set-connection-locals ()
-  "Set GLOBAL connection local variables when possible and needed."
+  "Set connection local variables when possible and needed."
   (when-let* ((remote (file-remote-p default-directory))
  ((not (and (local-variable-p 'gtags-mode--global)
 (local-variable-p 'gtags-mode--gtags
@@ -97,7 +96,7 @@ The address is relative on remote hosts and includes the 
remote prefix.")
 (defun gtags-mode--exec-async-sentinel (process event)
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `gtags-mode--exec-async'."
-  (if (and (eq (process-status process) 'exit) ;; On success e
+  (if (and (eq (process-status process) 'exit) ;; On success
   (eql (process-exit-status process) 0))
   (let ((temp-buffer (process-buffer process))
(parent-buffer (process-get process :parent-buffer))
@@ -219,33 +218,30 @@ Return the buffer local value of `gtags-mode--plist'."
   "Actions to perform after creating a database.
 This runs only when the process exits successfully and is
 executed in the parent buffer."
-  (unless gtags-mode--plist
-(kill-local-variable 'gtags-mode--plist)
-(gtags-mode--set-local-plist)
-(when-let ((plist gtags-mode--plist)
-  (root (plist-get gtags-mode--plist :root)))
-  (mapc (lambda (buff)
+  (when-let ((currbuff (current-buffer))
+(root (plist-get (gtags-mode--set-local-plist) :root)))
+(mapc (lambda (buff)
+   (unless (eq currbuff buff)
  (with-current-buffer buff
(when (and (not gtags-mode--plist)
   (string-prefix-p root (file-truename 
default-directory)))
- (kill-local-variable 'gtags-mode--plist)
- (gtags-mode--set-local-plist
-   (buffer-list)
+ (kill-local-variable 'gtags-mode--plist) ;; kill the local to 
reset it
+ (gtags-mode--set-local-plist)
+ (buffer-list
 
 ;; Interactive commands ==
 (defun gtags-mode-create (root-dir)
   "Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
   (interactive "DCreate GLOBAL files in directory: ")
-  (let ((default-directory root-dir))
-(process-put (gtags-mode--exec-async 'gtags-mode--gtags nil)
-:extra-sentinel #'gtags-mode--update-buffers-plist)))
+  (when-let* ((default-directory root-dir)
+ (pr (gtags-mode--exec-async 'gtags-mode--gtags nil)))
+(process-put pr :extra-sentinel #'gtags-mode--update-buffers-plist)))
 
 (defun gtags-mode-update ()
   "Update GLOBAL project database."
   (interactive)
-  (if gtags-mode--plist
-  (gtags-mode--exec-async 'gtags-mode--global '("--update"))
-(error "Not under a GLOBAL project")))
+  (when gtags-mode--plist
+(gtags-mode--exec-async 'gtags-mode--global '("--update"
 
 ;; Hooks =
 (defun gtags-mode--after-save-hook ()
@@ -253,9 +249,7 @@ executed in the parent buffer."
   (when (and buffer-file-name gtags-mode--plist)
 (gtags-mode--exec-async
  'gtags-mode--global
- `("--single-update") ,(file-name-nondirectory buffer-file-name
-
-(defalias 'gtags-mode--find-file-hook #'gtags-mode--set-local-plist)
+ '("--single-update") (file-name-nondirectory buffer-file-name
 
 ;; xref integration ==
 (defun gtags-mode--xref-find-symbol (args symbol)
@@ -268,8 +262,6 @@ Return as a list of xref location objects."
  (concat (file-remote-p default-directory) file)
  line 0)
 
-(defalias 'gtags-xref-backend #'gtags-mode--set-local-plist)
-
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (head 
:gtagsroot)))
   "List all symbols."
   

[elpa] externals/gtags-mode a2c84b5a2b 28/61: Optimize avoiding with-current-buffer.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit a2c84b5a2b8aa41fb2ad1b91145987ba343c4175
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Optimize avoiding with-current-buffer.

This is a minimal change but if can be better why do it worst?
---
 global-xref.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index 2e26b8d289..771a735146 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -306,8 +306,8 @@ any additional command line arguments to pass to GNU 
Global."
 ;; Enable the mode in all the files inside `global-xref--project-root'
 (when (called-interactively-p 'all)
   (mapc (lambda (buff)
- (with-current-buffer buff
-   (unless global-xref-mode
+ (unless (buffer-local-value 'global-xref-mode buff)
+   (with-current-buffer buff
  (global-xref-mode 1
(global-xref--buffers-in-root global-xref--project-root
(t



[elpa] externals/gtags-mode 076ae4a55e 51/61: Fall back to default on imenu.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 076ae4a55eadd3c5f18ea7b9dc5005b026ca1cff
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fall back to default on imenu.

When gtags-mode-imenu-create-index-function doesn't apply, use the
default one.
---
 gtags-mode.el | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 09f47805e9..e0502da9fe 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -281,11 +281,14 @@ Return as a list of xref location objects."
 
 (defun gtags-mode-imenu-create-index-function ()
   "Make imenu use Global."
-  (when buffer-file-name
-(gtags-mode--filter-find-symbol
- '("--file") (file-name-nondirectory buffer-file-name)
- (lambda (name _code _file line)
-   (list name line #'gtags-mode--imenu-goto-function)
+  (if (and buffer-file-name gtags-mode--plist)
+  (gtags-mode--filter-find-symbol
+   '("--file") (file-name-nondirectory buffer-file-name)
+   (lambda (name _code _file line)
+(list name line #'gtags-mode--imenu-goto-function)))
+;; Else try to use the default function.
+(when (functionp gtags-mode--imenu-default-function)
+  (funcall gtags-mode--imenu-default-function
 
 ;; project integration ===
 (defun gtags-mode-project-backend (dir)



[elpa] externals/gtags-mode 3f43b6056d 47/61: ;; Fix typo

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 3f43b6056d1efa0da57431c7fab98fe5170eb136
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

;; Fix typo
---
 gtags-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 7dcf906feb..4b3aa3f972 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -174,8 +174,8 @@ completions usually from the cache when possible."
((and (stringp prefix) (not (string-blank-p prefix))
 (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix)))
((plist-get gtags-mode--plist :cache))
-   ((plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
-(plist-get gtags-mode--plist :cache
+   (t (plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
+  (plist-get gtags-mode--plist :cache
 
 (defun gtags-mode--buffers-in-root (plist)
   "Return a list of buffers which variable `buffer-file-name' is inside PLIST."



[elpa] externals/gtags-mode c60bb82307 42/61: Don't use with-memoization it is too new.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit c60bb82307c4ebe55d042c2ad4a3d179ddde739d
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Don't use with-memoization it is too new.

Add a TODO for it.
---
 gtags-mode.el | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 9f77be60bc..267d046096 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -167,10 +167,12 @@ On success return a list of strings or nil if any error 
occurred."
   "Get the list of completions for PREFIX.
 When PREFIX is nil or empty; return the entire list of
 completions usually from the cache when possible."
-  (or (and (stringp prefix) (not (string-blank-p prefix))
-  (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix))
-  (with-memoization (plist-get gtags-mode--plist :cache)
-   (gtags-mode--exec-sync '("--completion")
+  (cond ;; TODO: use with-memoization in the future it will be on emacs 29.1
+   ((and (stringp prefix) (not (string-blank-p prefix))
+(gtags-mode--exec-sync '("--ignore-case" "--completion") prefix)))
+   ((plist-get gtags-mode--plist :cache))
+   ((plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
+(plist-get gtags-mode--plist :cache
 
 (defun gtags-mode--buffers-in-root (plist)
   "Return a list of buffers which variable `buffer-file-name' is inside PLIST."



[elpa] externals/gtags-mode e8d19c4333 52/61: Add code to run extra sentinel

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit e8d19c43338eac69cc1f2b7e878cceb12d4c4dae
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Add code to run extra sentinel

Run the extra sentinel when set in the parent buffer for async
processes.
Rename :buffer to :parent-buffer.
---
 gtags-mode.el | 35 +++
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index e0502da9fe..3416e15088 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -97,21 +97,24 @@ The address is relative on remote hosts and includes the 
remote prefix.")
 (defun gtags-mode--exec-async-sentinel (process event)
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `gtags-mode--exec-async'."
-  (let ((temp-buffer (process-buffer process))
-   (parent-buffer (process-get process :buffer)))
-(if (and (eq (process-status process) 'exit)   ;; if success
-(eq (process-exit-status process) 0))
-   (and (buffer-name temp-buffer) ;; kill temp buffer
-(kill-buffer temp-buffer))
-  (with-current-buffer temp-buffer ;; else print error
-   (while (accept-process-output process))
-   (message "Global async error output:\n%s" (buffer-string
-(when (buffer-live-p parent-buffer);; Always clear the cache
-  (with-current-buffer parent-buffer
-   (when gtags-mode--plist
- (plist-put gtags-mode--plist :cache nil
-;; TODO: use `remote-command' in the future, it will be on emacs 29.1
-(message "Async %s: %s" (process-get process :command) event))) ;; Notify
+  (if (and (eq (process-status process) 'exit) ;; On success e
+  (eql (process-exit-status process) 0))
+  (let ((temp-buffer (process-buffer process))
+   (parent-buffer (process-get process :parent-buffer))
+   (extra-sentinel (process-get process :extra-sentinel)))
+   (when (buffer-name temp-buffer);; kill temp buffer
+ (while (accept-process-output process))
+ (kill-buffer temp-buffer))
+   (when (buffer-live-p parent-buffer);; work on parent buffer
+ (with-current-buffer parent-buffer
+   (when (functionp extra-sentinel)   ;; run extra sentinel
+ (funcall extra-sentinel))
+   (when gtags-mode--plist;; clear cache
+ (plist-put gtags-mode--plist :cache nil)
+(with-current-buffer (process-buffer process)  ;; In failure print 
error
+  (while (accept-process-output process))
+  (message "Global async error output:\n%s" (buffer-string
+  (message "Async %s: %s" (process-get process :command) event)) ;; Notify 
always
 
 (defsubst gtags-mode--quote (args symbol)
   "Pre-process ARGS and quote SYMBOL."
@@ -133,7 +136,7 @@ Returns the process object."
  :file-handler t)))
   (progn
;; In future not needed with `remote-commands'.
-   (set-process-plist pr `(:buffer ,(current-buffer) :command ,command))
+   (set-process-plist pr `(:parent-buffer ,(current-buffer) :command 
,command))
pr)
 (message "Can't start async %s subprocess" cmd)
 nil))



[elpa] externals/gtags-mode ce6a4a6201 60/61: Merge pull request #1 from jangid/master

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit ce6a4a6201c9fffad5d708d2fd4673090cf0add7
Merge: 9dcb18fbe7 3012f128ea
Author: Jimmy Aguilar Mena 
Commit: GitHub 

Merge pull request #1 from jangid/master

Change "Gtags" to " Gtags" for minor-mode name
---
 gtags-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 2a0b2f4193..8983262566 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -45,7 +45,7 @@
   :type 'string
   :local t)
 
-(defcustom gtags-mode-lighter "Gtags"
+(defcustom gtags-mode-lighter " Gtags"
   "Gtags executable."
   :type 'string
   :risky t)



[elpa] externals/gtags-mode d4890f5bb3 45/61: Small simplification.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit d4890f5bb3ff3487bbd695724bfb55b0bf71d3c5
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Small simplification.
---
 gtags-mode.el | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 7c73e4af38..34a75be468 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -98,8 +98,7 @@ The address is relative on remote hosts and includes the 
remote prefix.")
   "Sentinel to run when PROCESS emits EVENT.
 This is the sentinel set in `gtags-mode--exec-async'."
   (let ((temp-buffer (process-buffer process))
-   (parent-buffer (process-get process :buffer))
-   (command (process-get process :command)))
+   (parent-buffer (process-get process :buffer)))
 (if (and (eq (process-status process) 'exit)   ;; if success
 (eq (process-exit-status process) 0))
(and (buffer-name temp-buffer) ;; kill temp buffer
@@ -111,7 +110,7 @@ This is the sentinel set in `gtags-mode--exec-async'."
   (with-current-buffer parent-buffer
(plist-put gtags-mode--plist :cache nil)))
 ;; TODO: use `remote-command' in the future, it will be on emacs 29.1
-(message "Async %s: %s" command event))) ;; Notify
+(message "Async %s: %s" (process-get process :command) event))) ;; Notify
 
 (defsubst gtags-mode--quote (args symbol)
   "Pre-process ARGS and quote SYMBOL."
@@ -130,8 +129,8 @@ Returns the process object."
 :command command
 :sentinel #'gtags-mode--exec-async-sentinel
 :file-handler t)))
-  (process-put pr :buffer (current-buffer))
-  (process-put pr :command command) ;; In future not needed with 
`remote-commands'.
+  ;; In future not needed with `remote-commands'.
+  (set-process-plist pr `(:buffer ,(current-buffer) :command ,command))
   pr)))
 
 (defun gtags-mode--exec-sync (args &optional target)



[elpa] externals/gtags-mode 777c51d630 53/61: Convert the mode in a global mode.

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit 777c51d63036581942d61cc31ba9c64ccb7b66c2
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Convert the mode in a global mode.

Set the mode as global and set the hooks globaly.
This will solve the problems of lazy loading in temporal buffers.
Simplifies the mode implementation.
(gtags-mode--buffers-in-root) : Removed
(gtags-mode--set-local-plist) :
(gtags-mode--update-buffers-plist) : New function
Fall back to use the command symbol name.
Simplify the minor mode code.
---
 gtags-mode.el | 126 ++
 1 file changed, 65 insertions(+), 61 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 3416e15088..d4945152a8 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -161,7 +161,7 @@ On success return a list of strings or nil if any error 
occurred."
 
 ;; Utilities functions (a bit less low level) 
 (defun gtags-mode--get-plist (file)
-  "Apply ACTION on a plist with known prefix FILE from `gtags-mode--alist'."
+  "Return a plist for a FILE when it is known in `gtags-mode--alist'."
   (let ((truename (file-truename file)))
 (catch 'found
   (mapc (lambda (plist)
@@ -171,7 +171,8 @@ On success return a list of strings or nil if any error 
occurred."
   nil)))
 
 (defun gtags-mode--find-or-create-plist ()
-  "Return the GLOBAL project root.  Return nil if none."
+  "Return the GLOBAL project root for `default-directory'.
+Return nil if none."
   (when-let* ((root (car (gtags-mode--exec-sync '("--print-dbpath")
 (setq root (concat (file-remote-p default-directory) (file-truename root)))
 (or (gtags-mode--get-plist root)   ;; already exist
@@ -185,18 +186,9 @@ completions usually from the cache when possible."
((and (stringp prefix) (not (string-blank-p prefix))
 (gtags-mode--exec-sync '("--ignore-case" "--completion") prefix)))
((plist-get gtags-mode--plist :cache))
-   (t (plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
-  (plist-get gtags-mode--plist :cache
-
-(defun gtags-mode--buffers-in-root (plist)
-  "Return a list of buffers which variable `buffer-file-name' is inside PLIST."
-  (when-let ((root (plist-get plist :gtagsroot)))
-(mapcan (lambda (buf)
- (and-let* ((bname (buffer-local-value 'buffer-file-name buf))
-(tname (file-truename bname))
-((string-prefix-p root tname))
-(`(,buf)
-   (buffer-list
+   (gtags-mode--plist
+(plist-put gtags-mode--plist :cache (gtags-mode--exec-sync 
'("--completion")))
+(plist-get gtags-mode--plist :cache
 
 (defun gtags-mode--filter-find-symbol (args symbol creator)
   "Run `gtags-mode--exec-sync' with ARGS on SYMBOL and filter output with 
CREATOR.
@@ -215,34 +207,55 @@ name, code, file, line."
   (gtags-mode--exec-sync
(append args gtags-mode--output-format-options) symbol
 
+(defun gtags-mode--set-local-plist ()
+  "Set `gtags-mode--plist' for the current file.
+Return the buffer local value of `gtags-mode--plist'."
+  (if (local-variable-p 'gtags-mode--plist)
+  gtags-mode--plist
+(setq-local gtags-mode--plist (or (gtags-mode--get-plist default-directory)
+ (gtags-mode--find-or-create-plist)
+
+(defun gtags-mode--update-buffers-plist ()
+  "Actions to perform after creating a database.
+This runs only when the process exits successfully and is
+executed in the parent buffer."
+  (unless gtags-mode--plist
+(kill-local-variable 'gtags-mode--plist)
+(gtags-mode--set-local-plist)
+(when-let ((plist gtags-mode--plist)
+  (root (plist-get gtags-mode--plist :root)))
+  (mapc (lambda (buff)
+ (with-current-buffer buff
+   (when (and (not gtags-mode--plist)
+  (string-prefix-p root (file-truename 
default-directory)))
+ (kill-local-variable 'gtags-mode--plist)
+ (gtags-mode--set-local-plist
+   (buffer-list)
+
 ;; Interactive commands ==
 (defun gtags-mode-create (root-dir)
   "Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
   (interactive "DCreate GLOBAL files in directory: ")
   (let ((default-directory root-dir))
-(gtags-mode--exec-async gtags-mode--gtags nil)))
+(process-put (gtags-mode--exec-async 'gtags-mode--gtags nil)
+:extra-sentinel #'gtags-mode--update-buffers-plist)))
 
 (defun gtags-mode-update ()
   "Update GLOBAL project database."
   (interactive)
   (if gtags-mode--plist
-  (gtags-mode--exec-async gtags-mode--global '("--update"))
+  (gtags-mode--exec-async 'gtags-mode--global '("--update"))
 (error "Not under a GLOBAL project")))
 
 ;; Hooks =
 (defun gtags-mode--af

[elpa] externals/gtags-mode c1bbe60f19 30/61: Simplify code:

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit c1bbe60f1956a5d1e966325ad5136a8e15689ee7
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Simplify code:

Don't use symbol-value, but the variable directly as we use
hack-connection-local-variables-apply in
global-xref--set-connection-locals we can use the variable directly
because the with-connection-local-variables is not used anymore.
---
 global-xref.el | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/global-xref.el b/global-xref.el
index b5bd14492c..e51157c64b 100644
--- a/global-xref.el
+++ b/global-xref.el
@@ -107,24 +107,24 @@ This is the sentinel set in `global-xref--exec-async'."
(message "Global error output:\n%s" (buffer-string)
   (message "Async %s: %s" (process-command process) event))
 
-(defun global-xref--exec-async (command args &optional sentinel)
-  "Run COMMAND with ARGS asynchronously and set SENTINEL to process.
+(defun global-xref--exec-async (cmd args)
+  "Run CMD with ARGS asynchronously and set SENTINEL to process.
 Starts an asynchronous process and sets
 `global-xref--exec-async-sentinel' as the process sentinel if
 SENTINEL is nil or not specified.  Returns the process object."
-  (when-let ((cmd (symbol-value command)))
+  (when cmd
 (make-process :name (format "%s-async" cmd)
  :buffer (generate-new-buffer " *temp*" t)
  :command (append (list cmd) args)
  :sentinel #'global-xref--exec-async-sentinel
  :file-handler t)))
 
-(defun global-xref--exec-sync (command args)
-  "Run COMMAND with ARGS synchronously, on success call SENTINEL.
+(defun global-xref--exec-sync (cmd args)
+  "Run CMD with ARGS synchronously, on success call SENTINEL.
 Starts a sync process; on success call SENTINEL or
 `global-xref--sync-sentinel' if SENTINEL is not specified or nil.
 Returns the output of SENTINEL or nil if any error occurred."
-  (when-let ((cmd (symbol-value command)))
+  (when cmd
 (with-temp-buffer ;; When sync
   (let ((status (apply #'process-file cmd nil (current-buffer) nil args)))
(if (eq status 0)
@@ -136,7 +136,7 @@ Returns the output of SENTINEL or nil if any error 
occurred."
 ;; Api functions
 (defun global-xref--find-root ()
   "Return the GLOBAL project root.  Return nil if none."
-  (when-let ((root (car (global-xref--exec-sync 'global-xref--global
+  (when-let ((root (car (global-xref--exec-sync global-xref--global
'("--print-dbpath")
 (setq root (concat (file-remote-p default-directory)
   (file-truename root)))
@@ -158,7 +158,7 @@ name, code, file, line."
(match-string 3 line)   ;; file
(string-to-number (match-string 2 line) ;; line
   (global-xref--exec-sync
-   'global-xref--global
+   global-xref--global
(append args global-xref--output-format-options
(unless (string-blank-p symbol)
  (list (shell-quote-argument symbol
@@ -168,20 +168,20 @@ name, code, file, line."
   "Create a GLOBAL GTAGS file in ROOT-DIR asynchronously."
   (interactive "DCreate db in directory: ")
   (let ((default-directory root-dir))
-(global-xref--exec-async 'global-xref--gtags nil)))
+(global-xref--exec-async global-xref--gtags nil)))
 
 (defun global-xref-update ()
   "Update GLOBAL project database."
   (interactive)
   (if global-xref--project-root
-  (global-xref--exec-async 'global-xref--global '("--update"))
+  (global-xref--exec-async global-xref--global '("--update"))
 (error "Not under a GLOBAL project")))
 
 (defun global-xref--after-save-hook ()
   "After save hook to update GLOBAL database with changed data."
   (when (and buffer-file-name global-xref--project-root)
 (global-xref--exec-async
- 'global-xref--global
+ global-xref--global
  (list "--single-update"
   (file-name-nondirectory buffer-file-name)
 
@@ -229,7 +229,7 @@ any additional command line arguments to pass to GNU 
Global."
 
 (cl-defmethod xref-backend-identifier-completion-table ((_backend (eql 
global-xref)))
   "List all symbols."
-  (global-xref--exec-sync 'global-xref--global '("--completion")))
+  (global-xref--exec-sync global-xref--global '("--completion")))
 
 (cl-defmethod xref-backend-definitions ((_backend (eql global-xref)) symbol)
   "List all definitions for SYMBOL."



[elpa] externals/gtags-mode b18a7cb93d 46/61: Fix docs, info messages and use `(,

2022-04-28 Thread ELPA Syncer
branch: externals/gtags-mode
commit b18a7cb93ded1d47552ac060ee73c68b418f720d
Author: Jimmy Aguilar Mena 
Commit: Jimmy Aguilar Mena 

Fix docs, info messages and use `(,
---
 gtags-mode.el | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/gtags-mode.el b/gtags-mode.el
index 34a75be468..7dcf906feb 100644
--- a/gtags-mode.el
+++ b/gtags-mode.el
@@ -105,7 +105,7 @@ This is the sentinel set in `gtags-mode--exec-async'."
 (kill-buffer temp-buffer))
   (with-current-buffer temp-buffer ;; else print error
(while (accept-process-output process))
-   (message "Global error output:\n%s" (buffer-string
+   (message "Global async error output:\n%s" (buffer-string
 (when (buffer-live-p parent-buffer);; Always clear the cache
   (with-current-buffer parent-buffer
(plist-put gtags-mode--plist :cache nil)))
@@ -115,15 +115,15 @@ This is the sentinel set in `gtags-mode--exec-async'."
 (defsubst gtags-mode--quote (args symbol)
   "Pre-process ARGS and quote SYMBOL."
   (append args (and (stringp symbol) (not (string-blank-p symbol))
-   (list (shell-quote-argument symbol)
+   `(,(shell-quote-argument symbol)
 
 (defun gtags-mode--exec-async (cmd args &optional target)
-  "Run CMD with ARGS asynchronously and set SENTINEL to process.
+  "Run CMD with ARGS on TARGET asynchronously.
 Start an asynchronous process and sets
 `gtags-mode--exec-async-sentinel' as the process sentinel.
 Returns the process object."
   (when cmd
-(let* ((command (append `(,cmd) (gtags-mode--quote args target)))
+(let* ((command (gtags-mode--quote (append `(,cmd) args) target))
   (pr (make-process :name (format "%s-async" cmd)
 :buffer (generate-new-buffer " *temp*" t)
 :command command
@@ -134,9 +134,9 @@ Returns the process object."
   pr)))
 
 (defun gtags-mode--exec-sync (args &optional target)
-  "Run global with ARGS synchronously.
+  "Run global with ARGS on TARGET synchronously.
 On success return a list of strings or nil if any error occurred."
-  (when-let ((global gtags-mode--global)
+  (when-let ((global gtags-mode--global) ;; Required for with-temp-buffer
 (cargs (gtags-mode--quote args target)))
 (with-temp-buffer
   (let ((status (apply #'process-file global nil (current-buffer) nil 
cargs)))
@@ -144,7 +144,7 @@ On success return a list of strings or nil if any error 
occurred."
(string-lines (string-trim (buffer-substring-no-properties
(point-min)
(point-max))) t)
- (message "Global error output:\n%s" (buffer-string))
+ (message "Global sync error output:\n%s" (buffer-string))
  (message "Sync global %s: exited abnormally with code %s" cargs 
status)
  nil)
 
@@ -164,7 +164,7 @@ On success return a list of strings or nil if any error 
occurred."
   (when-let* ((root (car (gtags-mode--exec-sync '("--print-dbpath")
 (setq root (concat (file-remote-p default-directory) (file-truename root)))
 (or (gtags-mode--get-plist root)   ;; already exist
-   (car (push (list :gtagsroot root :cache nil) gtags-mode--alist)
+   (car (push `(:gtagsroot ,root :cache nil) gtags-mode--alist)
 
 (defun gtags-mode--list-completions (prefix)
   "Get the list of completions for PREFIX.
@@ -184,7 +184,7 @@ completions usually from the cache when possible."
  (and-let* ((bname (buffer-local-value 'buffer-file-name buf))
 (tname (file-truename bname))
 ((string-prefix-p root tname))
-((list buf)
+(`(,buf)
(buffer-list
 
 (defun gtags-mode--filter-find-symbol (args symbol creator)
@@ -224,7 +224,7 @@ name, code, file, line."
   (when (and buffer-file-name (plist-get gtags-mode--plist :gtagsroot))
 (gtags-mode--exec-async
  gtags-mode--global
- (list "--single-update" (file-name-nondirectory buffer-file-name)
+ `("--single-update" ,(file-name-nondirectory buffer-file-name)
 
 (defun gtags-mode--find-file-hook ()
   "Try to enable `gtags' when opening a file.
@@ -301,7 +301,7 @@ Return as a list of xref location objects."
   (gtags-mode--exec-sync
'("--path-style=absolute" "--path")
(string-remove-prefix root tdir)
-  (or dirs (list root)
+  (or dirs `(,root)
 (if (> (length dirs) 1) (delete-dups results) results)))
 
 (cl-defmethod project-buffers ((project (head :gtagsroot)))



[elpa] externals/embark ed20d8fbb5: Declare consult-xref dependencies (fix #496)

2022-04-28 Thread ELPA Syncer
branch: externals/embark
commit ed20d8fbb517f55135a5309f468f971c73f7b4a1
Author: Omar Antolín 
Commit: Omar Antolín 

Declare consult-xref dependencies (fix #496)
---
 embark-consult.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/embark-consult.el b/embark-consult.el
index 46386f3667..263b543cd8 100644
--- a/embark-consult.el
+++ b/embark-consult.el
@@ -215,6 +215,8 @@ This function is meant to be added to 
`embark-collect-mode-hook'."
 ;;; Support for consult-xref
 
 (declare-function xref--show-xref-buffer "ext:xref")
+(declare-function consult-xref "ext:consult-xref")
+(defvar consult-xref--fetcher)
 
 (defun embark-consult-export-xref (items)
   "Create an xref buffer listing ITEMS."



[elpa] externals/embark-consult updated (70f720f914 -> ed20d8fbb5)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/embark-consult.

  from  70f720f914 Fix crazy bug: revert of an xref export buffer erased 
another buffer
  adds  ed20d8fbb5 Declare consult-xref dependencies (fix #496)

No new revisions were added by this update.

Summary of changes:
 embark-consult.el | 2 ++
 1 file changed, 2 insertions(+)



[elpa] externals/org a3dac4d20a: fixup! org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL is `local'

2022-04-28 Thread ELPA Syncer
branch: externals/org
commit a3dac4d20a37c51393f191d01e0ec2170bb260a3
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

fixup! org-fold-show-set-visibility: Do not reveal emphasis unless DETAIL 
is `local'

* lisp/org-fold.el (org-fold-show-set-visibility--text-properties):
Consider nil value for REGION.
---
 lisp/org-fold.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-fold.el b/lisp/org-fold.el
index 9739bbed2d..0d8f7f9045 100644
--- a/lisp/org-fold.el
+++ b/lisp/org-fold.el
@@ -845,8 +845,9 @@ DETAIL is either nil, `minimal', `local', `ancestors',
 (let (font-lock-extend-region-functions)
   (font-lock-fontify-region (max (point-min) (1- (car 
region))) (cdr region))
   ;; Unfold links.
-  (dolist (spec '(org-link org-link-description))
-(org-fold-region (car region) (cdr region) nil spec)))
+  (when region
+(dolist (spec '(org-link org-link-description))
+  (org-fold-region (car region) (cdr region) nil spec
 (when region
   (dolist (spec (org-fold-core-folding-spec-list))
 ;; Links are taken care by above.



[elpa] externals/fontaine bf2a37b5cc: Add caveats about some font settings; clarify docs

2022-04-28 Thread ELPA Syncer
branch: externals/fontaine
commit bf2a37b5cc7448d05f77a23879436b0f94eb29ff
Author: Protesilaos Stavrou 
Commit: Protesilaos Stavrou 

Add caveats about some font settings; clarify docs

Thanks to Eli Zaretskii for the feedback on the emacs-devel mailing
list: 
.
---
 README.org  | 16 +++-
 fontaine.el | 37 ++---
 2 files changed, 41 insertions(+), 12 deletions(-)

diff --git a/README.org b/README.org
index df5c5f2438..b92545f1a6 100644
--- a/README.org
+++ b/README.org
@@ -97,7 +97,9 @@ together):
  :line-spacing 1)
 #+end_src
 
-The doc string of ~fontaine-presets~ explains all properties in detail.
+The doc string of ~fontaine-presets~ explains all properties in detail
+and documents some important caveats or information about font settings
+in Emacs.
 
 #+findex: fontaine-set-preset
 The command ~fontaine-set-preset~ applies the desired preset.  If there
@@ -253,6 +255,18 @@ Remember to read the relevant doc strings.
 (define-key global-map (kbd "C-c F") #'fontaine-set-face-font)
 #+end_src
 
+* Acknowledgements
+:PROPERTIES:
+:CUSTOM_ID: h:3cf30d7d-e0a0-4835-8f25-570bab6cc3ed
+:END:
+#+cindex: Contributors
+
+Fontaine is meant to be a collective effort.  Every bit of help matters.
+
++ Author/maintainer :: Protesilaos Stavrou.
+
++ Contributions to the code or manual :: Eli Zaretskii.
+
 * GNU Free Documentation License
 :PROPERTIES:
 :APPENDIX: t
diff --git a/fontaine.el b/fontaine.el
index 6d2a26f203..fbeea61f5f 100644
--- a/fontaine.el
+++ b/fontaine.el
@@ -52,7 +52,9 @@
 ;;  :italic-slant italic
 ;;  :line-spacing 1)
 ;;
-;; The doc string of `fontaine-presets' explains all properties in detail.
+;; The doc string of `fontaine-presets' explains all properties in detail
+;; and documents some important caveats or information about font settings
+;; in Emacs.
 ;;
 ;; The command `fontaine-set-preset' applies the desired preset.  If there
 ;; is only one available, it implements it outright.  Otherwise it produces
@@ -190,18 +192,28 @@ The properties in detail:
 - The `:line-spacing' specifies the value of the `line-spacing'
   variable.
 
-Note that all the properties for `bold' and `italic' will only
-have a noticeable effect if the active theme does not hardcode a
-weight and a slant, but instead inherits the relevant face (such
-as the `modus-themes').
+Use the desired preset with the command `fontaine-set-preset'.
 
-Also note that a height attribute for anything other than the
-`default' face must be set to a floating point, which is
-understood as a multiple of the default height (this allows all
-faces to scale harmoniously).  The `:default-height' always is a
-natural number.
+Caveats or further notes:
 
-Use the desired preset with the command `fontaine-set-preset'."
+- On a Windows system, setting a `default' weight other than
+  `regular' or `normal' will not work.  This is a limitation with
+  Emacs on that system.
+
+- All the properties for `bold' and `italic' will only have a
+  noticeable effect if the active theme does not hardcode a
+  weight and a slant, but instead inherits the relevant
+  face (such as the `modus-themes').
+
+- A height attribute for anything other than the `default' face
+  must be set to a floating point, which is understood as a
+  multiple of the default height (this allows all faces to scale
+  harmoniously).  The `:default-height' always is a natural
+  number.
+
+- Fontaine does not [yet] support Emacs' fontsets for other
+  scripts or character sets (e.g. Emoji).  Read the documentation
+  in the Info node `(emacs) Modifying Fontsets'."
   :group 'fontaine
   :type `(alist
   :value-type
@@ -405,6 +417,9 @@ Target FRAME, if provided as an optional argument."
  ;; certain families.
  (x-family-fonts nil frame)
 
+;; NOTE 2022-04-29: This is known to not work on Windows, except for
+;; Emacs 29.  Read:
+;; .
 (defun fontaine--family-list-variable-pitch (&optional frame)
   "Return a list of available proportionately spaced font families.
 Target FRAME, if provided as an optional argument."



[elpa] externals/fontaine updated (bf2a37b5cc -> e8e25d6818)

2022-04-28 Thread ELPA Syncer
elpasync pushed a change to branch externals/fontaine.

  from  bf2a37b5cc Add caveats about some font settings; clarify docs
   new  08656e8004 Add new user option; revise fontaine-set-face-font
   new  e8e25d6818 Bump version to 0.1.1


Summary of changes:
 README.org  |   7 ++-
 fontaine.el | 146 +---
 2 files changed, 116 insertions(+), 37 deletions(-)