Subject: bug#12708: 24.1; M-x display-time-world "q" close window

From: Juri Linkov <[email-masked]>
Date: Sat, 27 Oct 2012 14:45:18 +0300

>> (defun occur-mode-goto-occurrence-kill-buffer ()
>>   "Go to the occurrence the current line describes, and kill the Occur buffer."
>>   (interactive)
>>   (let ((buf (current-buffer))
>>         (pos (occur-mode-find-occurrence)))
>>     (switch-to-buffer-other-window (marker-buffer pos))
>>     (goto-char pos)
>>     (kill-buffer buf)
>>     (run-hooks 'occur-mode-find-occurrence-hook)))
>
> Why don't you quit the *Occur* buffer window first and do a simple
> `pop-to-buffer' afterwards?

I tried it to be closer to the workflow of
`occur-mode-goto-occurrence-other-window'.
But your recipe would work as well.

> BTW, I find bindings like
>
>     (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence)
>     (define-key map "\C-m" 'occur-mode-goto-occurrence)
>     (define-key map "o" 'occur-mode-goto-occurrence-other-window)
>
> very confusing.

You might find it more confusing when I tell you that in ~/.emacs
I bound `occur-mode-goto-occurrence-kill-buffer' to C-RET ;-)

>> In addition to this, it could also use the action
>> `display-buffer-below-selected' (like in dired),
>
> I think `display-buffer-at-bottom' would suit better.  But this needs
> some way to say bottom-left, bottom-center, bottom-right.  I'm not yet
> sure how to do that best.

Shouldn't `display-buffer-at-bottom' create a window with the width of
the frame's full width?  In this case, left/center/right are not needed.