[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gtags-mode 9c4323a5e6 13/61: Improve connection local c
From: |
ELPA Syncer |
Subject: |
[elpa] externals/gtags-mode 9c4323a5e6 13/61: Improve connection local code. |
Date: |
Thu, 28 Apr 2022 10:57:38 -0400 (EDT) |
branch: externals/gtags-mode
commit 9c4323a5e6bad59da86b66a64e55996471861a9c
Author: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
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 192258fa32 17/61: Use list instead of quotes., (continued)
- [elpa] externals/gtags-mode 192258fa32 17/61: Use list instead of quotes., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 9fc5c618a1 36/61: Simplify a bit more the cache handling code., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode c823dcffc9 49/61: Assert not call plist-put for nil, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode d4890f5bb3 45/61: Small simplification., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 95b730930b 27/61: Remove global-xref--sync-sentinel, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 1f2f3d272b 57/61: Fix performance issue., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 9dcb18fbe7 58/61: Use cscope output; it is easier to parse., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 0954a065d3 37/61: Miscellaneous fixes, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode a14940cd98 35/61: Reorder some code and simplify cache code, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode e8d19c4333 52/61: Add code to run extra sentinel, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 9c4323a5e6 13/61: Improve connection local code.,
ELPA Syncer <=
- [elpa] externals/gtags-mode a9f6acbaba 22/61: List GTAGS buffers., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 04c2d9fbaf 24/61: Use file-truename, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 599dfb8002 18/61: Improve debug of async processes., ELPA Syncer, 2022/04/28