[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bash-completion a2da7b910b 235/313: Updated README to push
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bash-completion a2da7b910b 235/313: Updated README to push for bash-completion-use-separate-processes. |
Date: |
Sat, 3 Dec 2022 10:59:34 -0500 (EST) |
branch: elpa/bash-completion
commit a2da7b910bea706a16070dc93fd515a99c5ca0a1
Author: Stephane Zermatten <szermatt@gmx.net>
Commit: Stephane Zermatten <szermatt@gmx.net>
Updated README to push for bash-completion-use-separate-processes.
New installations should set bash-completion-use-separate-processes to
nil.
---
.gitignore | 1 +
README.md | 73 +++++++++++++++++++++++++++++++++++-------------------
bash-completion.el | 71 ++++++++++++++++++++++++++++++++++------------------
3 files changed, 96 insertions(+), 49 deletions(-)
diff --git a/.gitignore b/.gitignore
index 90fdcfb681..7afe8e39c4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
*.elc
+README.html
.cask
test/.set-bash-prog.el
diff --git a/README.md b/README.md
index 43ad912aec..ed89d2eae5 100644
--- a/README.md
+++ b/README.md
@@ -34,16 +34,28 @@ the default) and by calling
1. copy bash-completion.el into a directory that's on Emacs load-path
2. add this into your .emacs file:
+```elisp
+ (setq bash-completion-use-separate-processes nil)
(autoload 'bash-completion-dynamic-complete
"bash-completion"
"BASH completion hook")
(add-hook 'shell-dynamic-complete-functions
'bash-completion-dynamic-complete)
+```
or simpler, but forces you to load this file at startup:
+```elisp
+ (setq bash-completion-use-separate-processes nil)
(require 'bash-completion)
(bash-completion-setup)
+```
+
+ NOTE: Setting `bash-completion-use-separate-processes` to nil on new
+ installations is recommended. It might become the default in future
+ versions of `bash-completion.el. See the section
+
[bash-completion-use-separate-processes](#bash-completion-use-separate-processes)
+ for more details.
3. reload your .emacs (M-x `eval-buffer') or restart
@@ -55,44 +67,32 @@ launches a new bash process.
You'll get better results if you turn on programmable bash completion.
On Ubuntu, this means running:
+```sh
sudo apt-get install bash-completion
+```
and then adding this to your .bashrc:
+```sh
. /etc/bash_completion
+```
-NOTE: The following paragraph are not relevant when
-`bash-completion-use-separate-processes` is nil.
-
-Right after enabling programmable bash completion, and whenever you
-make changes to you .bashrc, call `bash-completion-reset' to make
-sure bash completion takes your new settings into account.
-
-Loading /etc/bash_completion often takes time, and is not necessary
-in shell mode, since completion is done by a separate process, not
-the process shell-mode process.
-
-To turn off bash completion when running from emacs but keep it on
-for processes started by bash-completion.el, add this to your .bashrc:
+## bash-completion-use-separate-processes
- if [[ ( -z "$INSIDE_EMACS" || "$EMACS_BASH_COMPLETE" = "t" ) &&\
- -f /etc/bash_completion ]]; then
- . /etc/bash_completion
- fi
-
-Emacs sets the environment variable INSIDE_EMACS to the processes
-started from it. Processes started by bash-completion.el have
-the environment variable EMACS_BASH_COMPLETE set to t.
+TL;DR Set `bash-completion-use-separate-processes` to `nil` and avoid
+the issues and complications described in this section.
-## CAVEATS
+When `bash-completion-use-separate-processes` is `t`, completion runs
+in a separate process from the shell process.
-NOTE: This section is not relevant when
-`bash-completion-use-separate-processes` is nil.
+This might be useful in some cases, as it allows interrupting slow
+completions, when necessary.
-Using a separate process for doing the completion has several
+However using a separate process for doing the completion has several
important disadvantages:
- bash completion is slower than standard emacs completion
+- it relies on directory tracking working correctly on Emacs
- the first completion can take a long time, since a new bash process
needs to be started and initialized
- the separate process is not aware of any changes made to bash
@@ -108,6 +108,29 @@ important disadvantages:
of a new alias, you need to add it to .bashrc and restart the
completion process using `bash-completion-reset'.
+When using separate processes, right after enabling programmable bash
+completion, and whenever you make changes to you .bashrc, call
+`bash-completion-reset' to make sure bash completion takes your new
+settings into account.
+
+Loading /etc/bash_completion often takes time, and is not necessary
+in shell mode, since completion is done by a separate process, not
+the process shell-mode process.
+
+To turn off bash completion when running from emacs but keep it on
+for processes started by bash-completion.el, add this to your .bashrc:
+
+```bash
+ if [[ ( -z "$INSIDE_EMACS" || "$EMACS_BASH_COMPLETE" = "t" ) &&\
+ -f /etc/bash_completion ]]; then
+ . /etc/bash_completion
+ fi
+```
+
+Emacs sets the environment variable INSIDE_EMACS to the processes
+started from it. Processes started by bash-completion.el have
+the environment variable EMACS_BASH_COMPLETE set to t.
+
## COMPATIBILITY
bash-completion.el is known to work with Bash 3 and 4, on Emacs,
diff --git a/bash-completion.el b/bash-completion.el
index 4cac5a4932..cf12f08552 100644
--- a/bash-completion.el
+++ b/bash-completion.el
@@ -54,6 +54,7 @@
;;
;; 1. copy bash-completion.el into a directory that's on Emacs load-path
;; 2. add this into your .emacs file:
+;; (setq bash-completion-use-separate-processes nil)
;; (autoload 'bash-completion-dynamic-complete \"bash-completion\"
;; \"BASH completion hook\")
;; (add-hook 'shell-dynamic-complete-functions
@@ -62,7 +63,14 @@
;; or simpler, but forces you to load this file at startup:
;;
;; (require 'bash-completion)
+;; (setq bash-completion-use-separate-processes nil)
;; (bash-completion-setup)
+;;
+;; NOTE: Setting `bash-completion-use-separate-processes` to nil on new
+;; installations is recommended. It might become the default in future
+;; versions of `bash-completion.el. See the section
+;;
[bash-completion-use-separate-processes](#bash-completion-use-separate-processes)
+;; for more details.
;;
;; 3. reload your .emacs (M-x `eval-buffer') or restart
;;
@@ -77,42 +85,57 @@
;; and then adding this to your .bashrc:
;; . /etc/bash_completion
;;
-;; Right after enabling programmable bash completion, and whenever you
-;; make changes to you .bashrc, call `bash-completion-reset' to make
-;; sure bash completion takes your new settings into account.
-;;
-;; Loading /etc/bash_completion often takes time, and is not necessary
-;; in shell mode, since completion is done by a separate process, not
-;; the process shell-mode process.
-;;
-;; To turn off bash completion when running from emacs but keep it on
-;; for processes started by bash-completion.el, add this to your .bashrc:
-;; if [[ ( -z "$INSIDE_EMACS" || "$EMACS_BASH_COMPLETE" = "t" ) &&\
-;; -f /etc/bash_completion ]]; then
-;; . /etc/bash_completion
-;; fi
-;;
-;; Emacs sets the environment variable INSIDE_EMACS to the processes
-;; started from it. Processes started by bash-completion.el have
-;; the environment variable EMACS_BASH_COMPLETE set to t.
-;;
-;; CAVEATS
-;;
-;; Using a separate process for doing the completion has several
+;; CAVEAT
+;;
+;; TL;DR Set `bash-completion-use-separate-processes` to `nil` and avoid
+;; the issues and complications described in this section.
+;;
+;; When `bash-completion-use-separate-processes` is `t`, completion runs
+;; in a separate process from the shell process.
+;;
+;; This might be useful in some cases, as it allows interrupting slow
+;; completions, when necessary.
+;;
+;; However using a separate process for doing the completion has several
;; important disadvantages:
+;;
;; - bash completion is slower than standard emacs completion
+;; - it relies on directory tracking working correctly on Emacs
;; - the first completion can take a long time, since a new bash process
;; needs to be started and initialized
;; - the separate process is not aware of any changes made to bash
;; in the current buffer.
;; In a standard terminal, you could do:
-;; $ alias myalias=ls
-;; $ myal<TAB>
+;;
+;; $ alias myalias=ls
+;; $ myal<TAB>
+;;
;; and bash would propose the new alias.
;; Bash-completion.el cannot do that, as it is not aware of anything
;; configured in the current shell. To make bash-completion.el aware
;; of a new alias, you need to add it to .bashrc and restart the
;; completion process using `bash-completion-reset'.
+;;
+;; When using separate processes, right after enabling programmable bash
+;; completion, and whenever you make changes to you .bashrc, call
+;; `bash-completion-reset' to make sure bash completion takes your new
+;; settings into account.
+;;
+;; Loading /etc/bash_completion often takes time, and is not necessary
+;; in shell mode, since completion is done by a separate process, not
+;; the process shell-mode process.
+;;
+;; To turn off bash completion when running from emacs but keep it on
+;; for processes started by bash-completion.el, add this to your .bashrc:
+;;
+;; if [[ ( -z "$INSIDE_EMACS" || "$EMACS_BASH_COMPLETE" = "t" ) &&\
+;; -f /etc/bash_completion ]]; then
+;; . /etc/bash_completion
+;; fi
+;;
+;; Emacs sets the environment variable INSIDE_EMACS to the processes
+;; started from it. Processes started by bash-completion.el have
+;; the environment variable EMACS_BASH_COMPLETE set to t.
;;
;; COMPATIBILITY
;;
- [nongnu] elpa/bash-completion f1bd7b0e17 215/313: Use more meaningful names for the functions returning completion processes, (continued)
- [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, 2022/12/03
- [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 <=
- [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
- [nongnu] elpa/bash-completion c25f2203f5 240/313: Fix typo and extend note about use-separate-processes-opt., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 685ed73df0 243/313: Allow completion to replace the word being completed., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 7dc20e1b09 244/313: Use separate processes in integration tests when it doesn't matter., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion a0a5816ce4 245/313: Attempt to make in-process execution more robust., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion cad904abfd 247/313: Redefine quote_readline from setup-bash-common., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 5447034cdc 251/313: Respect completion-ignore-case setting from .inputrc., ELPA Syncer, 2022/12/03
- [nongnu] elpa/bash-completion 42630fe6cc 254/313: Fix test case to cover substring completion., ELPA Syncer, 2022/12/03