[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gtags-mode 86777df9a3 50/61: Call gtags-mode--set-conne
From: |
ELPA Syncer |
Subject: |
[elpa] externals/gtags-mode 86777df9a3 50/61: Call gtags-mode--set-connection-locals before processes |
Date: |
Thu, 28 Apr 2022 10:57:42 -0400 (EDT) |
branch: externals/gtags-mode
commit 86777df9a3f2ce624b8c15868d3aea4f05c47134
Author: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
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 f4fc9bad41 05/61: Add find-file hook, (continued)
- [elpa] externals/gtags-mode f4fc9bad41 05/61: Add find-file hook, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 442f819924 07/61: General fixes., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 55b0cbadb6 01/61: First commit., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode c88225e3f1 02/61: Add Readme.md, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 9763f8fb69 03/61: Add async processes to create and update database cleanly., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode f4bda60a1a 06/61: Fix global-xref--set-connection-locals., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 82b7f79aff 08/61: Simplify code., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 45fdfac932 09/61: Simplify imenu again., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 8734f6b54d 48/61: Reorder, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 10a710a3dd 54/61: Fix and simplify, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 86777df9a3 50/61: Call gtags-mode--set-connection-locals before processes,
ELPA Syncer <=
- [elpa] externals/gtags-mode ae397208b5 32/61: Finish rename process., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode c1bbe60f19 30/61: Simplify code:, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode b18a7cb93d 46/61: Fix docs, info messages and use `(,, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 3d7bf179bb 29/61: Use make-process instead of start-file-process., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode dc50f340d4 12/61: Small fixes in documentation and other details., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 5525174de9 34/61: Many changes:, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 317ed00754 61/61: Assert we retun nil on error, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 7dc81cbae2 56/61: Small simplifies, ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 5445a63b79 21/61: Small fixes., ELPA Syncer, 2022/04/28
- [elpa] externals/gtags-mode 33938b17e7 41/61: New function, ELPA Syncer, 2022/04/28