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

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

[nongnu] elpa/bash-completion fefe5ae88e 191/313: Introduce bash-complet


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion fefe5ae88e 191/313: Introduce bash-completion-remote-prog.
Date: Sat, 3 Dec 2022 10:59:29 -0500 (EST)

branch: elpa/bash-completion
commit fefe5ae88e15e5dcdcbce3e5ebf6b99bc2b151ad
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Introduce bash-completion-remote-prog.
    
    bash-completion-remote-prog allows setting a different path for the
    bash executable on remote hosts. The default is just "bash", which
    lets trap look for a bash executable in its path.
    
    Also expand the error message displayed when the connection to the
    bash process fails, to make debugging easier.
---
 bash-completion.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index df8aca6d05..cb921a9fbb 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -153,6 +153,15 @@ for command-line completion."
   :type '(file :must-match t)
   :group 'bash-completion)
 
+(defcustom bash-completion-remote-prog "bash"
+  "Name or path of the remote BASH executable to use.
+
+This is the path of an BASH executable available on the remote machine.
+Best is to just specify \"bash\" and rely on the PATH being set correctly
+for the remote connection."
+  :type '(string)
+  :group 'bash-completion)
+
 (defcustom bash-completion-args '("--noediting")
   "Args passed to the BASH shell."
   :type '(repeat (string :tag "Argument"))
@@ -924,7 +933,7 @@ is set to t."
                      (buffer-name (generate-new-buffer-name " 
bash-completion"))
                      (args `("*bash-completion*"
                              ,buffer-name
-                             ,bash-completion-prog
+                             ,(if remote bash-completion-remote-prog 
bash-completion-prog)
                              ,@bash-completion-args)))
                 (when remote
                   ;; See 
http://lists.gnu.org/archive/html/tramp-devel/2016-05/msg00004.html
@@ -1179,7 +1188,10 @@ Return the status code of the command, as a number."
       (process-send-string process (concat commandline "\n"))
       (while (not (progn (goto-char 1) (search-forward "\v" nil t)))
        (unless (accept-process-output process timeout)
-         (error "Timeout while waiting for an answer from bash-completion 
process")))
+         (error (concat
+                  "Timeout while waiting for an answer from "
+                  "bash-completion process.\nProcess output: <<<EOF\n%sEOF")
+                 (buffer-string))))
       (let* ((control-v-position (point))
             (control-t-position (progn (search-backward "\t" nil t) (point)))
             (status-code (string-to-number



reply via email to

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