unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Narrowing
@ 2003-04-03  6:28 Dr. F.C.Caner
  2003-04-03 12:08 ` Narrowing Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Dr. F.C.Caner @ 2003-04-03  6:28 UTC (permalink / raw)


Hello everyone,

I have a file where I have several routines. Recently I wanted to
split the Emacs window into two parts by C-x 2, and tried to
narrow-to-region where region was one of the routines in one window,
and another one in the other window.

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?

Thanks in advance,

FCC

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
  2003-04-03  6:28 Narrowing Dr. F.C.Caner
@ 2003-04-03 12:08 ` Johan Bockgård
  2003-04-03 21:34   ` Narrowing Greg Hill
       [not found]   ` <mailman.4084.1049406356.21513.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Johan Bockgård @ 2003-04-03 12:08 UTC (permalink / raw)


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'.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
  2003-04-03 12:08 ` Narrowing Johan Bockgård
@ 2003-04-03 21:34   ` Greg Hill
       [not found]   ` <mailman.4084.1049406356.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Greg Hill @ 2003-04-03 21:34 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
       [not found]   ` <mailman.4084.1049406356.21513.help-gnu-emacs@gnu.org>
@ 2003-04-03 22:05     ` Stefan Monnier
  2003-04-03 23:30       ` Narrowing Greg Hill
       [not found]       ` <mailman.4092.1049412991.21513.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Stefan Monnier @ 2003-04-03 22:05 UTC (permalink / raw)


>>>>> "Greg" == Greg Hill <ghill@synergymicro.com> writes:
> (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)) )

Check out clone-indirect-buffer.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
  2003-04-03 22:05     ` Narrowing Stefan Monnier
@ 2003-04-03 23:30       ` Greg Hill
       [not found]       ` <mailman.4092.1049412991.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 7+ messages in thread
From: Greg Hill @ 2003-04-03 23:30 UTC (permalink / raw)


At 5:05 PM -0500 4/3/03, Stefan Monnier wrote:
>Check out clone-indirect-buffer.

Thanks.  Now it's:

(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")
   (clone-indirect-buffer-other-window (current-buffer))
   (if mark-active (narrow-to-region start end)) )

The clone-... functions (I see there's four of them) oughta be in the 
Reference Manual, but they're not.  One of these days I'll have to 
take a closer look at simple.el and see what else I've missed.

--Greg

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
       [not found]       ` <mailman.4092.1049412991.21513.help-gnu-emacs@gnu.org>
@ 2003-04-04 15:28         ` Stefan Monnier
  2003-04-04 15:42           ` Narrowing Johan Bockgård
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2003-04-04 15:28 UTC (permalink / raw)


> The clone-... functions (I see there's four of them) oughta be in the
> Reference Manual, but they're not.  One of these days I'll have to take
> a closer look at simple.el and see what else I've missed.

It's in C-h N which is always a good thing to read.


        Stefan

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Narrowing
  2003-04-04 15:28         ` Narrowing Stefan Monnier
@ 2003-04-04 15:42           ` Johan Bockgård
  0 siblings, 0 replies; 7+ messages in thread
From: Johan Bockgård @ 2003-04-04 15:42 UTC (permalink / raw)


"Stefan Monnier" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:

>> The clone-... functions (I see there's four of them) oughta be in the
>> Reference Manual, but they're not.  One of these days I'll have to take
>> a closer look at simple.el and see what else I've missed.
>
> It's in C-h N which is always a good thing to read.

I see it is in the Emacs manual, too:

(info "(emacs)Indirect Buffers")

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-04-04 15:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-03  6:28 Narrowing Dr. F.C.Caner
2003-04-03 12:08 ` Narrowing Johan Bockgård
2003-04-03 21:34   ` Narrowing Greg Hill
     [not found]   ` <mailman.4084.1049406356.21513.help-gnu-emacs@gnu.org>
2003-04-03 22:05     ` Narrowing Stefan Monnier
2003-04-03 23:30       ` Narrowing Greg Hill
     [not found]       ` <mailman.4092.1049412991.21513.help-gnu-emacs@gnu.org>
2003-04-04 15:28         ` Narrowing Stefan Monnier
2003-04-04 15:42           ` Narrowing Johan Bockgård

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).