[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete met
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete method |
Date: |
Sat, 3 Dec 2022 10:59:11 -0500 (EST) |
branch: elpa/bash-completion
commit 28ec870dd1045183bc9f095682faa7616c8986ae
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
only one -complete method
---
bash-complete.el | 52 +++++++++++++++++++++-------------------------------
1 file changed, 21 insertions(+), 31 deletions(-)
diff --git a/bash-complete.el b/bash-complete.el
index abdca04c88..b1a4122cf0 100644
--- a/bash-complete.el
+++ b/bash-complete.el
@@ -4,9 +4,6 @@
(defvar bash-complete-prog "bash"
"Command-line to execute bash")
-(defvar bash-complete-mode-list '(shell-mode)
- "List of comint modes for which bash-complete should be enabled")
-
(defvar bash-complete-process-timeout 2.5)
(defvar bash-complete-initial-timeout 30
"Timeout value to apply when talking to bash for the first time.
@@ -28,41 +25,34 @@ See `bash-complete-add-to-alist'.
(defun bash-complete-setup ()
(add-hook 'shell-dynamic-complete-functions
- 'bash-complete-dynamic-complete-in-selected-modes)
+ 'bash-complete-dynamic-complete)
(add-hook 'shell-command-complete-functions
'bash-complete-dynamic-complete))
-;;;###autoload
-(defun bash-complete-dynamic-complete-in-selected-modes ()
- (when (memq major-mode bash-complete-mode-list)
- (message "Bash completion...")
- (bash-complete-dynamic-complete)))
-
;;;###autoload
(defun bash-complete-dynamic-complete ()
"Bash completion function for `comint-complete-dynamic-functions'.
Call bash to do the completion."
- (bash-complete-dynamic-complete))
-
-(defun bash-complete-dynamic-complete ()
- (let* ( (pos (point))
- (start (bash-complete-line-beginning-position))
- (end (line-end-position))
- (line (buffer-substring-no-properties start end))
- (wordsplit)
- (cword)
- (words)
- (stub) )
- (save-excursion
- (setq wordsplit (bash-complete-split start end pos))
- (setq cword (car wordsplit))
- (setq words (cdr wordsplit))
- (setq stub (nth cword words)))
- (comint-dynamic-simple-complete
- stub
- (bash-complete-comm default-directory
- line (- pos start) words cword))))
+ (when (window-minibuffer-p)
+ (message "Bash completion..."))
+ (let* ( (pos (point))
+ (start (bash-complete-line-beginning-position))
+ (end (line-end-position))
+ (line (buffer-substring-no-properties start end))
+ (wordsplit)
+ (cword)
+ (words)
+ (stub) )
+ (save-excursion
+ (setq wordsplit (bash-complete-split start end pos))
+ (setq cword (car wordsplit))
+ (setq words (cdr wordsplit))
+ (setq stub (nth cword words)))
+ (comint-dynamic-simple-complete
+ stub
+ (bash-complete-comm default-directory
+ line (- pos start) words cword))))
(defun bash-complete-line-beginning-position (&optional start)
(save-excursion
@@ -262,7 +252,7 @@ Return `bash-complete-alist'."
(with-current-buffer buffer
(save-excursion
(setq bash-complete-alist nil)
- (end-of-buffer)
+ (goto-char (point-max))
(while (= 0 (forward-line -1))
(bash-complete-add-to-alist
(cdr (bash-complete-split (line-beginning-position)
(line-end-position) 0))))))
- [nongnu] elpa/bash-completion 34221c1fdd 185/313: Make bash-completion-enable-caching the default, remove the, (continued)
- [nongnu] elpa/bash-completion 34221c1fdd 185/313: Make bash-completion-enable-caching the default, remove the, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8c3995aa98 187/313: run_tests.sh displays the bash command to test against., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3eba6922e6 190/313: Use executable-find instead of hardcoding /bin/bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1d41c58bd5 192/313: Send initialization command as one string, as long as possible., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c5d4f92e6d 195/313: Still EMACS_BASH_COMPLETE using setenv for local processes., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 24088ede85 196/313: Explicitly mention compatibility with Bash 3 and 4., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0f6466eeb4 197/313: Tell minibuffer not to delay after displaying a message while, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0c4557a5ed 193/313: Integration test for default completion (-D)., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e7869dd68d 200/313: Fix a bug when no process is associated with the current buffer, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 80be2f37a9 205/313: Check the buffer uses comint-mode before using the same process, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 28ec870dd1 019/313: only one -complete method,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 6a0ada6278 038/313: completed test cases, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7d6236e6e7 100/313: ignore .elc files, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1aff6d8806 084/313: comment about shell-command, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f5384c6176 051/313: A little refactoring, test case for wordbreak completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6f7c2b8b4f 080/313: removed initial version, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2cf41d7fc 102/313: put in accidentally removed blank line from README, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a8b652d00a 058/313: commented all functions, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b4fe25b51c 060/313: update tests for latest refactorings, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 49ae0ada64 076/313: keep open quote, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion aedcc114dc 105/313: Minor fixes to eliminate byte-compiler warnings., ELPA Syncer, 2022/12/03