Skip to content


Auto close results #16

wants to merge 2 commits into from

2 participants


I've modified full ack to:

  • automatically close the results window when there are no results
  • close the results window after browsing to a result using ack-find-match

I find it a little annoying to have an empty results window left open when the minibuffer will tell me there were 0 results. Also I seldom want to look at alternative results after browsing to the one I want.

I don't know if either of these are generally desired behaviour. I know that some emacs users prefer to have a fixed window split where all temporary results oriented buffers are displayed and I'm not sure how this would interact with that.



If the user has multiple windows open, this will indeed mess with his/her existing windows. I don't think that's okay.
Can you modify the patch to only close windows if full-ack has actually created them? (Or maybe you just want to set ack-display-buffer to 'after to not show empty results?)

And I don't think "ack-find-match" should be changed. There should be an additional command "ack-find-match-and-kill-window" that users can remap if they prefer it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 11, 2012
  1. @elucid

    don't leave the results window open when there aren't any matches

    elucid committed
    note: "Ack finished with 0 matches" will still show in the minibuffer
  2. @elucid
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 2 deletions.
  1. +3 −2 full-ack.el
5 full-ack.el
@@ -333,7 +333,7 @@ This can be used in `ack-root-directory-functions'."
(if (> c 0)
(when (eq ack-display-buffer 'after)
(display-buffer (current-buffer)))
- (kill-buffer (current-buffer)))
+ (kill-buffer-and-window))
(message "Ack finished with %d match%s" c (if (eq c 1) "" "es"))))))
(defun ack-filter (proc output)
@@ -699,7 +699,8 @@ DIRECTORY is the root directory. If called interactively, it is determined by
(marker-buffer marker))
(compilation-goto-locus msg marker end)
(set-marker msg nil)
- (set-marker end nil))))
+ (set-marker end nil)
+ (delete-other-windows))))
;;; ack-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Something went wrong with that request. Please try again.