all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Link between two buffers
@ 2005-07-27  8:54 Marc Tfardy
  2005-07-27  8:57 ` Pascal Bourguignon
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Tfardy @ 2005-07-27  8:54 UTC (permalink / raw


Hi,

I have following problem:
I have two buffers in one frame, both contains the same file, but
showing diffrent parts of the file. The lines are longer than
the frame wide is, so I see always a part of the line (I set
the variable truncate-lines to t). My wish is, that when I move
the cursor horzintally in one line in one buffer the other buffer
move automaticly in the same direction by the same amount of characters,
in other words - both move parallel. How can I do it? Any ideas?

The bacground: my file contains a very wide table. The first
line of the table is the header, then follows many lines of data.
When I edit something far away from the header line, I don't see
the header and I don't know about what column I just edit.
My idea is, I open the file twice. The upper buffer show me
alway the header, the bottom buffer show me data, but both buffers
are linked, so I see alway the correct description in upper
buffer.


regards

Marc

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

* Re: Link between two buffers
  2005-07-27  8:54 Link between two buffers Marc Tfardy
@ 2005-07-27  8:57 ` Pascal Bourguignon
  2005-07-27 18:36   ` drkm
  0 siblings, 1 reply; 8+ messages in thread
From: Pascal Bourguignon @ 2005-07-27  8:57 UTC (permalink / raw


Marc Tfardy <m-t-o___CUT_IT___@web.de> writes:
> I have following problem:
> I have two buffers in one frame, both contains the same file, but
> showing diffrent parts of the file. The lines are longer than
> the frame wide is, so I see always a part of the line (I set
> the variable truncate-lines to t). My wish is, that when I move
> the cursor horzintally in one line in one buffer the other buffer
> move automaticly in the same direction by the same amount of characters,
> in other words - both move parallel. How can I do it? Any ideas?
>
> The bacground: my file contains a very wide table. The first
> line of the table is the header, then follows many lines of data.
> When I edit something far away from the header line, I don't see
> the header and I don't know about what column I just edit.
> My idea is, I open the file twice. The upper buffer show me
> alway the header, the bottom buffer show me data, but both buffers
> are linked, so I see alway the correct description in upper
> buffer.

There is follow-mode which does it vertically.  Perhaps you could hack
it to do it also horizontally, depending on how the windows are split
when starting it...


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we. -- Georges W. Bush

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

* Re: Link between two buffers
  2005-07-27  8:57 ` Pascal Bourguignon
@ 2005-07-27 18:36   ` drkm
  2005-07-27 20:14     ` Pascal Bourguignon
  0 siblings, 1 reply; 8+ messages in thread
From: drkm @ 2005-07-27 18:36 UTC (permalink / raw


Pascal Bourguignon writes:

> There is follow-mode which does it vertically.  Perhaps you could hack
> it to do it also horizontally, depending on how the windows are split
> when starting it...

  Why "depending on how the windows are split"?  'follow-mode'
could follow both horizontaly and verticaly, isn't it?

--drkm

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

* Re: Link between two buffers
  2005-07-27 18:36   ` drkm
@ 2005-07-27 20:14     ` Pascal Bourguignon
  2005-07-27 21:08       ` drkm
  2005-07-28 21:48       ` Marc Tfardy
  0 siblings, 2 replies; 8+ messages in thread
From: Pascal Bourguignon @ 2005-07-27 20:14 UTC (permalink / raw


drkm <usenet@fgeorges.org> writes:

> Pascal Bourguignon writes:
>
>> There is follow-mode which does it vertically.  Perhaps you could hack
>> it to do it also horizontally, depending on how the windows are split
>> when starting it...
>
>   Why "depending on how the windows are split"?  'follow-mode'
> could follow both horizontaly and verticaly, isn't it?

No it cannot follow horizontally.
Try it:

C-x 1 M-x toggle-truncate-lines RET C-x 2 M-x follow-mode RET C-u 100 x

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Kitty like plastic.
Confuses for litter box.
Don't leave tarp around.

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

* Re: Link between two buffers
  2005-07-27 20:14     ` Pascal Bourguignon
@ 2005-07-27 21:08       ` drkm
  2005-07-27 22:50         ` Tim X
  2005-07-28 21:48       ` Marc Tfardy
  1 sibling, 1 reply; 8+ messages in thread
From: drkm @ 2005-07-27 21:08 UTC (permalink / raw


Pascal Bourguignon writes:

> drkm <usenet@fgeorges.org> writes:

>> Pascal Bourguignon writes:

>>> There is follow-mode which does it vertically.  Perhaps you could hack
>>> it to do it also horizontally, depending on how the windows are split
>>> when starting it...

>>   Why "depending on how the windows are split"?  'follow-mode'
>> could follow both horizontaly and verticaly, isn't it?

> No it cannot follow horizontally.
> Try it:

  Yes, I know.  But if someone hack it to provide horizontal
following, what do you want to do "depending on how the windows
are split"?  Why don't just have 'follow-mode' following both
horizontally and vertically (in the case of horizontal following
available)?

--drkm

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

* Re: Link between two buffers
  2005-07-27 21:08       ` drkm
@ 2005-07-27 22:50         ` Tim X
  0 siblings, 0 replies; 8+ messages in thread
From: Tim X @ 2005-07-27 22:50 UTC (permalink / raw


drkm <usenet@fgeorges.org> writes:

> Pascal Bourguignon writes:
> 
> > drkm <usenet@fgeorges.org> writes:
> 
> >> Pascal Bourguignon writes:
> 
> >>> There is follow-mode which does it vertically.  Perhaps you could hack
> >>> it to do it also horizontally, depending on how the windows are split
> >>> when starting it...
> 
> >>   Why "depending on how the windows are split"?  'follow-mode'
> >> could follow both horizontaly and verticaly, isn't it?
> 
> > No it cannot follow horizontally.
> > Try it:
> 
>   Yes, I know.  But if someone hack it to provide horizontal
> following, what do you want to do "depending on how the windows
> are split"?  Why don't just have 'follow-mode' following both
> horizontally and vertically (in the case of horizontal following
> available)?
> 

It may be a little more difficult to get follow-mode to do that - but
must admit I need to think it out more - just seems to be something
bugging me and that feeling we have overlooked something - a window
has to be at least 1 line in height and at least 1 column in width. It
strikes me that its probably not too difficult to ensure the line the
cursor is on is visible in both windows, especially if you don't
really care about cursor position within the line - would doing the
same when you have a window which is just one column (and possible 1
row) in size be a problem?

 However, as the only reason the OP wants this behavior is so
that he can see the header line of the file at the same time as
viewing row data which is more than one window in distance from the
header line in his file, I'm thinking he is probably better off
forgetting about follow-mode and seeing how hard it would be to create
a mode which puts the first line into a header line (such as those
used in *info* mode) and allows the rest of the buffer window to be
used to scroll through the data file?

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

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

* Re: Link between two buffers
  2005-07-27 20:14     ` Pascal Bourguignon
  2005-07-27 21:08       ` drkm
@ 2005-07-28 21:48       ` Marc Tfardy
  1 sibling, 0 replies; 8+ messages in thread
From: Marc Tfardy @ 2005-07-28 21:48 UTC (permalink / raw


Pascal Bourguignon wrote:
> drkm <usenet@fgeorges.org> writes:
> 
> 
>>Pascal Bourguignon writes:
>>
>>
>>>There is follow-mode which does it vertically.  Perhaps you could hack
>>>it to do it also horizontally, depending on how the windows are split
>>>when starting it...
>>
>>  Why "depending on how the windows are split"?  'follow-mode'
>>could follow both horizontaly and verticaly, isn't it?
> 
> 
> No it cannot follow horizontally.

Hmmm... is it true that follow-mode works only with one file?
Can I not open two different files and link both together?

Marc

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

* Re: Link between two buffers
@ 2005-07-28 22:30 b.jc-emacs
  0 siblings, 0 replies; 8+ messages in thread
From: b.jc-emacs @ 2005-07-28 22:30 UTC (permalink / raw



On: 28 Jul 2005, Tim X <timx@spamto.devnul.com> wrote:

> However, as the only reason the OP wants this behavior is so
> that he can see the header line of the file at the same time as
> viewing row data which is more than one window in distance from
> the header line in his file, I'm thinking he is probably better
> off forgetting about follow-mode and seeing how hard it would
> be to create a mode which puts the first line into a header
> line (such as those used in *info* mode) and allows the rest of
> the buffer window to be used to scroll through the data file?

I have a dim recollection from a time long ago (6 or more years,
probably in emacs 18) of using emacs to do what the OP described.
Unfortunately I do not remember exactly how I did it.  If my
memory serves correctly it involved selecting a line and then
doing something simple that told emacs not to scroll the line off
the page.  It seems to me that it was something like setting a
margin variable.  I did some searching in info and did an apropos
on variables but could not find anything.  Perhaps some one on
the list can recall if there ever was such a capability.

__
J_)
C_)ingham

______________________________________________________________________
Surfing so fast you won't believe it's not broadband!
Try NetZero HiSpeed 3G.
Visit http://www.netzero.com to sign up today!

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

end of thread, other threads:[~2005-07-28 22:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-27  8:54 Link between two buffers Marc Tfardy
2005-07-27  8:57 ` Pascal Bourguignon
2005-07-27 18:36   ` drkm
2005-07-27 20:14     ` Pascal Bourguignon
2005-07-27 21:08       ` drkm
2005-07-27 22:50         ` Tim X
2005-07-28 21:48       ` Marc Tfardy
  -- strict thread matches above, loose matches on Subject: below --
2005-07-28 22:30 b.jc-emacs

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.