[Bug: 21.5-b29] point moved in dired when visiting file with local vars

Michael Sperber sperber at deinprogramm.de
Fri Oct 16 10:13:27 EDT 2009


Mike Kupfer <mike.kupfer at xemacs.org> writes:

> I have enable-local-variables set to 1.
>
> Suppose I'm in a dired buffer for that directory, and point is on the
> file Todo.api-sync.  I type f to visit that file.  I accept the local
> variables setting, then kill the buffer with C-x k.  I then move down a
> few lines and type f to visit Todo.cscope.  I again accept the local
> variables setting, then I enter C-x b RET to return to the dired buffer.
> Point is back at Todo.api-sync, when I would expect it to be at
> Todo.cscope.

Here's what happens:

- At the beginning, the Dired buffer is the current buffer.
- During the course of `find-file', there's a `set-buffer'.  This
  changes the semantics of `window-point' on the original Dired buffer,
  namely `window-point' returns the buffer's point when the window's
  buffer is the current buffer, and the contents of the internal point
  marker associated with the window otherwise.
- Ideally, the window's point marker should reflect the last point
  position when the current buffer is switched ...
- but it doesn't, namely the window position is the position of the
  first file, not the second in your test.
- The `current-window-configuration' used when asking the question looks
  at the incorrect window point, and later restores it.

The attached patch fixes it, but it seems awfully invasive, so I'm
holding off pushing it.  Comments welcome!

2009-10-16  Michael Sperber  <mike at xemacs.org>

	* buffer.c (set_buffer_internal): Synchronize the window point
	with the current point when switching to another buffer.


-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://calypso.tux.org/pipermail/xemacs-patches/attachments/20091016/58bd6522/attachment.pl 


More information about the XEmacs-Patches mailing list