all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Thibaut Verron <thibaut.verron@gmail.com>, emacs-devel@gnu.org
Subject: Re: Use of dedicated windows in gdb-mi.el
Date: Mon, 09 Feb 2015 15:50:05 +0100	[thread overview]
Message-ID: <87iofbb0ma.fsf@gmail.com> (raw)
In-Reply-To: <jwvd25jupo9.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 09 Feb 2015 09:29:34 -0500")

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:

>> From what I understand, this work-around is an illustration of the
>> point, rather than a solution: when someone presses C-x b, they want
>> to change the buffer displayed in the current window.  They do not
>> want to have to switch to  another window/frame before that, and they
>> do not want to see the desired  buffer appear in a random window.

Hi Stefan,

> I introduced "softly dedicated" windows for that kind of situation:
> a "softly dedicated" window would not be chosen normally when Elisp code
> wants to display some buffer somewhere, but if the user does `C-x b'
> then the "soft dedication" gets overruled.
>
> I know Martin doesn't like this concept, but in any case, if we could
> try and arrange for gdb-mi to mark its windows as softly dedicated,
> I think it would solve your use case.

Thanks, it solves it. Please see if the attached patch is OK.

Oleh


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gdb-mi.el-gdb-window-dedicated-flag-New-flag.patch --]
[-- Type: text/x-diff, Size: 1895 bytes --]

From e0b7210e4c9ad5c8175abe74f6f626d850472d00 Mon Sep 17 00:00:00 2001
From: Oleh Krehel <ohwoeowho@gmail.com>
Date: Mon, 9 Feb 2015 15:45:00 +0100
Subject: [PATCH] gdb-mi.el (gdb-window-dedicated-flag): New flag

* lisp/progmodes/gdb-mi.el (gdb-window-dedicated-flag): This flag is
  passed to `set-window-dedicated-p' each time it needs to be called
  with a non-nil flag.
(gdb-display-buffer): Update.
(gdb-set-window-buffer): Update.
---
 lisp/progmodes/gdb-mi.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 27846ed..48f0cd2 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -252,6 +252,14 @@ lower token-number are out-of-order."
   :group 'gud
   :version "24.4")
 
+(defcustom gdb-window-dedicated-flag t
+  "Non-nil flag used for calls to `set-window-dedicated-p'."
+  :type '(choice
+          (const :tag "Plain" t)
+          (const :tag "Soft" soft))
+  :group 'gud
+  :version "25.1")
+
 (cl-defstruct gdb-handler
   "Data required to handle the reply of a command sent to GDB."
   ;; Prefix of the command sent to GDB.  The GDB reply for this command
@@ -4282,7 +4290,7 @@ overlay arrow in source buffer."
 (defun gdb-display-buffer (buf)
   "Show buffer BUF, and make that window dedicated."
   (let ((window (display-buffer buf)))
-    (set-window-dedicated-p window t)
+    (set-window-dedicated-p window gdb-window-dedicated-flag)
     window))
 
   ;; (let ((answer (get-buffer-window buf 0)))
@@ -4447,7 +4455,7 @@ window is dedicated."
   (when ignore-dedicated
     (set-window-dedicated-p window nil))
   (set-window-buffer window (get-buffer name))
-  (set-window-dedicated-p window t))
+  (set-window-dedicated-p window gdb-window-dedicated-flag))
 
 (defun gdb-setup-windows ()
   "Layout the window pattern for option `gdb-many-windows'."
-- 
1.8.4


  reply	other threads:[~2015-02-09 14:50 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-06 18:02 Use of dedicated windows in gdb-mi.el Oleh Krehel
2015-02-06 19:07 ` Eli Zaretskii
2015-02-06 19:14   ` Oleh Krehel
2015-02-06 21:33     ` Eli Zaretskii
2015-02-09  9:19       ` Thibaut Verron
2015-02-09 14:29         ` Stefan Monnier
2015-02-09 14:50           ` Oleh Krehel [this message]
2015-02-09 15:51           ` Eli Zaretskii
2015-02-09 18:42           ` martin rudalics
2015-02-09 15:44         ` Eli Zaretskii
2015-02-09 15:57           ` Oleh Krehel
2015-02-09 17:05             ` Eli Zaretskii
2015-02-09 17:22               ` Oleh Krehel
2015-02-09 17:56                 ` Eli Zaretskii
2015-02-09 18:11                   ` Oleh Krehel
2015-02-09 18:26                     ` Drew Adams
2015-02-09 18:39                       ` Oleh Krehel
2015-02-09 18:56                         ` Eli Zaretskii
2015-02-09 19:48                           ` Oleh Krehel
2015-02-09 20:00                             ` Eli Zaretskii
2015-02-09 19:44                         ` Drew Adams
2015-02-09 19:50                           ` Oleh Krehel
2015-02-09 20:01                             ` Eli Zaretskii
2015-02-09 20:09                               ` Oleh Krehel
2015-02-09 20:27                                 ` Eli Zaretskii
2015-02-09 20:33                                   ` Oleh Krehel
2015-02-09 20:44                                     ` Eli Zaretskii
2015-02-09 20:46                                       ` Oleh Krehel
2015-02-10 15:42                                         ` Eli Zaretskii
2015-02-10  2:20                             ` Stefan Monnier
2015-02-10  3:48                               ` Eli Zaretskii
2015-02-10  6:39                                 ` Oleh Krehel
2015-02-10 15:54                                   ` Eli Zaretskii
2015-02-09 18:52                     ` Eli Zaretskii
2015-02-09 18:53                       ` Oleh Krehel
2015-02-09 18:58                       ` Oleh Krehel
2015-02-09 19:20                         ` Eli Zaretskii
2015-02-09 19:47                           ` Oleh Krehel
     [not found]                   ` <<8761bb9cq8.fsf@gmail.com>
     [not found]                     ` <<83zj8m9atc.fsf@gnu.org>
2015-02-09 20:42                       ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2015-02-24 17:56 Glenn Brown
2015-02-24 18:02 ` Oleh Krehel
2015-02-24 18:31 ` Eli Zaretskii
2015-02-24 22:23   ` Paul Eggert
2015-02-25  3:46     ` Eli Zaretskii
2015-02-25  3:57     ` Stefan Monnier
2015-02-25  6:09       ` Glenn Brown
2015-02-10  0:49 Barry OReilly
2015-02-10 16:05 ` Eli Zaretskii
     [not found] <<87h9uynckc.fsf@gmail.com>

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87iofbb0ma.fsf@gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=thibaut.verron@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.