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: Juri Linkov <juri <at> linkov.net>
To: martin rudalics <rudalics <at> gmx.at>
Cc: 32790 <at> debbugs.gnu.org
Subject: bug#32790: 27.0.50; point jumps unexpectedly after delete-window
Date: Wed, 31 Oct 2018 23:20:13 +0200
>> 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.




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.