Skip to content

Instantly share code, notes, and snippets.

@lawlist
Last active June 28, 2019 05:35
Show Gist options
  • Save lawlist/f470725099dc5f9c82cb0f3ad4b74d9e to your computer and use it in GitHub Desktop.
Save lawlist/f470725099dc5f9c82cb0f3ad4b74d9e to your computer and use it in GitHub Desktop.
Take control of pop-to-buffer.
(require 'cl)
(defun my-pop-to-buffer (buffer &optional action norecord)
(message "buffer: %s | action: %s | norecord: %s" buffer action norecord))
(defun test-fn ()
"Doc-string."
(interactive)
(cl-letf (((symbol-function 'pop-to-buffer) #'my-pop-to-buffer))
(pop-to-buffer (current-buffer))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment