[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion 3efe7cb03c 067/313: escape #
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion 3efe7cb03c 067/313: escape # |
Date: |
Sat, 3 Dec 2022 10:59:17 -0500 (EST) |
branch: elpa/bash-completion
commit 3efe7cb03c1b42831d325823930ee48de9a3a8f9
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
escape #
---
bash-completion.el | 9 +++++----
bash-completion_test.el | 13 ++++++++++++-
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index 5e19bc327d..ef8d80c201 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -268,7 +268,9 @@ as returned by `bash-completion-parse-line' given the
current position POS."
(setq cword index)
(push "" strings))
(list
- (cons 'line (buffer-substring-no-properties start (cdr
(bash-completion-tokenize-get-range token))))
+ (cons 'line (buffer-substring-no-properties
+ start
+ (cdr (bash-completion-tokenize-get-range token))))
(cons 'point (- pos start))
(cons 'cword cword)
(cons 'words (nreverse strings)))))
@@ -496,7 +498,7 @@ Return TOKENS with new tokens prepended to it."
(bash-completion-tokenize-new-element end tokens))))
(defconst bash-completion-nonsep-alist
- '((nil . "^ \t\n\r;&|'\"")
+ '((nil . "^ \t\n\r;&|'\"#")
(?' . "^ \t\n\r'")
(?\" . "^ \t\n\r\""))
"Alist of sets of non-breaking characters.
@@ -566,7 +568,6 @@ Modification include:
It should be invoked with the comint buffer as the current buffer
for directory name detection to work."
-
(let ((prefix (or prefix bash-completion-prefix))
(suffix ""))
(bash-completion-addsuffix
@@ -612,7 +613,7 @@ like a quoted string.
Return a possibly escaped version of COMPLETION-CANDIDATE."
(if (string-match "^['\"]" completion-candidate)
completion-candidate
- (replace-regexp-in-string "\\([ '\"]\\)" "\\\\\\1" completion-candidate)))
+ (replace-regexp-in-string "\\([ '\"#]\\)" "\\\\\\1" completion-candidate)))
(defconst bash-completion-known-suffixes-regexp
(concat "[" (regexp-quote bash-completion-wordbreaks-str) "/ ]$")
diff --git a/bash-completion_test.el b/bash-completion_test.el
index b456c22d03..2d10eb5645 100644
--- a/bash-completion_test.el
+++ b/bash-completion_test.el
@@ -69,6 +69,13 @@ cases. That's why they need to be enabled manually.")
(bash-completion-tokenize 1 (line-end-position))))
'("a" "hello world" "b" "c"))
+ ("bash-completion-tokenize escaped #"
+ (sz-testutils-with-buffer
+ '("a hello \\#world\\# b")
+ (bash-completion-strings-from-tokens
+ (bash-completion-tokenize 1 (line-end-position))))
+ '("a" "hello" "#world#" "b"))
+
("bash-completion-tokenize double quotes"
(sz-testutils-with-buffer
'("a \"hello world\" b c")
@@ -476,13 +483,17 @@ garbage
(bash-completion-nonsep nil)
(bash-completion-nonsep ?')
(bash-completion-nonsep ?\"))
- '("^ \t\n\r;&|'\"" "^ \t\n\r'" "^ \t\n\r\""))
+ '("^ \t\n\r;&|'\"#" "^ \t\n\r'" "^ \t\n\r\""))
("bash-completion-escape-candidate"
(bash-completion-escape-candidate "He said: \"hello, 'you'\"")
"He\\ said:\\ \\\"hello,\\ \\'you\\'\\\"")
+ ("bash-completion-escape-candidate"
+ (bash-completion-escape-candidate "#hello#")
+ "\\#hello\\#")
+
("bash-completion-escape-candidate not if double quoted"
(bash-completion-escape-candidate "\"hello, you")
"\"hello, you")
- [nongnu] elpa/bash-completion 482383dcd7 021/313: handle slash for directory, usable completion, (continued)
- [nongnu] elpa/bash-completion 482383dcd7 021/313: handle slash for directory, usable completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion cd2ec103d1 026/313: Expand directory names with quotes and spaces, but no further, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 1d7af7e40d 027/313: Remove debug messages, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion dda4697cfb 029/313: included bash-completion into google env, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 21eabde7f9 045/313: Reimplemented split, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3c58afdb0d 033/313: expand file names in colon-separated paths, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5501cb63cf 042/313: Turn off mail warning, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 0dcf43f91e 041/313: don't run integration tests by default, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5b76fc4a33 032/313: remove wrong a=b variable prefix handling, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7697f1a87c 063/313: comments about tried systems, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 3efe7cb03c 067/313: escape #,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 42441e36b0 055/313: more documentation, a little refactoring, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5661a34c4a 098/313: updated test case for cd 2>/dev/null, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion c64ca7a992 071/313: simplified parse-current-command, all tests pass, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion cc1a462415 050/313: tested complex line, detect escaped separators, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 9ac7f58758 059/313: Gone through compgen, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e515453141 047/313: from an alist to (string start stop), ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 582b489fb3 091/313: Added message about mailcheck, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7f0160d271 065/313: Trim strange results that are a subset of the current value: test case, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 583ecc7707 103/313: Merge pull request #1 from kemmason/master, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 52af1ff8f7 090/313: Really disable mail check this time ? Set MAILCHECK to -1, ELPA Syncer, 2022/12/03