Skip to content

Instantly share code, notes, and snippets.

@ionrock
Created April 23, 2013 18:06
Show Gist options
  • Save ionrock/5445934 to your computer and use it in GitHub Desktop.
Save ionrock/5445934 to your computer and use it in GitHub Desktop.
Select some code and open that code in another frame for reference.
(defun narrow-to-region-indirect (start end)
"Restrict editing in this buffer to the current region, indirectly."
(interactive "r")
(let ((buf (clone-indirect-buffer nil nil)))
(with-current-buffer buf
(narrow-to-region start end))
(select-frame (make-frame))
(switch-to-buffer buf)))
(global-set-key (kbd "C-c \"") 'narrow-to-region-indirect)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment