* Narrowing same buffer to different regions in two windows
@ 2004-10-20 15:32 Roy Smith
2004-10-20 15:38 ` Stefan Monnier
2004-10-20 15:56 ` Drew Adams
0 siblings, 2 replies; 5+ messages in thread
From: Roy Smith @ 2004-10-20 15:32 UTC (permalink / raw)
I've got a file with two large sections of very similar text that I
want to examine and compare (it's C++, and a previous author did a
"cut, paste, and modify" job instead of refactoring). What I'd like
to do is split the screen into two windows, and do narrow-to-region in
each window, ending up with each window looking at a distinct section
of the file.
The problem is, narrowing works per-buffer, not per-window. Is there
anyway to do what I want?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Narrowing same buffer to different regions in two windows
2004-10-20 15:32 Roy Smith
@ 2004-10-20 15:38 ` Stefan Monnier
2004-10-20 15:56 ` Drew Adams
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2004-10-20 15:38 UTC (permalink / raw)
> I've got a file with two large sections of very similar text that I
> want to examine and compare (it's C++, and a previous author did a
> "cut, paste, and modify" job instead of refactoring). What I'd like
> to do is split the screen into two windows, and do narrow-to-region in
> each window, ending up with each window looking at a distinct section
> of the file.
M-x make-indirect-buffer RET
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Narrowing same buffer to different regions in two windows
2004-10-20 15:32 Roy Smith
2004-10-20 15:38 ` Stefan Monnier
@ 2004-10-20 15:56 ` Drew Adams
1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2004-10-20 15:56 UTC (permalink / raw)
Another tool to try: `M-x compare-windows':
"Compare text in current window with text in next window.
Compares the text starting at point in each window,
moving over text in each one as far as they match.
This command pushes the mark in each window
at the prior location of point in that window.
If both windows display the same buffer,
the mark is pushed twice in that buffer:
first in the other window, then in the selected window.
A prefix arg means ignore changes in whitespace.
The variable `compare-windows-whitespace' controls how whitespace is
skipped.
If `compare-ignore-case' is non-nil, changes in case are also ignored."
-----Original Message-----From: Roy Smith
I've got a file with two large sections of very similar text that I
want to examine and compare (it's C++, and a previous author did a
"cut, paste, and modify" job instead of refactoring). What I'd like
to do is split the screen into two windows, and do narrow-to-region in
each window, ending up with each window looking at a distinct section
of the file.
The problem is, narrowing works per-buffer, not per-window. Is there
anyway to do what I want?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Narrowing same buffer to different regions in two windows
[not found] <mailman.4238.1098288305.2017.help-gnu-emacs@gnu.org>
@ 2004-10-20 17:54 ` Roy Smith
2004-10-20 18:21 ` Drew Adams
0 siblings, 1 reply; 5+ messages in thread
From: Roy Smith @ 2004-10-20 17:54 UTC (permalink / raw)
Compare-windows is neat, but it's not quite the same as narrowing.
I'm in one window and see a variable "foo". I want to see if the
function in the other window also has "foo", so I go to the other
window and do "C-S foo". Only with narrowing will I be sure that the
foo I found is in the function of interest.
In article <mailman.4238.1098288305.2017.help-gnu-emacs@gnu.org>,
Drew Adams <drew.adams@oracle.com> wrote:
>Another tool to try: `M-x compare-windows':
>
>"Compare text in current window with text in next window.
>Compares the text starting at point in each window,
>moving over text in each one as far as they match.
>
>This command pushes the mark in each window
>at the prior location of point in that window.
>If both windows display the same buffer,
>the mark is pushed twice in that buffer:
>first in the other window, then in the selected window.
>
>A prefix arg means ignore changes in whitespace.
>The variable `compare-windows-whitespace' controls how whitespace is
>skipped.
>If `compare-ignore-case' is non-nil, changes in case are also ignored."
>
>-----Original Message-----From: Roy Smith
>I've got a file with two large sections of very similar text that I
>want to examine and compare (it's C++, and a previous author did a
>"cut, paste, and modify" job instead of refactoring). What I'd like
>to do is split the screen into two windows, and do narrow-to-region in
>each window, ending up with each window looking at a distinct section
>of the file.
>
>The problem is, narrowing works per-buffer, not per-window. Is there
>anyway to do what I want?
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Narrowing same buffer to different regions in two windows
2004-10-20 17:54 ` Narrowing same buffer to different regions in two windows Roy Smith
@ 2004-10-20 18:21 ` Drew Adams
0 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2004-10-20 18:21 UTC (permalink / raw)
Save the file with a different name, so you can open it in two different
buffers. Narrow each buffer to the region you want. Then use
ediff-buffers. - Drew
-----Original Message-----From: Roy Smith
Compare-windows is neat, but it's not quite the same as narrowing.
I'm in one window and see a variable "foo". I want to see if the
function in the other window also has "foo", so I go to the other
window and do "C-S foo". Only with narrowing will I be sure that the
foo I found is in the function of interest.
>I've got a file with two large sections of very similar text that I
>want to examine and compare (it's C++, and a previous author did a
>"cut, paste, and modify" job instead of refactoring). What I'd like
>to do is split the screen into two windows, and do narrow-to-region in
>each window, ending up with each window looking at a distinct section
>of the file.
>
>The problem is, narrowing works per-buffer, not per-window. Is there
>anyway to do what I want?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-10-20 18:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.4238.1098288305.2017.help-gnu-emacs@gnu.org>
2004-10-20 17:54 ` Narrowing same buffer to different regions in two windows Roy Smith
2004-10-20 18:21 ` Drew Adams
2004-10-20 15:32 Roy Smith
2004-10-20 15:38 ` Stefan Monnier
2004-10-20 15:56 ` Drew Adams
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.