Add commands to add/remove marked buffers to/from persp via ibuffer
See [discussion](https://github.com/nex3/perspective-el/issues/54#issuecomment-915592609) in #54.
This allows to easily add and remove multiple buffers to/from a perspective. These functions have to be called from an ibuffer-buffer, after some buffers have been marked (e.g. via `m`).
I hope I have done the declare-function, the error-raising, autoloading etc. correctly. I'm used to writing elisp for my own emacs config, but haven't done much coding for packages yet, so these are things new to me, but I just tried to do the same as the existing functions.
## Potential TODO's
- [ ] Maybe add some default keybindings, a keymap or something like this for better ibuffer integration. Alternatively, just add an example configuration to the README.
- [ ] In any case, add some documentation for the functions to the README, e.g. in an _"Add/remove multiple buffers at once"_ section.
- [ ] Think whether we want to remove the marks after the buffers have been successfully added.
- [ ] When calling `persp-ibuffer-remove-marked-buffers` after `persp-ibuffer`, with an ibuffer buffer filtered to the current perspective, we could remove the removed buffers from the ibuffer view. This should not happen from an unfiltered ibuffer showing all perspective buffers.
- [ ] The commands work only in ibuffer, outside ibuffer they result in the error
```
ibuffer-map-lines: Assertion failed: (derived-mode-p 'ibuffer-mode)
```
Should we raise a custom user-error if the commands are called from outside ibuffer or is passing the assertion enough?
合并状态:未合并 关闭于 2023-10-05 4 条评论