[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: |
Wed, 31 Oct 2018 23:20:13 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) |
>> Ok, after a small change it handles also C-g:
>
> I forgot (or never learned) how to use it. Can you please include an
> example so people can try it.
An example is this:
(let ((modifiers '(shift meta)))
(dolist (key '(left right up down ?0))
(define-key global-map (vector (append modifiers (list key)))
'display-buffer-directionally)))
>> ;; But don't remove immediately after
>> ;; adding the hook by the same command.
>> (eq this-command ',this-command))
>
> Can you give the rationale for the latter? I don't grok it.
When display-buffer-directionally is called, it adds the hook
to post-command-hook, and when display-buffer-directionally finishes,
post-command-hook is called, and immediately removes itself from
post-command-hook. This condition ensures that the hook is removed
only when post-command-hook is called after a next command finishes
(while the minibuffer is inactive).
>> (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)))))))
>
> 'reuse' holds only for the ?0 case. When we split, the third argument
> should be 'window'.
I noticed that when replaced with
(window--display-buffer buffer ,win ',(if (eq dir ?0) 'reuse 'window) alist)
then 'window means that killing the buffer will delete its window.
Another observation is that switch-to-buffer is unaffected by this command.
- 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/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, 2018/10/30
- 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 <=