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

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

[nongnu] elpa/bash-completion 98a2a21be7 234/313: Provide a way of refre


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion 98a2a21be7 234/313: Provide a way of refreshing the completion table.
Date: Sat, 3 Dec 2022 10:59:33 -0500 (EST)

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

    Provide a way of refreshing the completion table.
    
    With bash-completion-use-separate-processes set to t, it is possible
    to change the set of completion on bash, and these change need to be
    reflected in the internal completion table kept on the Emacs side.
---
 bash-completion.el | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/bash-completion.el b/bash-completion.el
index f50dd7fdc4..4cac5a4932 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1280,6 +1280,21 @@ completion candidates."
       (t (error "Unsupported completion type: %s" completion-type)))
      " 2>/dev/null")))
 
+;;;###autoload
+(defun bash-completion-refresh ()
+  "Refresh the completion table.
+
+This can be called after changing the completion table on BASH,
+with the builtin complete.
+
+This is only useful when `bash-completion-use-separate-processes'
+is t."
+  (interactive)
+  (let* ((process (bash-completion-get-process))
+         (buffer (bash-completion--get-buffer process)))
+    (bash-completion-send "complete -p" process)
+    (process-put process 'complete-p (bash-completion-build-alist buffer))))
+  
 ;;;###autoload
 (defun bash-completion-reset ()
   "Force the next completion command to start with a fresh BASH process.



reply via email to

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