[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#32790: 27.0.50; point jumps unexpectedly after delete-window
From: |
Juri Linkov |
Subject: |
bug#32790: 27.0.50; point jumps unexpectedly after delete-window |
Date: |
Tue, 30 Oct 2018 23:42:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>>> Moreover, using 'post-command-hook' would automatically fix any
>>> problems when quitting an S-M-up action. I see no way to catch
>>> quitting via a state change of windows.
>>
>> What do you mean by quitting an S-M-up action? minibuffer-exit?
>
> Let's say anything C-g does. I'm not sure whether we can catch that
> always via 'minibuffer-exit-hook' though. But it should not harm to
> remove the overriding action in that case as well.
Ok, after a small change it handles also C-g:
(defun display-buffer-directionally ()
"Specify in which direction the buffer should be displayed.
Arrows show the direction. Mod-0 forces to display in the same window."
(interactive)
(let* ((dir (event-basic-type (aref (this-command-keys) 0)))
(win (if (eq dir ?0)
(selected-window)
(or (window-in-direction dir)
(split-window nil nil dir)))))
(let ((hook (list 'lambda)))
(setcdr hook `(()
(unless (or
;; Remove the hook immediately
;; after exiting the minibuffer.
(> (minibuffer-depth) 0)
;; But don't remove immediately after
;; adding the hook by the same command.
(eq this-command ',this-command))
(setq display-buffer-overriding-action
',display-buffer-overriding-action)
(remove-hook 'post-command-hook ',hook))))
(add-hook 'post-command-hook hook))
(setq display-buffer-overriding-action
`((lambda (buffer alist)
(unless (> (minibuffer-depth) 0)
(window--display-buffer buffer ,win 'reuse alist)))))))
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, (continued)
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/24
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, Juri Linkov, 2018/10/25
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/26
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, Juri Linkov, 2018/10/27
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/28
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, Juri Linkov, 2018/10/28
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/29
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/29
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, Juri Linkov, 2018/10/29
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/30
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window,
Juri Linkov <=
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, martin rudalics, 2018/10/31
- bug#32790: 27.0.50; point jumps unexpectedly after delete-window, Juri Linkov, 2018/10/31