Is it possible to have new buffers created by a spesific command (vc-diff for example) use the same viewable area as the current buffer?

Currently it creates a split window, which I need to manually close after using the buffer and deleting it.

  • Same problem here as in your other thread -- i.e., the offending code is (pop-to-buffer (current-buffer)) within vc-diff-internal -- see comments in related thread for possible solutions: emacs.stackexchange.com/questions/29665/… – lawlist Dec 29 '16 at 19:24
  • You may wish to consider asking a specific question: "How do I force (pop-to-buffer BUFFER) to temporarily behave like (set-window-buffer (selected-window) BUFFER)?" FYI: As far as I can tell, your question has nothing to do with frame. – lawlist Dec 29 '16 at 19:34
  • Ah, I thought this was the correct terminology, updated the question. At the time of asking I wasn't aware of pop-to-buffer. I think its good to word questions from a user perspective when their not specifically about internal API's. – ideasman42 Dec 30 '16 at 0:44

There is a global option to prevent splits from being opened:

(setq pop-up-windows nil)

When writing scripts you can locally assign this which won't apply outside the scope of the function, eg:

(defun vc-root-diff-fullscreen ()
  "Open a diff of the repository in the current frame."
  (let ((pop-up-windows nil))
    (vc-root-diff nil)))
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.