a guest Sep 14th, 2018 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defadvice narrow-to-region  (around clone-when-narrowing-already-visible-buffer activate)
  2.   "Clone an indirect buffer when attempting to narrow the
  3. contents of buffer visible in more than one window."
  4.   (save-excursion
  5.     (when (> (length (get-buffer-window-list (current-buffer) nil nil)) 1)
  6.       (let ((cloned-buffer (clone-indirect-buffer nil t) ))
  7.         (switch-to-buffer cloned-buffer t)))
  8.     ad-do-it))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand