[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion ea5cc15b99 273/313: Let status code of com
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion ea5cc15b99 273/313: Let status code of compgen through when in single-process mode. |
Date: |
Sat, 3 Dec 2022 10:59:37 -0500 (EST) |
branch: elpa/bash-completion
commit ea5cc15b9925071fc863246b721f4dca9983aeb3
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Let status code of compgen through when in single-process mode.
(bash-completion-send) is supposed to return the status of the
command. However, when running in single-process mode, a command was
executed after the main command, so the status returned was the status
of that second command.
This change transforms __emacs_complete_post_command into
__bash_complete_pre_command.
This change also silences errors from the history command, which is
how this issue came to light, as errors from history made it look like
the compgen command failed.
---
bash-completion.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/bash-completion.el b/bash-completion.el
index b9c2d4c571..a30379cd94 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1238,18 +1238,18 @@ if [[ -z \"$__emacs_complete_ps1\" ]]; then \
__emacs_complete_ps1=\"$PS1\"\
__emacs_complete_pc=\"$PROMPT_COMMAND\"; \
fi; \
-PS1='' PROMPT_COMMAND=''; history -d $((HISTCMD - 1))\n")
+PS1='' PROMPT_COMMAND=''; history &>/dev/null -d $((HISTCMD - 1))\n")
;; The following is a bootstrap command for
;; bash-completion-send itself.
(bash-completion-send
- "function __emacs_complete_post_command {
+ "function __emacs_complete_pre_command {
if [[ -z \"$__emacs_complete_ps1\" ]]; then
__emacs_complete_ps1=\"$PS1\"
__emacs_complete_pc=\"$PROMPT_COMMAND\"
fi
PROMPT_COMMAND=__emacs_complete_prompt
- history -d $((HISTCMD - 1))
+ history &>/dev/null -d $((HISTCMD - 1))
}; \
function __emacs_complete_prompt {
PS1='\t$?\v'
@@ -1263,7 +1263,7 @@ function __emacs_complete_recover_prompt {
if [[ -n \"$PROMPT_COMMAND\" ]]; then
(exit $r); eval \"$PROMPT_COMMAND\"
fi
-}" process)
+}; __emacs_complete_pre_command" process)
(bash-completion--setup-bash-common process))
process))))
@@ -1502,12 +1502,11 @@ Return the status code of the command, as a number."
(send-string (if bash-completion-use-separate-processes
#'process-send-string
#'comint-send-string))
- (post-command (if bash-completion-use-separate-processes
- "\n"
- "; __emacs_complete_post_command;\n")))
+ (pre-command (unless bash-completion-use-separate-processes
+ "__emacs_complete_pre_command; ")))
(with-current-buffer (bash-completion--get-buffer process)
(erase-buffer)
- (funcall send-string process (concat commandline post-command))
+ (funcall send-string process (concat pre-command commandline "\n"))
(unless (bash-completion--wait-for-regexp process "\t-?[[:digit:]]+\v"
timeout)
(error (concat
"Timeout while waiting for an answer from "
- [nongnu] elpa/bash-completion 2dbc7e61f6 248/313: Extend bash-completion-refresh to refresh everything, test it., (continued)
- [nongnu] elpa/bash-completion 2dbc7e61f6 248/313: Extend bash-completion-refresh to refresh everything, test it., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 04393bca0f 250/313: Apply filename post-processing even when prefix doesn't match., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 2a937b3763 255/313: Don't let Emacs post-filter completions built by bash., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e95867c993 256/313: completion-table-with-cache captures and restore buffer and variables., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 747920fdbf 265/313: Avoid having to set BASH_COMPLETION., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion f15176ee59 267/313: Fix to properly evaluate PROMPT_COMMAND after restoring it., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion b4ae893243 268/313: Test prompt and history manipulation, fix $? in prompt., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 20feaf909d 258/313: Fix markdown markup., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8713edbb92 269/313: Mention that completion works with bash 5, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 4b80c75c43 272/313: Take current directory from shell when in single-process mode., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion ea5cc15b99 273/313: Let status code of compgen through when in single-process mode.,
ELPA Syncer <=
- [nongnu] elpa/bash-completion 12da4f0e91 289/313: Better handle slow completion functions., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7186a18cad 012/313: Integrated into comm, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion e81c478032 020/313: bash-complete -> bash-completion, ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 8270e09294 023/313: pass words as command-line arguments to the function, ELPA Syncer, 2022/12/03
- [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