GNU bug report logs - #47300
delete-window to select window with same position

Previous Next

Package: emacs;

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

Date: Sun, 21 Mar 2021 21:15:02 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 28.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: Lars Ingebrigtsen <larsi <at> gnus.org>, 47300 <at> debbugs.gnu.org
Subject: bug#47300: delete-window to select window with same position
Date: Mon, 7 Jun 2021 09:35:07 +0200
> The customization interface could use only functions that could be
> first called before deletion, then the customized function returns
> a lambda that will be called after deletion.

Only specialized users would be able to write such a function. And they
can use the 'delete-window' parameter for that purpose.

> Then for example
> all 'pos' logic could be moved to a separate function:
>
> (defun delete-window-pos ()
>    (let ((frame-selected-window-edges (window-edges frame-selected-window nil nil t))
>          (frame-selected-window-pos (nth 2 (posn-at-point nil frame-selected-window))))
>      (lambda ()
>        (let ((new-frame-selected-window
> 	     (window-at-pos
>                (+ (nth 0 frame-selected-window-edges)
>                   (car frame-selected-window-pos))
>                (+ (nth 1 frame-selected-window-edges)
>                   (cdr frame-selected-window-pos))
>                frame t)))
>          (and new-frame-selected-window
>               ;; Select window at WINDOW's position at point.
> 	     (set-frame-selected-window
>                frame new-frame-selected-window))))))

I'm completely lost with the scoping of that first `let'.  So at least
for a poor soul like me such a solution would not be feasible at all.

martin




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

Previous Next


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