[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 61592a1ce1 218/313: bash-completion.el (ba
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 61592a1ce1 218/313: bash-completion.el (bash-completion-quote): Add case for empty string (#37) |
Date: |
Sat, 3 Dec 2022 10:59:32 -0500 (EST) |
branch: elpa/bash-completion
commit 61592a1ce11efdff1d18bb7675c651a8f914c10d
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Stephane Zermatten <szermatt@gmx.net>
bash-completion.el (bash-completion-quote): Add case for empty string (#37)
---
bash-completion.el | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index eb93f99876..b947a6083c 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -254,7 +254,7 @@ Bash processes")
open-quote ; quote open at stub end: nil, ?' or ?\""
compgen-args ; compgen arguments for this command (list of strings)
wordbreaks ; value of COMP_WORDBREAKS active for this completion
- compopt ; options forced with compopt nil or `(nospace . ,bool)
+ compopt ; options forced with compopt nil or `(nospace . ,bool)
)
(defun bash-completion--type (comp)
@@ -431,11 +431,15 @@ Return one string containing WORDS."
If WORD contains characters that aren't known to be harmless, this
functions adds single quotes around it and return the result."
- (if (string-match "^[a-zA-Z0-9_./-]*$" word)
- word
- (concat "'"
- (replace-regexp-in-string "'" "'\\''" word nil t)
- "'")))
+ (cond
+ ((string= "" word)
+ "''")
+ ((string-match "^[a-zA-Z0-9_./-]*$" word)
+ word)
+ (t
+ (concat "'"
+ (replace-regexp-in-string "'" "'\\''" word nil t)
+ "'"))))
(defun bash-completion--parse (comp-start comp-pos wordbreaks
bash-major-version)
"Process a command line split into TOKENS that end at POS.
@@ -1081,7 +1085,7 @@ The returned alist is a sligthly parsed version of the
output of
(line-end-position)))))
(when (string= "complete" (car words))
(if (member "-D" (cdr words))
- ;; default completion
+ ;; default completion
(push (cons nil (delete "-D" (cdr words))) alist)
;; normal completion
(let* ((reverse-wordsrest (nreverse (cdr words)))
- [nongnu] elpa/bash-completion 8fa510a174 136/313: Fix comments in header of bash-completion.el:, (continued)
- [nongnu] elpa/bash-completion 8fa510a174 136/313: Fix comments in header of bash-completion.el:, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion dda29cb470 137/313: Fix backward-compatibility code for supporting pre-24 Emacs versions,, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f3b11e1221 139/313: Preserve original, quoted version of the string being completed when, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2010d8bf9e 210/313: Fix history uncluttering, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ffe0640440 212/313: Cosmetic changes, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion bb044ff2f0 213/313: Try to handle prompts with ANSI escape sequences, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e7ee0a5e07 214/313: Add a new prop to completion process to detect if it has been setup, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f1bd7b0e17 215/313: Use more meaningful names for the functions returning completion processes, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1e13f6ffa4 216/313: Apply the name changes introduced by the previous commit in the test files, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4d6fb40bec 217/313: Accept output only from the process performing completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 61592a1ce1 218/313: bash-completion.el (bash-completion-quote): Add case for empty string (#37),
ELPA Syncer <=
- [nongnu] elpa/bash-completion 504dd26b1d 219/313: Use cl-defstruct instead of defstruct (#39), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 96ce14af96 221/313: Fix typo (#41), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 783a1e79f0 230/313: Add melpa and melpa-stable badges to README., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion d8f02ecbb1 231/313: Merge branch 'master' into use-separate-processes-opt, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 10569a4625 232/313: Fix bash-completion-test-send., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1b7ec87915 233/313: Fix byte-compilation error under Emacs 24 and 25., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a2da7b910b 235/313: Updated README to push for bash-completion-use-separate-processes., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion fd3ba68800 236/313: Force bash-completion-use-separate-processes to t in tests., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7f4410ebcb 237/313: Extend integration tests to cover single-process use-case., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f8c2083a14 239/313: Rename bash-completion-get-process., ELPA Syncer, 2022/12/03