[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 33ed66e567 099/313: bash-completion-nospac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 33ed66e567 099/313: bash-completion-nospace option |
Date: |
Sat, 3 Dec 2022 10:59:20 -0500 (EST) |
branch: elpa/bash-completion
commit 33ed66e5674c6dfc99d3b7461e01a4551b86eb0a
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
bash-completion-nospace option
---
bash-completion.el | 16 +++++++++++++++-
bash-completion_test.el | 17 ++++++++++++-----
2 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 122cfd6800..0498598fb3 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -189,6 +189,19 @@ which typically takes a long time."
:type '(float)
:group 'bash-completion)
+(defcustom bash-completion-nospace nil
+ "Never let bash add a final space at the end of a completion.
+
+When there is only one completion candidate, bash sometimes adds
+a space at the end of the completion to move the cursor at the
+appropriate position to add more command-line arguments. This
+feature doesn't always work perfectly with programmable completion.
+
+Enable this option if you find yourself having to often backtrack
+to remove the extra space bash adds after a completion."
+ :type '(boolean)
+ :group 'bash-completion)
+
;;; ---------- Internal variables and constants
(defvar bash-completion-process nil
@@ -691,7 +704,8 @@ for directory name detection to work."
(t str))))
(when (bash-completion-ends-with rest " ")
(setq rest (substring rest 0 -1))
- (setq suffix " "))
+ (unless bash-completion-nospace
+ (setq suffix " ")))
(concat prefix (bash-completion-escape-candidate rest open-quote)
suffix)))))
(defun bash-completion-escape-candidate (completion-candidate open-quote)
diff --git a/bash-completion_test.el b/bash-completion_test.el
index ae079f222b..e68bca7ddd 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -469,8 +469,14 @@ garbage
"a\\ bc\\ d\\ e")
("bash-completion-fix do not escape final space"
- (bash-completion-fix "ab " "a")
+ (let ((bash-completion-nospace nil))
+ (bash-completion-fix "ab " "a"))
"ab ")
+
+ ("bash-completion-fix remove final space"
+ (let ((bash-completion-nospace t))
+ (bash-completion-fix "ab " "a"))
+ "ab")
("bash-completion-fix unexpand home and escape"
(bash-completion-fix (expand-file-name "~/a/hello world") "~/a/he")
@@ -489,10 +495,11 @@ garbage
"Dexter")
("bash-completion-extract-candidates"
- (flet ((bash-completion-buffer () (current-buffer)))
- (sz-testutils-with-buffer
- "hello world\nhello \n\n"
- (bash-completion-extract-candidates "hello" nil)))
+ (let ((bash-completion-nospace nil))
+ (flet ((bash-completion-buffer () (current-buffer)))
+ (sz-testutils-with-buffer
+ "hello world\nhello \n\n"
+ (bash-completion-extract-candidates "hello" nil))))
'("hello\\ world" "hello "))
("bash-completion-nonsep"
- [nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization group, (continued)
- [nongnu] elpa/bash-completion a2d322fb79 054/313: Added customization group, ELPA Syncer, 2022/12/03
- [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 <=
- [nongnu] elpa/bash-completion cf42ed1057 101/313: add compatibility information for emacs 24.1.1 with OSX 10.7 / 10.8, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f9903d4bd4 079/313: ran checkdoc again, re-ran integration tests, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion bab4cf6e8d 109/313: Merge remote-tracking branch 'origin/master' into complete_D, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion dce43a54c5 119/313: Update comment in bash-completion-test, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5209200f3b 120/313: Using cl-letf instead of flet., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9588a9c0dd 125/313: Updated README, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c5f2b2756f 129/313: Define sz-testutils as a global variable., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f085c41d8d 131/313: Add defcustom for bash-completion-args, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8ca917f428 133/313: Stop escaping = in completion. fixes #18, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 319886faa9 138/313: Add / after directory names - even if they contain spaces or special, ELPA Syncer, 2022/12/03