GNU bug report logs -
#32790
27.0.50; point jumps unexpectedly after delete-window
Previous Next
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
Message #254 received at 32790 <at> debbugs.gnu.org (full text, mbox):
>>> I solved this general problem for myself with such advice:
>>>
>>> (advice-add 'switch-to-buffer :around
>>> (lambda (orig-fun &rest args)
>>> (let ((buffer (apply orig-fun args))
>>> (window (selected-window)))
>>> (switch-to-prev-buffer window)
>>> (pop-to-buffer-same-window buffer))))
>>>
>>> Then 'S-M-right C-h C-n' shows it in the right window.
>>
>> I don't grok it yet. What's the 'switch-to-prev-buffer' call for?
>
> switch-to-buffer switches the buffer in the selected window.
> switch-to-prev-buffer undoes this, and displays the same buffer
> in another window instead.
OK. This is a very gross hack that relies on 'switch-to-prev-buffer'
switching back to the "right" buffer. I can imagine now that you're
not very fond of having it skip certain buffers in the course of
action.
>> I would have to understand the "behavior" first. One approach would
>> be to move the user-error and 'switch-to-buffer-preserve-window-point'
>> handling into the interactive specification handling and for the rest
>> do what 'pop-to-buffer-same-window' does.
>
> Or maybe to add a new option that will allow switch-to-buffer
> to use pop-to-buffer-same-window.
Allow or mandate? Always?
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.