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

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

[nongnu] elpa/bash-completion fd2f8e277e 211/313: Improve prompt detecti


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion fd2f8e277e 211/313: Improve prompt detection
Date: Sat, 3 Dec 2022 10:59:31 -0500 (EST)

branch: elpa/bash-completion
commit fd2f8e277eaeea5037397a1daeb1a08e80a9d3db
Author: montag451 <montag451@laposte.net>
Commit: montag451 <montag451@laposte.net>

    Improve prompt detection
---
 bash-completion.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/bash-completion.el b/bash-completion.el
index 098ef3995f..339c6d41f4 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1328,6 +1328,13 @@ and would like bash completion in Emacs to take these 
changes into account."
       (setq no-timeout (accept-process-output process timeout)))
     no-timeout))
 
+(defun bash-completion--get-prompt-regexp ()
+  (if comint-use-prompt-regexp
+      comint-prompt-regexp
+    (let* ((end (comint-line-beginning-position))
+           (start (previous-property-change end)))
+      (regexp-quote (buffer-substring-no-properties start end)))))
+
 (defun bash-completion-send (commandline &optional process timeout)
   "Send a command to the bash completion process.
 
@@ -1351,7 +1358,7 @@ Return the status code of the command, as a number."
         (timeout (or timeout bash-completion-process-timeout))
         (prompt-regexp (if bash-completion-use-separate-processes
                            "\t-?[[:digit:]]+\v"
-                         comint-prompt-regexp))
+                         (bash-completion--get-prompt-regexp)))
         (comint-preoutput-filter-functions
          (if bash-completion-use-separate-processes
              comint-preoutput-filter-functions



reply via email to

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