GNU bug report logs - #33458
27.0.50; dired loses position when reverted from outside place

Previous Next

Package: emacs;

Reported by: v88m <at> posteo.net

Date: Wed, 21 Nov 2018 20:46:01 UTC

Severity: minor

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #44 received at 33458 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: Stephen Berman <stephen.berman <at> gmx.net>, 33458 <at> debbugs.gnu.org,
 v88m <at> posteo.net
Subject: Re: bug#33458: 27.0.50;
 dired loses position when reverted from outside place
Date: Wed, 28 Nov 2018 09:35:00 +0100
> While 'isearch-push-state-function' could be used for example to save
> and restore window start positions on returning to previous search hits:
>
> (setq isearch-push-state-function
>        (lambda ()
>          `(lambda (cmd)
>             (when isearch-success
>               (set-window-start nil ,(window-start))))))
>
> wouldn't it be possible to use something like this to
> restore Dired point from the saved dired-filename.

As I mentioned earlier, dired is special because file names are
unique.  We just have to code it.

> And in non-dired buffers maybe at least when a window is restored from
> the window configuration or from the window state, then simply restore
> window point from the saved point when the saved point-marker is
> invalidated (its value is 1).  Currently window-state-get when not used
> with the WRITABLE arg, saves only point-marker, but maybe should save
> both: point and point-marker, for the case when point-marker invalidates
> after the buffer is reverted.

I still think that going to a wrong position in the middle of the
buffer occasionally is worse then predictably going to point-min.

> See for example how point is preserved in an intelligent way at the end
> of revert-buffer-insert-file-contents--default-function that uses
> insert-file-contents to preserve some marker positions.

You mean the 'restore_window_points' mechanism?  Then we would have to
make its information available in Lisp.  Certainly worthwhile.

martin




This bug report was last modified 4 years and 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.