Paste number 135818: narrow-to-region-indirect-buffer

Paste number 135818: narrow-to-region-indirect-buffer
Pasted by: grayswx
When:6 years, 2 weeks ago
Share:Tweet this! | http://paste.lisp.org/+2WSQ
Channel:None
Paste contents:
Raw Source | XML | Display As
(defun narrow-to-region-indirect-buffer (start end)
  (interactive "r")
  (with-current-buffer (clone-indirect-buffer 
                        (generate-new-buffer-name 
                         (concat (buffer-name) "-indirect-" 
                                 (number-to-string start) "-" 
                                 (number-to-string end)))
                        'display)
    (narrow-to-region start end)
    (deactivate-mark)
    (goto-char (point-min))))

;(define-key global-map (kbd "C-x n b") 'narrow-to-region-indirect-buffer)

(provide 'narrow-to-region-indirect-buffer)

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.