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

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

[nongnu] elpa/bash-completion 1d41c58bd5 192/313: Send initialization co


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 1d41c58bd5 192/313: Send initialization command as one string, as long as possible.
Date: Sat, 3 Dec 2022 10:59:29 -0500 (EST)

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

    Send initialization command as one string, as long as possible.
    
    With this commit, bash-completion-require-process avoids using
    bash-completion-send, and so wait for process output, until process
    output is actually useful. This might make a difference on slow remote
    connections.
---
 bash-completion.el | 34 ++++++++++++++++++++--------------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index cb921a9fbb..6793466a86 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -952,21 +952,27 @@ is set to t."
               (dolist (start-file bash-completion-start-files)
                 (when (file-exists-p (bash-completion--expand-file-name 
start-file))
                   (process-send-string process (concat ". " start-file "\n"))))
+              (process-send-string
+               process
+               (concat
+                ;; attempt to turn off unexpected status messages from
+                ;; bash if the current version of bash does not
+                ;; support these options, the commands will fail
+                ;; silently and be ignored.
+                "shopt -u checkjobs\n"
+                "shopt -u mailwarn\n"
+                "export MAILCHECK=-1\n"
+                "export -n MAIL\n"
+                "export -n MAILPATH\n"
+                "unset HISTFILE\n"
+                ;; some bash completion functions use quote_readline
+                ;; to double-quote strings - which compgen understands
+                ;; but only in some environment. disable this dreadful
+                ;; business to get a saner way of handling spaces.
+                ;; Noticed in bash_completion v1.872.
+                "function quote_readline { echo \"$1\"; }\n"))
+
               (bash-completion-send "PROMPT_COMMAND='';PS1='\t$?\v'" process 
bash-completion-initial-timeout)
-              ;; attempt to turn off unexpected status messages from bash
-              ;; if the current version of bash does not support these options,
-              ;; the commands will fail silently and be ignored.
-              (bash-completion-send "shopt -u checkjobs" process)
-              (bash-completion-send "shopt -u mailwarn" process)
-              (bash-completion-send "export MAILCHECK=-1" process)
-              (bash-completion-send "export -n MAIL" process)
-              (bash-completion-send "export -n MAILPATH" process)
-              (bash-completion-send "unset HISTFILE" process)
-              ;; some bash completion functions use quote_readline to 
double-quote
-              ;; strings - which compgen understands but only in some 
environment.
-              ;; disable this dreadful business to get a saner way of handling
-              ;; spaces. Noticed in bash_completion v1.872.
-              (bash-completion-send "function quote_readline { echo \"$1\"; }" 
process)
               (bash-completion-send "complete -p" process)
               (process-put process 'complete-p
                            (bash-completion-build-alist (process-buffer 
process)))



reply via email to

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