8

When looking up documentation with describe-function, Emacs display the docstring in a temporary help buffer. I want this buffer to replace current window.

So far, I've customized help-window-select but it only affect the focus.

Mathieu Marques
  • 1,953
  • 1
  • 13
  • 30

1 Answers1

11

If you don't like how help-window-select works you can simply use this code:

(add-to-list 'display-buffer-alist
             '("*Help*" display-buffer-same-window))

You can change "*Help*" with a regexp matching other buffer names if you want to also affect apropos windows or shell

Jules
  • 1,275
  • 7
  • 12
  • 1
    I'm on mobile now. If you're familiar with it, do you know if this conflicts with Helm's preview for candidates (accessible from `C-` and `C-`)? – Mathieu Marques May 24 '16 at 18:15
  • I don't use helm but I don't imagine this would affect anything. This code only affects in which window the buffer is opened. You can look at `display-buffer` for more details once you get off of mobile – Jules May 24 '16 at 18:28
  • It actually messes up with Helm. I have Helm set up so candidates show up on the left while current selected buffer or candidate preview shows up on the right side (I have set Helm to use only 2 windows at all time). With your solution 1. I lose my current buffer (that I previously had on the right) and 2. Helm uses one window only. Furthermore, previewing candidates split the frame horizontally. – Mathieu Marques May 29 '16 at 21:40
  • I've read your message a few times but I can't really understand whats happening. Could you post an image or something. If you've figured out a solution by now even better! – Jules Jun 01 '16 at 14:06
  • [Initial state](https://drive.google.com/open?id=0BwTSOByd3qSFOVBYc2FlZEgzSlk). [Here](https://drive.google.com/open?id=0BwTSOByd3qSFX3ZMbUNTamg3cVE) is how my Helm setup looks like. Candidates on the left, current window --- from when I originally ran the Helm command --- on the right. Now I [preview the candidate](https://drive.google.com/open?id=0BwTSOByd3qSFbXFYT2pVb2JuYkE). It shows in the right window. With your snippet, I only get one window with the Helm candidates. If I try and preview a candidate, my frame will be split vertically. Please let me know if this is still unclear. :-) – Mathieu Marques Jun 01 '16 at 14:15
  • Thats really weird, I have no clue, I'm sorry... On another note though do you use spaceline for your modeline, it looks really good? – Jules Jun 01 '16 at 14:44
  • [It's homemade](https://github.com/angrybacon/dotemacs/blob/master/dotemacs.org#17-mode-line) with [powerline](https://github.com/milkypostman/powerline). :-) I did borrow things from Spacemacs though (Spaceline wasn't a thing on its own back then). – Mathieu Marques Jun 01 '16 at 14:46
  • I just grabbed some of that stuff! Its beautiful thank you so much! Which I could have been of more help though ;) – Jules Jun 01 '16 at 15:10