all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: "Štěpán Němec" <stepnem@gmail.com>
Cc: 39181@debbugs.gnu.org
Subject: bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi layout
Date: Sat, 21 Mar 2020 14:00:56 -0400	[thread overview]
Message-ID: <076B0EFC-C9CE-4B74-B460-FE70251A3A8B@gmail.com> (raw)
In-Reply-To: <87v9mypwud.fsf@gmail.com>

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

Thanks for reviewing! Almost all fixed with some comments:

>> +@code{gdb-default-window-configuration-file}.  If it is not an
>> +absolute path, GDB looks under
>> +@code{gdb-window-configuration-directory} (default to
>> +@file{~/.emacs.d}) for the file.
> 
> "(which defaults to user-emacs-directory)" (ideally with a proper
> reference to that variable).

The whole Emacs user manual only referenced user-emacs-directory once when talking about ~/.emacs.d. OTOH ~/.emacs.d is used across the manual. I think ~/.emacs.d is better.

>> +premium.  If you choose to start GDB in the same frame, consider
>> +setting @code{gdb-restore-window-configuration-after-quit} to
>> +non-@code{nil}.  Then GDB restores your original window layout after
> 
> "to a non-nil value.  Your original window layout will then be restored
> after GDB quits."

I prefer active voice than passive voice but don’t object the latter. So I changed it accordingly.

Yuan


[-- Attachment #2: news.patch --]
[-- Type: application/octet-stream, Size: 4089 bytes --]

From 5f6f35712c069b031e3ac7e28c413b206adffd0c Mon Sep 17 00:00:00 2001
From: Yuan Fu <casouri@gmail.com>
Date: Sun, 15 Mar 2020 21:02:14 -0400
Subject: [PATCH] Add documentation for previous commit by Yuan Fu

* etc/NEWS: Add news entry.
* doc/emacs/building.texi (GDB User Interface Layout): Add
documentation for 'gdb-save-window-configuration',
'gdb-load-window-configuration',
'gdb-default-window-configuration-file',
'gdb-window-configuration-directory',
'gdb-restore-window-configuration-after-quit'.  Change 'many-windows
layout' to 'default layout'
---
 doc/emacs/building.texi | 27 +++++++++++++++++++++++++--
 etc/NEWS                | 16 ++++++++++++++++
 2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 38963f225c..a9d2a21d76 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -975,9 +975,26 @@ GDB User Interface Layout
 @end group
 @end smallexample
 
+@findex gdb-save-window-configuration
+@findex gdb-load-window-configuration
+@vindex gdb-default-window-configuration-file
+@vindex gdb-window-configuration-directory
+  You can customize the window layout based on the one above, and save
+the custom layout to a file using
+@code{gdb-save-window-configuration}.  Then you can later load this
+layout back using @code{gdb-load-window-configuration}.  (Simply put,
+window configuration is the Emacs jargon for window layout.)  You can
+set your custom layout file as the default one used by
+@code{gdb-many-windows} by customizing
+@code{gdb-default-window-configuration-file}.  If it is not an
+absolute path, GDB looks under
+@code{gdb-window-configuration-directory} (which defaults to
+@file{~/.emacs.d}) for the file.
+
 @findex gdb-restore-windows
 @findex gdb-many-windows
-  If you ever change the window layout, you can restore the many-windows
+@vindex gdb-restore-window-configuration-after-quit
+  If you ever change the window layout, you can restore the default
 layout by typing @kbd{M-x gdb-restore-windows}.  To toggle
 between the many windows layout and a simple layout with just the GUD
 interaction buffer and a source file, type @kbd{M-x gdb-many-windows}.
@@ -988,7 +1005,13 @@ GDB User Interface Layout
 of windows on your original frame will not be affected.  A separate
 frame for GDB sessions can come in especially handy if you work on a
 text-mode terminal, where the screen estate for windows could be at a
-premium.
+premium.  If you choose to start GDB in the same frame, consider
+setting @code{gdb-restore-window-configuration-after-quit} to a
+non-@code{nil} value.  Your original layout will then be restored
+after GDB quits.  Use @code{t} to always restore; use
+@code{if-gdb-many-windows} to restore only when
+@code{gdb-many-windows} is non-@code{nil}; use @code{if-gdb-show-main}
+to restore only when @code{gdb-show-main} is non-@code{nil}.
 
   You may also specify additional GDB-related buffers to display,
 either in the same frame or a different one.  Select the buffers you
diff --git a/etc/NEWS b/etc/NEWS
index 87e634f2c1..f61bff6a4f 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -174,6 +174,22 @@ key             binding
 / v             package-menu-filter-by-version
 / /             package-menu-filter-clear
 
+** gdb-mi
+
+*** gdb-mi can now store and restore window configurations.
+Use 'gdb-save-window-configuration' to save window configuration to a
+file, and 'gdb-load-window-configuration' to load from a file.  These
+commands can also be accessed through menu bar under Gud --
+GDB-Windows.  'gdb-default-window-configuration-file', when non-nil,
+is loaded when GDB starts up.
+
+*** gdb-mi can now restore window configuration after quit.
+Set 'gdb-restore-window-configuration-after-quit' to non-nil and Emacs
+will remember the window configuration before GDB started, and restore
+it after GDB quits.  Toggle button is also provided under Gud --
+GDB-Windows.
+
+
 \f
 * New Modes and Packages in Emacs 28.1
 
-- 
2.25.1


  reply	other threads:[~2020-03-21 18:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5e950f28.1c69fb81.61726.5731.GMR@mx.google.com>
2020-01-18 20:57 ` bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi layout Yuan Fu
2020-01-31 10:13   ` Eli Zaretskii
2020-02-02 14:22     ` Yuan Fu
2020-02-07 22:28       ` Yuan Fu
2020-02-10  4:56         ` Yuan Fu
2020-02-15  8:08           ` Eli Zaretskii
2020-02-15  9:55             ` martin rudalics
2020-02-15 10:19               ` Eli Zaretskii
2020-02-15 20:37                 ` Yuan Fu
2020-02-16 10:00                   ` martin rudalics
2020-03-03 23:41                     ` Yuan Fu
2020-03-04 13:28                       ` Fu Yuan
2020-03-05  6:12                         ` Yuan Fu
2020-03-05  9:14                           ` martin rudalics
2020-03-07 18:09                             ` Yuan Fu
2020-03-07 19:07                               ` Štěpán Němec
2020-03-07 19:17                                 ` Yuan Fu
2020-03-09  9:01                                   ` martin rudalics
2020-03-09 17:59                                     ` Yuan Fu
2020-03-09 19:18                                       ` Štěpán Němec
2020-03-09 20:17                                         ` Yuan Fu
2020-03-09 20:54                                           ` Štěpán Němec
2020-03-10  8:49                                           ` martin rudalics
2020-03-10 18:05                                             ` Fu Yuan
2020-03-11  8:52                                               ` martin rudalics
2020-03-11  9:26                                                 ` Štěpán Němec
2020-03-12  8:22                                                   ` martin rudalics
2020-03-12  8:49                                                     ` Štěpán Němec
2020-03-12 19:21                                                       ` Yuan Fu
2020-03-13 20:09                                                         ` Yuan Fu
     [not found]                                                           ` <87lfo4netg.fsf@gmail.com>
2020-03-13 21:13                                                             ` Štěpán Němec
2020-03-13 21:40                                                               ` Yuan Fu
2020-03-13 22:12                                                                 ` Štěpán Němec
2020-03-15 15:55                                                                 ` martin rudalics
2020-03-16  0:13                                                                   ` Yuan Fu
2020-03-16  9:24                                                                     ` martin rudalics
2020-03-20 20:03                                                                       ` Yuan Fu
2020-03-20 20:58                                                                         ` Štěpán Němec
2020-03-21 18:00                                                                           ` Yuan Fu [this message]
2020-03-21 18:39                                                                             ` Štěpán Němec
2020-03-21 21:03                                                                               ` Yuan Fu
2020-03-21 21:49                                                                                 ` Štěpán Němec
2020-03-24 16:14                                                                                   ` Yuan Fu
2020-03-27  9:01                                                                                     ` martin rudalics
2020-03-27 16:28                                                                                       ` Yuan Fu
2020-04-14  8:05                                                                                         ` martin rudalics
2020-03-10  8:48                                       ` martin rudalics
2020-04-14  1:17   ` bug#39181: Fwd: Delivery Status Notification (Failure) Yuan Fu

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=076B0EFC-C9CE-4B74-B460-FE70251A3A8B@gmail.com \
    --to=casouri@gmail.com \
    --cc=39181@debbugs.gnu.org \
    --cc=stepnem@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.