GNU bug report logs - #33871
27.0.50; Revert Dired window saved in window configuration

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Tue, 25 Dec 2018 21:43:01 UTC

Severity: minor

Found in version 27.0.50

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Juri Linkov <juri <at> linkov.net>
Cc: 33871 <at> debbugs.gnu.org
Subject: bug#33871: 27.0.50; Revert Dired window saved in window configuration
Date: Wed, 21 Feb 2024 10:05:11 +0100
> Thanks.  Is it possible to avoid 'with-selected-window' in other hooks?
> Maybe something like this:
>
> (setq-default window-use-context-function
>                (lambda (w context)
>                  (let ((point (window-point w)))
>                    (with-current-buffer (window-buffer w)

I suppose that in the general case you need a

(save-excursion

from here

>                      (goto-char point)
>                      (when-let ((f (alist-get 'front-context-string context)))
>                        (search-forward f (point-max) t)
>                        (goto-char (match-beginning 0)))
>                      (when-let ((r (alist-get 'rear-context-string context)))
>                        (search-backward r (point-min) t)
>                        (goto-char (match-end 0)))
>                      (setq point (point)))

till here

)

>                  (set-window-point w point))))


Probably something similar is needed for dired, for example to handle
the case where its buffer is simultaneously shown in two windows with
their points on different lines.

martin




This bug report was last modified 1 year and 102 days ago.

Previous Next


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