From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi layout Date: Sat, 21 Mar 2020 17:03:11 -0400 Message-ID: <1A34AFCE-F3E9-4CBD-BD24-C5B008C6B1D0@gmail.com> References: <91E91E25-9956-4D10-BD99-DC028156731C@gmail.com> <87d09jp7he.fsf@gmail.com> <916b2fef-b1bb-1c0c-1b43-4609cd768a79@gmx.at> <878sk6ot4z.fsf@gmail.com> <0EF37881-F1DA-48AD-8F4E-05A37041BD98@gmail.com> <301E3A87-7ED6-4E0A-A6DA-ABF84EB85B2F@gmail.com> <87lfo4netg.fsf@gmail.com> <87h7ysnela.fsf@gmail.com> <023deed5-98f5-c0d5-c144-27156a9a7e0b@gmx.at> <4186025A-58B4-45DE-B64A-E00AD2F85637@gmail.com> <07cbd454-4885-9875-edaf-168f26ae828a@gmx.at> <7234DEAE-00EA-4576-B580-C50218E0300F@gmail.com> <87v9mypwud.fsf@gmail.com> <076B0EFC-C9CE-4B74-B460-FE70251A3A8B@gmail.com> <87imix7dte.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_401ED910-5DE8-400E-BB81-FF7D8E5B1F0E" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="14624"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39181@debbugs.gnu.org To: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 21 22:04:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jFlHx-0003gE-Hr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Mar 2020 22:04:13 +0100 Original-Received: from localhost ([::1]:40896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFlHw-0007uw-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Mar 2020 17:04:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52268) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jFlHo-0007uo-Hq for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 17:04:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jFlHm-0002oQ-Gp for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 17:04:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jFlHm-0002oM-C0 for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 17:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jFlHm-0006MT-7G for bug-gnu-emacs@gnu.org; Sat, 21 Mar 2020 17:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Mar 2020 21:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39181 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39181-submit@debbugs.gnu.org id=B39181.158482460124386 (code B ref 39181); Sat, 21 Mar 2020 21:04:02 +0000 Original-Received: (at 39181) by debbugs.gnu.org; 21 Mar 2020 21:03:21 +0000 Original-Received: from localhost ([127.0.0.1]:48286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFlH7-0006LG-D6 for submit@debbugs.gnu.org; Sat, 21 Mar 2020 17:03:21 -0400 Original-Received: from mail-qv1-f67.google.com ([209.85.219.67]:41717) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jFlH4-0006L3-TU for 39181@debbugs.gnu.org; Sat, 21 Mar 2020 17:03:19 -0400 Original-Received: by mail-qv1-f67.google.com with SMTP id o7so2620364qvq.8 for <39181@debbugs.gnu.org>; Sat, 21 Mar 2020 14:03:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=pKfyagFcW+EkcmVX2Zhy5L/MHAQ7IJsnNufpLOvEzDE=; b=X3ztfZhHKUjm/0wDG7ELNb+DuWUyiGh85R831JgosyKMKeF1l3OK9Ro8PuDiQkFlc/ rUq3h/xKWUqTLdFqlKeolzv6yQbE7JPHFwlaU68GfPhly9cC10HCIcvqu24gBs3rCKoa iGoKlJQWNgtt+tXsJfU1oY3mZ75cZKTcrnKunxc+rQb8B6o/JSgy2VNszFVw1wB9CBxZ Khmvv5dlEDISN/4b0FkpqvXB9ueMFDoOLwsrUABUFtz6074aaefjUgVOWMwhJLY01ccz XR/tIZT9XtyII0Vqk8RH9Hqi3F1BPB9dWLEIOAVBW4QEcLZf78PzBtGoO8eArrJ2ilvk 6Xkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=pKfyagFcW+EkcmVX2Zhy5L/MHAQ7IJsnNufpLOvEzDE=; b=rX/o5a7g/MclXXqFZruqUuTWShcrpFsKM+ZhsHfja8oklwF7os0z5aBUrtzgaeICM8 6Htgug4OjXjwceCEy4QHLCgx1k1ZbqNxTvQMuRsF5uTm7pLkKBqdnxz3ofgA95AcDnpc CFUjvixZVibbG5YDAfp4CEEEPkY2tfRJ5L38Sn08vWFvkxol9KZEhgoqwMoyVPPSAkga 78eAelUEJStlDyN/67lpyjHI4CsCc+C9yNdicTj84smDVhhlJABD2x0MbNM0urprxTs/ +xZT3LWbyISuke9RMj6LMBe52sLY2L6MYACYJb515pua6zV1AYPqAjFG20YnWWXqgZ1t A0aw== X-Gm-Message-State: ANhLgQ3YMLF3sD0Ec/9ugf3RP50kzjIo+t12DuToMZBw2dH8woDb/qji kMX0PhFVN70yonqtZwU9Z40= X-Google-Smtp-Source: ADFU+vt9kBSMl007jdoTl5NqNm01qxHlYEz8g0reKGcaecxk/3u2aM+jFZH+WiVu+I3U/FN1qwSZBw== X-Received: by 2002:ad4:4b67:: with SMTP id m7mr14505979qvx.73.1584824593205; Sat, 21 Mar 2020 14:03:13 -0700 (PDT) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id z1sm8305371qtc.51.2020.03.21.14.03.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Mar 2020 14:03:12 -0700 (PDT) In-Reply-To: <87imix7dte.fsf@gmail.com> X-Mailer: Apple Mail (2.3608.60.0.2.5) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177604 Archived-At: --Apple-Mail=_401ED910-5DE8-400E-BB81-FF7D8E5B1F0E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 21, 2020, at 2:39 PM, =C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec = wrote: >=20 > On Sat, 21 Mar 2020 14:00:56 -0400 > Yuan Fu wrote: >=20 >>>> +@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. >>>=20 >>> "(which defaults to user-emacs-directory)" (ideally with a proper >>> reference to that variable). >>=20 >> 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. >=20 > Saying "defaults to ~/.emacs.d" is strictly speaking incorrect, = because > it really defaults to user-emacs-directory, which might or might not = be > "~/.emacs.d". It is true that the same could probably be argued about > some other occurences in the manuals (most of which probably go back > even before the introduction of user-emacs-directory in Emacs 23, let > alone the recent XDG-compliance efforts), though, so if you insist, at > least it will be incorrect somewhat _consistently_ (and can be fixed > later together with the other places) :-D. >=20 >>>> +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 >>>=20 >>> "to a non-nil value. Your original window layout will then be = restored >>> after GDB quits." >>=20 >> I prefer active voice than passive voice but don=E2=80=99t object the = latter. So I changed it accordingly. >=20 > The real issue here was more the semantics than the grammar, similarly > to the NEWS correction: it's really Emacs, not GDB, that restores the > windows after GDB quits. >=20 >=20 I changed to user-emacs-directory. I hope I get the xref right :-) Yuan --Apple-Mail=_401ED910-5DE8-400E-BB81-FF7D8E5B1F0E Content-Disposition: attachment; filename=news.patch Content-Type: application/octet-stream; x-unix-mode=0700; name="news.patch" Content-Transfer-Encoding: quoted-printable =46rom=20c75dd5f5ad5bddc323e57844dcdd45239734aa8a=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Sun,=20= 15=20Mar=202020=2021:02:14=20-0400=0ASubject:=20[PATCH]=20Add=20= documentation=20for=20previous=20commit=20by=20Yuan=20Fu=0A=0A*=20= etc/NEWS:=20Add=20news=20entry.=0A*=20doc/emacs/building.texi=20(GDB=20= User=20Interface=20Layout):=20Add=0Adocumentation=20for=20= 'gdb-save-window-configuration',=0A'gdb-load-window-configuration',=0A= 'gdb-default-window-configuration-file',=0A= 'gdb-window-configuration-directory',=0A= 'gdb-restore-window-configuration-after-quit'.=20=20Change=20= 'many-windows=0Alayout'=20to=20'default=20layout'=0A---=0A=20= doc/emacs/building.texi=20|=2030=20++++++++++++++++++++++++++++--=0A=20= etc/NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=2016=20= ++++++++++++++++=0A=202=20files=20changed,=2044=20insertions(+),=202=20= deletions(-)=0A=0Adiff=20--git=20a/doc/emacs/building.texi=20= b/doc/emacs/building.texi=0Aindex=2038963f225c..11bc239012=20100644=0A= ---=20a/doc/emacs/building.texi=0A+++=20b/doc/emacs/building.texi=0A@@=20= -975,9=20+975,29=20@@=20GDB=20User=20Interface=20Layout=0A=20@end=20= group=0A=20@end=20smallexample=0A=20=0A+@findex=20= gdb-save-window-configuration=0A+@findex=20gdb-load-window-configuration=0A= +@vindex=20gdb-default-window-configuration-file=0A+@vindex=20= gdb-window-configuration-directory=0A+=20=20You=20can=20customize=20the=20= window=20layout=20based=20on=20the=20one=20above,=20and=20save=0A+the=20= custom=20layout=20to=20a=20file=20using=0A= +@code{gdb-save-window-configuration}.=20=20Then=20you=20can=20later=20= load=20this=0A+layout=20back=20using=20= @code{gdb-load-window-configuration}.=20=20(Simply=20put,=0A+window=20= configuration=20is=20the=20Emacs=20jargon=20for=20window=20layout.)=20=20= You=20can=0A+set=20your=20custom=20layout=20file=20as=20the=20default=20= one=20used=20by=0A+@code{gdb-many-windows}=20by=20customizing=0A= +@code{gdb-default-window-configuration-file}.=20=20If=20it=20is=20not=20= an=0A+absolute=20path,=20GDB=20looks=20under=0A= +@code{gdb-window-configuration-directory}=20for=20the=20file.=0A= +@code{gdb-window-configuration-directory}=20defaults=20to=0A= +@code{user-emacs-directory}=20(@pxref{How=20Emacs=20Finds=20Your=20Init=20= File,,,=0A+custom.texi,=20Customization}).=0A+=0A+=0A=20@findex=20= gdb-restore-windows=0A=20@findex=20gdb-many-windows=0A-=20=20If=20you=20= ever=20change=20the=20window=20layout,=20you=20can=20restore=20the=20= many-windows=0A+@vindex=20gdb-restore-window-configuration-after-quit=0A= +=20=20If=20you=20ever=20change=20the=20window=20layout,=20you=20can=20= restore=20the=20default=0A=20layout=20by=20typing=20@kbd{M-x=20= gdb-restore-windows}.=20=20To=20toggle=0A=20between=20the=20many=20= windows=20layout=20and=20a=20simple=20layout=20with=20just=20the=20GUD=0A= =20interaction=20buffer=20and=20a=20source=20file,=20type=20@kbd{M-x=20= gdb-many-windows}.=0A@@=20-988,7=20+1008,13=20@@=20GDB=20User=20= Interface=20Layout=0A=20of=20windows=20on=20your=20original=20frame=20= will=20not=20be=20affected.=20=20A=20separate=0A=20frame=20for=20GDB=20= sessions=20can=20come=20in=20especially=20handy=20if=20you=20work=20on=20= a=0A=20text-mode=20terminal,=20where=20the=20screen=20estate=20for=20= windows=20could=20be=20at=20a=0A-premium.=0A+premium.=20=20If=20you=20= choose=20to=20start=20GDB=20in=20the=20same=20frame,=20consider=0A= +setting=20@code{gdb-restore-window-configuration-after-quit}=20to=20a=0A= +non-@code{nil}=20value.=20=20Your=20original=20layout=20will=20then=20= be=20restored=0A+after=20GDB=20quits.=20=20Use=20@code{t}=20to=20always=20= restore;=20use=0A+@code{if-gdb-many-windows}=20to=20restore=20only=20= when=0A+@code{gdb-many-windows}=20is=20non-@code{nil};=20use=20= @code{if-gdb-show-main}=0A+to=20restore=20only=20when=20= @code{gdb-show-main}=20is=20non-@code{nil}.=0A=20=0A=20=20=20You=20may=20= also=20specify=20additional=20GDB-related=20buffers=20to=20display,=0A=20= either=20in=20the=20same=20frame=20or=20a=20different=20one.=20=20Select=20= the=20buffers=20you=0Adiff=20--git=20a/etc/NEWS=20b/etc/NEWS=0Aindex=20= 87e634f2c1..f61bff6a4f=20100644=0A---=20a/etc/NEWS=0A+++=20b/etc/NEWS=0A= @@=20-174,6=20+174,22=20@@=20key=20=20=20=20=20=20=20=20=20=20=20=20=20= binding=0A=20/=20v=20=20=20=20=20=20=20=20=20=20=20=20=20= package-menu-filter-by-version=0A=20/=20/=20=20=20=20=20=20=20=20=20=20=20= =20=20package-menu-filter-clear=0A=20=0A+**=20gdb-mi=0A+=0A+***=20gdb-mi=20= can=20now=20store=20and=20restore=20window=20configurations.=0A+Use=20= 'gdb-save-window-configuration'=20to=20save=20window=20configuration=20= to=20a=0A+file,=20and=20'gdb-load-window-configuration'=20to=20load=20= from=20a=20file.=20=20These=0A+commands=20can=20also=20be=20accessed=20= through=20menu=20bar=20under=20Gud=20--=0A+GDB-Windows.=20=20= 'gdb-default-window-configuration-file',=20when=20non-nil,=0A+is=20= loaded=20when=20GDB=20starts=20up.=0A+=0A+***=20gdb-mi=20can=20now=20= restore=20window=20configuration=20after=20quit.=0A+Set=20= 'gdb-restore-window-configuration-after-quit'=20to=20non-nil=20and=20= Emacs=0A+will=20remember=20the=20window=20configuration=20before=20GDB=20= started,=20and=20restore=0A+it=20after=20GDB=20quits.=20=20Toggle=20= button=20is=20also=20provided=20under=20Gud=20--=0A+GDB-Windows.=0A+=0A+=0A= =20=0C=0A=20*=20New=20Modes=20and=20Packages=20in=20Emacs=2028.1=0A=20=0A= --=20=0A2.25.1=0A=0A= --Apple-Mail=_401ED910-5DE8-400E-BB81-FF7D8E5B1F0E Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii --Apple-Mail=_401ED910-5DE8-400E-BB81-FF7D8E5B1F0E--