help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Narrowing


From: Greg Hill
Subject: Re: Narrowing
Date: Thu, 3 Apr 2003 13:34:35 -0800

At 2:08 PM +0200 4/3/03, Johan Bockgård wrote:
ferhun_caner@yahoo.com (Dr. F.C.Caner) writes:

 However, I did not succeed in narrowing to two different parts of the
 same file in the two different windows.

 Any idea as to how this can be done?

Investigate `make-indirect-buffer'.

Didn't know about that.  Nice function.  Just added this to my
.emacs, with a convenient key binding.

(defun narrow-to-region-other-window (start end)
  "Make an indirect buffer for current buffer in \"other\" window.
Select it, and narrow it to the current region."
  (interactive "r")
  (switch-to-buffer-other-window
   (make-indirect-buffer
      (current-buffer)
      (concat (buffer-name) "<ind>")
      t ) )
  (if mark-active (narrow-to-region start end)) )

--Greg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]