2

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.

ideasman42
  • 8,786
  • 1
  • 32
  • 114
  • 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: http://emacs.stackexchange.com/questions/29665/how-to-delete-a-diff-buffer-after-running-jump-to-source – 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 00:44

1 Answers1

3

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."
  (interactive)
  (let ((pop-up-windows nil))
    (vc-root-diff nil)))
ideasman42
  • 8,786
  • 1
  • 32
  • 114