emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/bash-completion c584d4936b 281/313: Explicitly ignore erro


From: ELPA Syncer
Subject: [nongnu] elpa/bash-completion c584d4936b 281/313: Explicitly ignore error from the history command.
Date: Sat, 3 Dec 2022 10:59:38 -0500 (EST)

branch: elpa/bash-completion
commit c584d4936ba99065bbd4850483826eeac83e4d48
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>

    Explicitly ignore error from the history command.
    
    The history command failing shouldn't be a fatal error; it's only there
    not to pollute history with completion command.
    
    History is known to fail at least on new shells, when there is no
    history yet.
---
 bash-completion.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bash-completion.el b/bash-completion.el
index 425cb8564a..01a1dfbf4c 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -1199,7 +1199,7 @@ completion in these cases."
             "  __emacs_complete_pc=\"$PROMPT_COMMAND\";"
             "fi;"
             "PS1='' PROMPT_COMMAND='';"
-            "history &>/dev/null -d $((HISTCMD - 1))\n"))
+            "history &>/dev/null -d $((HISTCMD - 1)) || true\n"))
           
           ;; The following is a bootstrap command for
           ;; bash-completion-send itself.
@@ -1211,7 +1211,7 @@ completion in these cases."
             "    __emacs_complete_pc=\"$PROMPT_COMMAND\";"
             "  fi;"
             "  PROMPT_COMMAND=__emacs_complete_prompt;"
-            "  history &>/dev/null -d $((HISTCMD - 1));"
+            "  history &>/dev/null -d $((HISTCMD - 1)) || true;"
             "};"
             "function __emacs_complete_prompt {"
             "  PS1=" bash-completion--ps1 ";"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]