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


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Štěpán Němec <stepnem <at> gmail.com>, 39181 <at> debbugs.gnu.org
Subject: bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi layout
Date: Tue, 10 Mar 2020 09:48:52 +0100
> I updated the patch accordingly. Could you have a look at the docsting? I had a hard time writing it.

Please don't select WINDOW in 'with-window-undedicated'.  In general,
try to avoid selecting a window unless it is really needed.  This is
particularly important when WINDOW can be on another frame where
selecting WINDOW entails switching to that frame with all its overhead.

I would use something like the untested below.  This could be then
useful for 'ffap-other-frame' or 'ffap-dired-other-frame' as well.

martin


(defmacro with-window-undedicated (window &rest body)
  "Execute BODY with WINDOW temporarily undedicated.
WINDOW must be a live window and defaults to the selected one."
  (declare (indent 1) (debug t))
  (let ((window-dedicated-sym (gensym))
        (window-sym (gensym)))
    `(let* ((,window-sym (window-normalize-window window t))
	    (,window-dedicated-sym (window-dedicated-p ,window-sym)))
       (set-window-dedicated-p ,window-sym nil)
       (unwind-protect
           (progn ,@body)
	 (set-window-dedicated-p ,window-sym ,window-dedicated-sym)))))




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.