* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
@ 2023-12-18 18:18 Dmitry Gutov
2024-01-08 14:36 ` Thierry Volpiatto
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2023-12-18 18:18 UTC (permalink / raw)
To: 67882
Set up:
(defun split-window-prefer-side-by-side (&optional window)
(let ((split-height-threshold (and (< (window-width window)
split-width-threshold)
split-height-threshold)))
(split-window-sensibly window)))
(setq split-window-preferred-function 'split-window-prefer-side-by-side)
Split the frame, e.g. 'C-x 3'.
Then create some register (e.g. using 'C-x r C-@') and then invoke
another command reading it. E.g. 'C-x r j'.
Wait the necessary 1 second for the preview to appear - it will use one
of the existing windows to show the list of registers.
Then, whether you choose the register, or C-g out of the choice, the
window used to display the list will be deleted.
Previously mentioned in bug#66394.
Not a regression on master, just reproduced it in 29.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
2023-12-18 18:18 bug#67882: 29.1.90; Registers' preview can delete existing window when finishing Dmitry Gutov
@ 2024-01-08 14:36 ` Thierry Volpiatto
2024-01-10 1:46 ` Dmitry Gutov
0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2024-01-08 14:36 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 67882
[-- Attachment #1: Type: text/plain, Size: 1023 bytes --]
Hello Dmitry,
is the attached patch fix this issue for you?
Thanks.
Dmitry Gutov <dmitry@gutov.dev> writes:
> Set up:
>
> (defun split-window-prefer-side-by-side (&optional window)
> (let ((split-height-threshold (and (< (window-width window)
> split-width-threshold)
> split-height-threshold)))
> (split-window-sensibly window)))
>
> (setq split-window-preferred-function 'split-window-prefer-side-by-side)
>
> Split the frame, e.g. 'C-x 3'.
>
> Then create some register (e.g. using 'C-x r C-@') and then invoke
> another command reading it. E.g. 'C-x r j'.
>
> Wait the necessary 1 second for the preview to appear - it will use one
> of the existing windows to show the list of registers.
>
> Then, whether you choose the register, or C-g out of the choice, the
> window used to display the list will be deleted.
>
> Previously mentioned in bug#66394.
>
> Not a regression on master, just reproduced it in 29.
>
>
>
>
--
Thierry
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-window-setting-in-register-preview-bug-67882.patch --]
[-- Type: text/x-diff, Size: 2741 bytes --]
From b39ffa6e1db2577ecf3b265ccdcc50b102ee13b7 Mon Sep 17 00:00:00 2001
From: Thierry Volpiatto <thievol@posteo.net>
Date: Tue, 26 Dec 2023 17:49:34 +0100
Subject: [PATCH 1/2] Fix window setting in register preview (bug#67882)
and allow configuring it if needed.
* lisp/register.el (register-preview-display-buffer-alist): New user
var.
(register-preview,register-preview-1): Use it.
---
lisp/register.el | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/lisp/register.el b/lisp/register.el
index baad2c2a05d..f5b0365dec2 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -386,18 +386,21 @@ Format of each entry is controlled by the variable `register-preview-function'."
(setq register-preview-function (register--preview-function
register--read-with-preview-function)))
(when (or show-empty (consp register-alist))
- (with-current-buffer-window
- buffer
- (cons 'display-buffer-below-selected
- '((window-height . fit-window-to-buffer)
- (preserve-size . (nil . t))))
- nil
- (with-current-buffer standard-output
- (setq cursor-in-non-selected-windows nil)
- (mapc (lambda (elem)
- (when (get-register (car elem))
- (insert (funcall register-preview-function elem))))
- register-alist)))))
+ (with-current-buffer-window buffer
+ register-preview-display-buffer-alist
+ nil
+ (with-current-buffer standard-output
+ (setq cursor-in-non-selected-windows nil)
+ (mapc (lambda (elem)
+ (when (get-register (car elem))
+ (insert (funcall register-preview-function elem))))
+ register-alist)))))
+
+(defcustom register-preview-display-buffer-alist '(display-buffer-at-bottom
+ (window-height . fit-window-to-buffer)
+ (preserve-size . (nil . t)))
+ "Window configuration for the register preview buffer."
+ :type display-buffer--action-custom-type)
(defun register-preview-1 (buffer &optional show-empty types)
"Pop up a window showing the preview of registers in BUFFER.
@@ -415,9 +418,7 @@ Format of each entry is controlled by the variable `register-preview-function'."
(when (or show-empty (consp registers))
(with-current-buffer-window
buffer
- (cons 'display-buffer-below-selected
- '((window-height . fit-window-to-buffer)
- (preserve-size . (nil . t))))
+ register-preview-display-buffer-alist
nil
(with-current-buffer standard-output
(setq cursor-in-non-selected-windows nil)
--
2.34.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
2024-01-08 14:36 ` Thierry Volpiatto
@ 2024-01-10 1:46 ` Dmitry Gutov
2024-01-10 10:08 ` Thierry Volpiatto
0 siblings, 1 reply; 6+ messages in thread
From: Dmitry Gutov @ 2024-01-10 1:46 UTC (permalink / raw)
To: Thierry Volpiatto; +Cc: 67882
Hi Thierry,
On 08/01/2024 16:36, Thierry Volpiatto wrote:
> Hello Dmitry,
>
> is the attached patch fix this issue for you?
That seems to do it. Thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
2024-01-10 1:46 ` Dmitry Gutov
@ 2024-01-10 10:08 ` Thierry Volpiatto
2024-01-10 13:26 ` Eli Zaretskii
0 siblings, 1 reply; 6+ messages in thread
From: Thierry Volpiatto @ 2024-01-10 10:08 UTC (permalink / raw)
To: Dmitry Gutov; +Cc: 67882, eliz
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
Dmitry Gutov <dmitry@gutov.dev> writes:
> Hi Thierry,
>
> On 08/01/2024 16:36, Thierry Volpiatto wrote:
>> Hello Dmitry,
>> is the attached patch fix this issue for you?
>
> That seems to do it. Thanks!
Great! Eli no objections to merge this patch in master?
--
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
2024-01-10 10:08 ` Thierry Volpiatto
@ 2024-01-10 13:26 ` Eli Zaretskii
2024-01-10 16:05 ` Thierry Volpiatto
0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2024-01-10 13:26 UTC (permalink / raw)
To: Thierry Volpiatto; +Cc: dmitry, 67882
> From: Thierry Volpiatto <thievol@posteo.net>
> Cc: 67882@debbugs.gnu.org,eliz@gnu.org
> Date: Wed, 10 Jan 2024 10:08:49 +0000
>
> Dmitry Gutov <dmitry@gutov.dev> writes:
>
> > Hi Thierry,
> >
> > On 08/01/2024 16:36, Thierry Volpiatto wrote:
> >> Hello Dmitry,
> >> is the attached patch fix this issue for you?
> >
> > That seems to do it. Thanks!
>
> Great! Eli no objections to merge this patch in master?
No objections, please go ahead, and thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#67882: 29.1.90; Registers' preview can delete existing window when finishing
2024-01-10 13:26 ` Eli Zaretskii
@ 2024-01-10 16:05 ` Thierry Volpiatto
0 siblings, 0 replies; 6+ messages in thread
From: Thierry Volpiatto @ 2024-01-10 16:05 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: dmitry, 67882
[-- Attachment #1: Type: text/plain, Size: 567 bytes --]
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Thierry Volpiatto <thievol@posteo.net>
>> Cc: 67882@debbugs.gnu.org,eliz@gnu.org
>> Date: Wed, 10 Jan 2024 10:08:49 +0000
>>
>> Dmitry Gutov <dmitry@gutov.dev> writes:
>>
>> > Hi Thierry,
>> >
>> > On 08/01/2024 16:36, Thierry Volpiatto wrote:
>> >> Hello Dmitry,
>> >> is the attached patch fix this issue for you?
>> >
>> > That seems to do it. Thanks!
>>
>> Great! Eli no objections to merge this patch in master?
>
> No objections, please go ahead, and thanks.
Done, thanks.
--
Thierry
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 686 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-10 16:05 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-18 18:18 bug#67882: 29.1.90; Registers' preview can delete existing window when finishing Dmitry Gutov
2024-01-08 14:36 ` Thierry Volpiatto
2024-01-10 1:46 ` Dmitry Gutov
2024-01-10 10:08 ` Thierry Volpiatto
2024-01-10 13:26 ` Eli Zaretskii
2024-01-10 16:05 ` Thierry Volpiatto
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.