This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/doc/HOWTOs.md
Tu Do 21ca031492 [Emergency fix] spacemacs//mark-repl-as-useful
This function is making asynchronous commands fail because it tries to
add string literal to spacemacs-useful-buffers-regexp while add-to-list
only works when first argument is a symbol and the second is an
element. Otherwise, it throws this error and stop all async commands to
do any further work at this point:

if: Wrong type argument: symbolp

This commit fixes the following issues:

- Don't add spacemacs//mark-repl-as-useful to
  buffer-list-update-hook. We only need this function to switch to next
  or previous buffer. So, better check when and only when those commands
  are actually used.

- As a result, we remove the function since it's unneeded anymore.

- Do the checking in of comint-mode in spacemacs-useful-buffer-p
  function. Better do it in one place than scatter the logic in a hook
  and this function.

- Change useless-buffer-p to accept an actual buffer object and check
  for buffer name inside.
2015-04-24 00:07:29 -04:00

66 lines
2.2 KiB
Markdown

# Compilation of quick HOW-TOs for Spacemacs
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
**Table of Contents**
- [Compilation of quick HOW-TOs for Spacemacs](#compilation-of-quick-how-tos-for-spacemacs)
- [Disable a package completely](#disable-a-package-completely)
- [Disable a package only for a specific major-mode](#disable-a-package-only-for-a-specific-major-mode)
- [Disable company for a specific major-mode](#disable-company-for-a-specific-major-mode)
- [Change special buffer rules](#change-special-buffer-rules)
<!-- markdown-toc end -->
## Disable a package completely
To completely disable a package and effectively uninstalling it even if it
is part of your used layers, look for the variable
`dotspacemacs-excluded-packages` in your dotfile and add the package name
to it:
```elisp
dotspacemacs-excluded-packages '(package1 package2 ...)
```
## Disable a package only for a specific major-mode
This is done by removing the hook added by Spacemacs. For example to
remove `flycheck` support in python buffers, look for the function
`dotspacemacs/config` in your dotfile and add the following code:
```elisp
(remove-hook 'python-mode-hook 'flycheck-mode)
```
**Hint** to know the name of the major-mode of the current buffer press:
<kbd>SPC h d v major-mode RET</kbd>
## Disable company for a specific major-mode
It may be handy to disable `company` for a given mode if you plan on
configuring `auto-complete` instead. On easy way to do it is to use
the macro `spacemacs|disable-company` in the function
`dotspacemacs/config` of your dotfile. The following snippet disables
company for `python-mode`:
```elisp
(spacemacs|disable-company python-mode)
```
## Change special buffer rules
To change the way spacemacs marks buffers as useless, you can customize
`spacemacs-useless-buffers-regexp` which marks buffers matching the regexp
as useless. The variable `spacemacs-useful-buffers-regexp` marks buffers
matching the regexp as useful buffers. Both can be customized the same way.
Examples:
```elisp
;; Only mark helm buffers as useless
(setq spacemacs-useless-buffers-regexp '("\\*helm\.\+\\*"))
;; Marking the *Messages* buffer as useful
(push "\\*Messages\\*" spacemacs-useful-buffers-regexp)
```