Wilfred / ag.el

An Emacs frontend to The Silver Searcher
http://agel.readthedocs.org/en/latest/
524 stars 61 forks source link

Quickly kill buffer #62

Closed holocronweaver closed 10 years ago

holocronweaver commented 10 years ago

I would like a quick hotkey to kill the ag buffer open in the current window. Note this is quite different from ag-kill-all-buffers which kills all buffers, not just the active one.

The rationale is much of the time I have multiple ag.el buffers open and want to keep all but the one I am currently on.

Preferably this hotkey would be as simple as 'q' to quit. Maybe 'k' for kill?

Wilfred commented 10 years ago

Just to confirm, what you'd like is a keybinding for ag-kill-other-buffers?

holocronweaver commented 10 years ago

Sorry, I don't think I worded my request well.

I'd like a (kill-buffer nil) plus a keybinding of k, so with the press of k my active *ag* buffer is killed. This may be a naive approach as my elisp-fu is weak.

Wilfred commented 10 years ago

I don't quite follow I'm afraid. How would this differ from pressing q in the active *ag* buffer (this already works)?

holocronweaver commented 10 years ago

On my installed version of ag.el (0.43), pressing q returns to the window to previous buffer, leaving the *ag* buffer in the buffer list. I can switch back to the buffer and continue using it. To kill it, I have to use kill-buffer.

What I would like is for the buffer to be killed so it is no longer present in the buffer list.

Wilfred commented 10 years ago

Ooh, I'd never noticed that. So this is just a matter of binding k to kill-buffer. Agreed this would be useful.

holocronweaver commented 10 years ago

Oh! I thought that was by design because it is useful when I will be shortly returning to the search buffer. I'd personally like both the current behavior and the suggested change if possible, each with their own hotkeys.

Wilfred commented 10 years ago

Fixed in the above pull request.