Fix issue #11037: Do not adjust the width of a popup shell's window unless its
position is left or right.
* layers/+tools/shell/funcs.el: Check that shell-pop-window-position is 'left
or 'right before adjusting the window's width.
Replace push with add-to-list in layer init functions and related code.
Modify spacemacs|add-toggle to check for and update an existing toggle in
spacemacs-toggles and only create a new toggle if none already existed.
Replace a conditional push onto erc-packages with use of :toggle.
When initializing which-key, set which-key-replacement-alist to its default
or customized setting before adding all the Spacemacs replacements. We
want to keep the stock replacements but avoid adding duplicates of the
Spacemacs replacements.
Replace the emacs-lisp-mode-hook lambda with a named function to avoid
adding duplicate hooks (which can add duplicate definitions of the
evil-surround pair).
* shell: Restore correct value for company-idle-delay
In spacemacs//toggle-shell-auto-completion-based-on-path, re-enable
automatic suggestions by restoring company-idle-delay to the value of
auto-completion-idle-delay rather than to a hardcoded value.
* Document how to disable automatic suggestions
Document how to disable automatic suggestions, and mention that the Tab key
will still perform completion even with automatic suggestions disabled.
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.
The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
Problem
---
`C-j` and `C-k` key bindings don't work in eshell buffers except the first one.
Solution
---
`eshell-mode-map` is buffer-local, so key bindings have to be defined in a hook
function.
I feel like we should start from scratch on this one and carefully choose the
defaults.
Also this settings is a very personal setting so if we make some buffers
useless we must have a consensus on it. Marking all special buffers starting
with `*` as useless is too aggressive and make Spacemacs less POLA since two
consecutive press on SPC TAB may not revert to the original buffer.
Fix docs for "Fish shell and ansi-term" and explicitly enable `truncate-lines`.
I was using the suggested hook as well as `(setq-default truncate-lines t)`,
so my fish shell was acting funny because `truncate-lines` was being disabled
rather than enabled.
Modify the default behavior for eshell's clear functionality.
- Make eshell `clear RET` _similar_ to `C-l`
- `clear RET` is eshell/clear
- `C-l` is eshell-clear-stroke
- Prevent `C-l` clearing cycle
- Prevent `clear RET` inserting a page of white-space
- Prevent duplicate insert lines from `clear RET`
- Make eshell-clear-keystroke that is dependent on eshell/clear
- Load both after eshell is initialized to prevent them from being overwritten
This fixes#5424, fixes#5419
Modify eshell clear statements load position
Change the clear statements load position from after loading eshell to
after enabling eshell.
This produces the same result, but is cleaner.
Note, they _cannot_ be defined before eshell loads, otherwise they are overwritten.
Refactor eshell-clear-keystroke to spacemacs/eshell-clear-keystroke
- Reduce steps needed to access clear command with define key
- Rename function to match naming conventions
- The function shouldn't be accessed from the shell prompt
- So not eshell/clear-keystroke
- The function isn't from eshell.el
- So not eshell-clear-keystroke
- However, eshell/clear should be since it is overwriting a command
Eshell doesn't call preoutput-filter functions in the context of the eshell
buffer. This breaks the xterm color filtering when the eshell buffer is updated
when it's not currently focused.
I intend on submitting this fix upstream when I get a chance but an advice fixes
it for now. The other fix is to move the xterm color filter to a
output-filter function (instead of preoutput-filter) but those operate on
strings that have already been inserted into the buffer.
Enabling a company backend for a specific mode was a tedious tasks with code
scattered at different locations, one for local variable definitions, one for
company hook function definitions and another where the backends were pushed to
the local variables (which was problematic, since we ended up pushing the same
backends over and over again with `SPC f e R`, pushes have been replaced by
add-to-list calls in the new macro).
All these steps are now put together at one place with the new macro
spacemacs|add-company-backends, check its docstring for more info on its
arguments.
This macro also allows to define arbitrary buffer local variables to tune
company for specific modes (similar to layer variables via a keyword :variables)
The code related to company backends management has been moved to the
auto-completion layer in the funcs.el file. A nice side effect of this move is
that it enforces correct encapsulation of company backends related code. We can
now easily detect if there is some configuration leakage when the
auto-completion layer is not used. But we loose macro expansion at file loading
time (not sue it is a big concern though).
The function spacemacs|enable-auto-complete was never used so it has been
deleted which led to the deletion of the now empty file core-auto-completion.el.
The example in LAYERS.org regarding auto-completion is now out of date and has
been deleted. An example to setup auto-completion is provided in the README.org
file of the auto-completion layer.
After 63dc8f7ea0 `SPC '` started to ask
for "Run program" instead of opening the shell with the defined shell.
This commit remove the `call-interactively` that are causing this
problem. `SPC u SPC '` is still working as far as I tested.
This makes sure that all the setup happens at the same time. Previously
some setup happened at loading time of esh-mode while some happened in
eshell-mode-hook. Everything output between this (the first prompt)
looks different.