[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization gr
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization group |
Date: |
Sat, 3 Dec 2022 10:59:15 -0500 (EST) |
branch: elpa/bash-completion
commit a2d322fb7975b72f02f0af132266e60d4aef0467
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Added customization group
---
bash-completion.el | 84 ++++++++++++++++++++++++++++++++++++------------------
1 file changed, 57 insertions(+), 27 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 4649607009..40d3c004c4 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -7,18 +7,47 @@
;; echo "ON"
;;fi
-(defvar bash-completion-prog "bash"
- "Command-line to execute bash")
-
-(defvar bash-completion-process-timeout 2.5
+(defgroup bash-completion nil
+ "BASH configurable command-line completion "
+ :group 'shell
+ :group 'shell-command)
+
+(defcustom bash-completion-enabled t
+ "Enable/Disable BASH configurable command-line completion globally.
+
+This flag is useful for temporarily disabling bash completion
+once it's been installed.
+
+Setting this variable to t is NOT enough to enable BASH completion.
+BASH completion is only available in the environment for which
+`bash-completion-dynamic-complete' has been registered. See
+`bash-completion-setup' for that.
+"
+ :type '(boolean)
+ :group 'bash-completion)
+
+(defcustom bash-completion-prog "/bin/bash"
+ "Name or path of the BASH executable to run for command-line completion.
+This should be either an absolute path to the BASH executable or
+the name of the bash command if it is on Emacs' PATH. This
+should point to a recent version of BASH (BASH 3) with support
+for command-line completion."
+ :type '(file :must-match t)
+ :group 'bash-completion)
+
+(defcustom bash-completion-process-timeout 2.5
"Timeout value to apply when waiting from an answer from the
bash process. If bash takes longer than that to answer, the answer
-will be ignored.")
+will be ignored."
+ :type '(float)
+ :group 'bash-completion)
-(defvar bash-completion-initial-timeout 30
+(defcustom bash-completion-initial-timeout 30
"Timeout value to apply when talking to bash for the first time.
The first thing bash is supposed to do is process /etc/bash_complete,
-which typically takes a long time.")
+which typically takes a long time."
+ :type '(float)
+ :group 'bash-completion)
(defvar bash-completion-process nil
"Bash process object")
@@ -54,26 +83,27 @@ colon-separated values.")
"Bash completion function for `comint-complete-dynamic-functions'.
Call bash to do the completion."
- (when (not (window-minibuffer-p))
- (message "Bash completion..."))
- (let* ( (pos (point))
- (start (comint-line-beginning-position))
- (end (line-end-position))
- (parsed (bash-completion-parse-line start end pos))
- (line (cdr (assq 'line parsed)))
- (point (cdr (assq 'point parsed)))
- (cword (cdr (assq 'cword parsed)))
- (words (cdr (assq 'words parsed)))
- (stub (nth cword words))
- (completions (bash-completion-comm line point words cword))
- ;; Override configuration for comint-dynamic-simple-complete.
- ;; Bash adds a space suffix automatically.
- (comint-completion-addsuffix nil) )
- (if completions
- (comint-dynamic-simple-complete stub completions)
- ;; no standard completion
- ;; try default (file) completion after a wordbreak
- (bash-completion-dynamic-try-wordbreak-complete stub))))
+ (when bash-completion-enabled
+ (when (not (window-minibuffer-p))
+ (message "Bash completion..."))
+ (let* ( (pos (point))
+ (start (comint-line-beginning-position))
+ (end (line-end-position))
+ (parsed (bash-completion-parse-line start end pos))
+ (line (cdr (assq 'line parsed)))
+ (point (cdr (assq 'point parsed)))
+ (cword (cdr (assq 'cword parsed)))
+ (words (cdr (assq 'words parsed)))
+ (stub (nth cword words))
+ (completions (bash-completion-comm line point words cword))
+ ;; Override configuration for comint-dynamic-simple-complete.
+ ;; Bash adds a space suffix automatically.
+ (comint-completion-addsuffix nil) )
+ (if completions
+ (comint-dynamic-simple-complete stub completions)
+ ;; no standard completion
+ ;; try default (file) completion after a wordbreak
+ (bash-completion-dynamic-try-wordbreak-complete stub)))))
(defun bash-completion-dynamic-try-wordbreak-complete (stub)
(let* ((wordbreak-split (bash-completion-last-wordbreak-split stub))
- [nongnu] elpa/bash-completion bbff4fa527 172/313: Merge branch 'master' of github.com:szermatt/emacs-bash-completion, (continued)
- [nongnu] elpa/bash-completion bbff4fa527 172/313: Merge branch 'master' of github.com:szermatt/emacs-bash-completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b307dc24c3 005/313: keep cword, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a79137cc86 004/313: escaped quotes, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 581864111e 039/313: integration test harness, process buffer cleanup, hidden buffer, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3e1481741c 031/313: remove messages, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0d360a45cd 017/313: fixed test case, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c28492a749 036/313: wordbreak before and after, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8b02aafc67 046/313: separators, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2390d5cdf3 061/313: more commends and documentation; still need a commentary section, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c0f7c20a6b 094/313: added license and missing test dependency, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization group,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 983f5c28e9 106/313: Merge pull request #2 from frankpzh/patch-1, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9f02a62609 049/313: re-enabled parse-line cursor at the beginning/in the middle tests, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3ec615a4ef 077/313: added id, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f1d8d73b42 072/313: changed comment, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2d6ad3980a 062/313: fixes for emacs 22, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9583153e0b 068/313: Fixed issue with wordbreak character being the first character, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7dec35f302 087/313: Set MAIL to the empty string in case shopt -u mailwarn is not, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8a246f40da 088/313: bash-completion-generate-line: add missing compgen option to, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 6fb6bf5588 081/313: Mention ghardy bash version, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 33ed66e567 099/313: bash-completion-nospace option, ELPA Syncer, 2022/12/03