[climacs-devel] Point - buffer or pane? (plus syntax resetting)

Robert Strandh strandh at labri.fr
Sat May 7 07:50:43 UTC 2005


Hello, 

John Q Splittist writes:
 > Currently point is kept in the climacs-pane object. While this means one 
 > can have multiple panes on the same buffer with different points, it 
 > does mean that switching buffers in the same pane loses the point 
 > information, so point is always reset.

Actually, the good way of doing it is to have a point both in the pane
and in the buffer.  When a pane is about to change the buffer on
display, the point is saved in the old buffer and loaded from the new
buffer. 

 > Below are some changes to pane.lisp that move point to the 
 > climacs-buffer object. This has the effect of _not_ resetting point when 
 > doing a com-switch-to-buffer. Of course, when you com-split-window-*, 
 > there is only one point for each of the panes, so the cursors follow one 
 > another. Interesting redisplay features can be observed.

This behavior is not acceptable for many reasons.  I commonly use two
windows displaying different parts of the same buffer and define
macros that rely on point being different in the two. 

 > Presumably the right thing to do is have one point (and mark, and 
 > perhaps other things - isearch, query-replace?) per buffer per pane. On 
 > a com-split-window the new pane could be given some kind of proxy 
 > climacs-buffer pointing to the original, but with its own state.

Split window should duplicate the point of the window, but then they
should be independent.  Switching to a different buffer should reload
point from the buffer. 

Take care, 
-- 
Robert Strandh

---------------------------------------------------------------------
Greenspun's Tenth Rule of Programming: any sufficiently complicated C
or Fortran program contains an ad hoc informally-specified bug-ridden
slow implementation of half of Common Lisp.
---------------------------------------------------------------------



More information about the climacs-devel mailing list