emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: ELPA Syncer
Subject: [elpa] externals/gtags-mode 9b67043bcf 44/61: Use a workaround to pint proper information
Date: Thu, 28 Apr 2022 10:57:41 -0400 (EDT)

branch: externals/gtags-mode
commit 9b67043bcf194b24fd80400b6ff4a86033c1e4d2
Author: Jimmy Aguilar Mena <kratsbinovish@gmail.com>
Commit: Jimmy Aguilar Mena <kratsbinovish@gmail.com>

    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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]