GNU bug report logs - #39181
27.0.50; [PATCH] Allow users to store & restore gdb-mi layout

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Sat, 18 Jan 2020 20:58:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #56 received at 39181 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Yuan Fu <casouri <at> gmail.com>, Štěpán Němec
 <stepnem <at> gmail.com>
Cc: 39181 <at> debbugs.gnu.org
Subject: Re: bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi
 layout
Date: Mon, 9 Mar 2020 10:01:53 +0100
>> I'm sorry, I only skimmed through your patch, but shouldn't this use
>> 'unwind-protect'? Otherwise the "temporarily" won't hold in case of
>> abnormal exit from BODY, unless I'm missing something.
>>
>> —
>> Štěpán
>
> Thanks for spotting that. I added the unwind-protext form.

If we want to be more strict about this macro then how about the
following forms:

(with-selected-window-undedicated
 (set-window-dedicated-p nil t))

will leave the selected window dedicated which does not really violate
the contract of the macro but is unexpected at least.

The following is more serious: Suppose a user has a >= 2 windows layout
and does

(set-window-dedicated-p nil t)
(with-selected-window-undedicated
 (other-window 1))

which will have the macro make some other window dedicated and the
initially selected window undedicated.  A similar thing happens with

(set-window-dedicated-p nil t)
(with-selected-window-undedicated
 (delete-window))

The macro should be named 'with-window-undedicated', take a WINDOW (nil
for the selected one) as first argument and BODY as second.  It should
restore the dedicated status of WINDOW to what it was before running
BODY and leave the dedicated status of all other windows alone.  IMHO.

martin





This bug report was last modified 5 years and 122 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.