GNU bug report logs - #32790
27.0.50; point jumps unexpectedly after delete-window

Previous Next

Package: emacs;

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

Date: Thu, 20 Sep 2018 23:57:01 UTC

Severity: minor

Found in version 27.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: 32790 <at> debbugs.gnu.org
Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window
Date: Mon, 22 Oct 2018 11:07:25 +0200
> other-frame-window is limited to the coarse choice, i.e. to display the
> buffer in a random window on the same frame, or in another frame.

It would indeed be nice to fix that there in some way.

> Whereas the needed feature is to allow the user to point out exactly
> in which window the buffer should be displayed.  This can be achieved
> with something like this:
>
> (let ((modifiers '(hyper)))
>    (dolist (key '(left right up down))
>      (define-key global-map (vector (append modifiers (list key)))
>                  'display-buffer-directionally)))
>
> (defun display-buffer-directionally ()
>    "Specify in which direction the buffer should be displayed."
>    (interactive "P")
>    (let* ((dir (event-basic-type (aref (this-command-keys) 0)))
> 	 (win (window-in-direction dir)))
>      (unless win
>        (setq win (split-window nil nil dir)))
>      (let ((hook (list 'lambda)))
>        (setcdr hook `((window)
> 		     (when (eq window ,win)
> 		       ;; When a new buffer was displayed in that window,
> 		       ;; we can restore a previous value.
> 		       (setq display-buffer-overriding-action
> 			     ',display-buffer-overriding-action)
> 		       (remove-hook 'window-state-change-functions ',hook))))
>        (add-hook 'window-state-change-functions hook))
>      (setq display-buffer-overriding-action
> 	  `((lambda (buffer alist)
> 	      (window--display-buffer buffer ,win 'reuse alist))))))
>
> Do you think conceptually this is the right direction of development?

Good idea.  But IIUC we can't use 'hyper' in Emacs because it is not
supposed to be generally present and must be bound to a key first.  So
we'd need some other mechanism.

martin




This bug report was last modified 5 years and 235 days ago.

Previous Next


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