emacs-purpose
emacs-purpose copied to clipboard
Purpose mode and ivy-switch-buffer
I use ivy-switch-buffer (rather than ido or helm), and when I activate purpose, C-x b invokes ido-switch-buffer. Is it possible to use Ivy's own command instead?
Are you sure C-x b invokes ido-switch-buffer? Purpose binds C-x b to purpose-switch-buffer-overload in purpose-mode-map, not ido-switch-buffer. You can unbind it with (define-key purpose-mode-map (kbd "C-x b") nil), and then Emacs will use the normal C-x b binding. I assume that you or Ivy bind C-x b to ivy-switch-buffer, so that should give you Ivy's own command.
If you want to use purpose-switch-buffer (because it offers only buffers with the same purpose) with an Ivy prompt, you can change the value of purpose-preferred-prompt. From the documentation of purpose-preferred-prompt:
Available options are: 'auto - use IDO when
ido-mode' is enabled, otherwise Helm whenhelm-mode' is enabled, otherwise use default Emacs prompts; 'ido - use IDO; 'helm - use Helm; 'vanilla - use default Emacs prompts.
If you (setq purpose-preferred-prompt 'vanilla), purpose should use the default completing read function. If you have ivy-mode enabled, the default should give you an Ivy prompt.
Closing this issue due to no response. Feel free to comment/reopen if necessary.
@bmag This didn't work for me, btw. After your recommended setting, purpose still invokes ido rather than ivy.
@jwiegley I'm not sure what exactly didn't work for you.
- is
ivy-modeturned on? - is
purpose-modeturned on? - what's the value of
purpose-preferred-prompt? - what's bound to
C-x b? (I mean what's the actual output ofC-h k C-x b) - did you change the binding of
C-x binpurpose-mode-map?
Please note that while purpose-switch-buffer with purpose-preferred-prompt set to vanilla and ivy-mode enabled should give an Ivy prompt, it still isn't the same as ivy-switch-buffers. It will just be the generic prompt Ivy gives to commands.
I'm quite busy this week (and the past one), so I could be slow to respond.
Having same issue, I'm using spacemacs-purpose layer.
C-h k C-x b gives: C-x b runs the command ivy-switch-buffer (found in ivy-mode-map), which is an interactive autoloaded compiled Lisp function in ‘ivy.el’.
It is bound to C-SPC b b, C-x b,
(ivy-switch-buffer)
Switch to another buffer.
For SPC r b it is: C-SPC r b runs the command ivy-purpose-switch-buffer-with-purpose (found in global-map), which is an interactive autoloaded compiled Lisp function in ‘ivy-purpose.el’.
It is bound to C-SPC r b.
(ivy-purpose-switch-buffer-with-purpose &optional PURPOSE)
Switch to buffer, choose from buffers with purpose PURPOSE. PURPOSE defaults to the purpose of the current buffer.
Is there a way to make C-x b work like SPC r b without adding all the bindings manually?
The issue persists, but for anyone who comes by, @bmag 's code on the above referenced issue solves it somehow.
(define-key purpose-mode-map (kbd "C-x b") nil)
Thanks for this awesome package!
Is there a way to make C-x b work like SPC r b without adding all the bindings manually?
@AshKash no, not really.