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: Fri, 7 Feb 2020 17:28:09 -0500 Message-ID: <499CD0CF-DA9D-4706-9F8D-6DF6CFE752BE@gmail.com> References: <55EA8238-880A-420D-A880-CD33B7E1DA85@gmail.com> <83lfpokk63.fsf@gnu.org> <27BC0F04-C81E-4D46-A84C-B61AAE700F59@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_B6AB3B29-8915-482E-BACC-057A6184FA32" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="110181"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39181@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 07 23:29:12 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 1j0C7c-000SYQ-4b for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Feb 2020 23:29:12 +0100 Original-Received: from localhost ([::1]:35810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0C7b-0003uG-5L for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 07 Feb 2020 17:29:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52381) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0C7T-0003tx-H3 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 17:29:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0C7S-0005SV-Lz for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 17:29:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44423) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0C7S-0005Rf-I1 for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 17:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j0C7S-0004E0-Da for bug-gnu-emacs@gnu.org; Fri, 07 Feb 2020 17:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Feb 2020 22:29: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.158111450716198 (code B ref 39181); Fri, 07 Feb 2020 22:29:02 +0000 Original-Received: (at 39181) by debbugs.gnu.org; 7 Feb 2020 22:28:27 +0000 Original-Received: from localhost ([127.0.0.1]:50396 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0C6s-0004DB-MP for submit@debbugs.gnu.org; Fri, 07 Feb 2020 17:28:27 -0500 Original-Received: from mail-qt1-f180.google.com ([209.85.160.180]:44433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j0C6q-0004Cw-CO for 39181@debbugs.gnu.org; Fri, 07 Feb 2020 17:28:24 -0500 Original-Received: by mail-qt1-f180.google.com with SMTP id w8so603129qts.11 for <39181@debbugs.gnu.org>; Fri, 07 Feb 2020 14:28:24 -0800 (PST) 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=QDpzCJJU3tW0b/9nzDCdvsJC5zmb82e6fakXnyNaDog=; b=GZ4rNgyHA+3hVYo1k+P+mwBw01vZ5Kvn7ngMRKPd0mfLBtk5zmBIzomop7rSMXwD0s FvGb5pcqMFtlLmNSXpDsl//2n6C50G7p+G7ao4VxbXgu/iFGRQEyHhMDGjWxJuk8mycF kaneUFWJ4EGDg41oo3h4omtuS7WNQi8tZVoBZF2u8Rp5O/08PY/J1/ncaWHu8vk8Akbf 3GG9lAav+wbuffVgpLed2YYcSIeVWE+BAFcz3IDM4N5oC0UxcS/Y9/L0qf2fHEdLsC8N D4hYsCIVtRmRxRdb7vwXu7QegtPSeC3txXi9d+bcvcLnockGXAmXAOoIzUDTI3QW9Cmj VqGw== 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=QDpzCJJU3tW0b/9nzDCdvsJC5zmb82e6fakXnyNaDog=; b=uEsvfa5VXYicpglrjfBivou3UJPIPQzCJdIY4HItQk5++ldWyuB3G8s+4/mEuju6TX VRf0fEeusr6SOGHqXMopf5a7LelJ9ltpYP9pRNV6nJ0XnWhPTTynIkLgjdpHN1KYJfzj wEXSyAT/6TrbgEosSegpBeUqV5G5gg3Itar2SDubhgGN9y3gFP3rN9s0vDGf/pNi45om VRS5Pp5LYjxRuZEPHgnagUSRMCbxsVk8sxFNwH/SwZi98+SxGjgx9HUqcnWa8YCymXB4 QgV6dNPDJWGeTSfAM4yhikP2Nr6CruH/x2e7TTzWd54RWl1sAEP8LGqHNuhiuVKUo49Q VsRw== X-Gm-Message-State: APjAAAUGLg6hBF/9g+lJdsyw+T9Fe/LXdnD1ngkbfViIf9ikDV26nSes xKtHZ2iXEf9Y6SaeWu8AGpTsUsIQ09UF+g== X-Google-Smtp-Source: APXvYqxO0GVCrIhlFvVNrWcbpUoixXXQaHLh+bi/GQIsO0Fhja5urN7gX7pXaOUrdrCTN1P6eiJ/Kg== X-Received: by 2002:ac8:4616:: with SMTP id p22mr572000qtn.368.1581114498546; Fri, 07 Feb 2020 14:28:18 -0800 (PST) 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 b24sm2049205qto.71.2020.02.07.14.28.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Feb 2020 14:28:17 -0800 (PST) In-Reply-To: <27BC0F04-C81E-4D46-A84C-B61AAE700F59@gmail.com> X-Mailer: Apple Mail (2.3608.40.2.2.4) 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:175761 Archived-At: --Apple-Mail=_B6AB3B29-8915-482E-BACC-057A6184FA32 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Here is the new patch. New-store-window.patch contains the one allowing = user store/restore window config. I added the two menu items. And I = changed the name to gdb-save-window-layout and gdb-load-window-layout = because I think they are shorter and easier to understand; WDYT? Restore-after-quit.patch contain the patch which restores the original = window configuration after gdb quits. Maybe I should send it as a = separate patch? BTW, It used to be three commits, I merged the first one on window.el = into new-restore-window.patch. Yuan --Apple-Mail=_B6AB3B29-8915-482E-BACC-057A6184FA32 Content-Disposition: attachment; filename=new-store-window.patch Content-Type: application/octet-stream; x-unix-mode=0700; name="new-store-window.patch" Content-Transfer-Encoding: quoted-printable =46rom=2095cb85d242f8270387e873f65a383b2e4cb5336f=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Thu,=20= 16=20Jan=202020=2018:52:17=20-0500=0ASubject:=20[PATCH]=20Restore=20= window=20configuration=20when=20gdb=20quits=0A=0AMake=20gdb=20preserve=20= the=20window=20configuration=20that=20the=20user=20had=20before=0A= starting=20gdb.=0A=0A*=20lisp/progmodes/gdb-mi.el=20= (gdb--window-configuration-before):=20New=0Avariable.=0A(gdb):=20Save=20= configuration=20on=20startup.=0A(gdb-reset):=20Restore=20window=20= configuration=20after=20quit.=0A---=0A=20lisp/progmodes/gdb-mi.el=20|=20= 11=20++++++++++-=0A=201=20file=20changed,=2010=20insertions(+),=201=20= deletion(-)=0A=0Adiff=20--git=20a/lisp/progmodes/gdb-mi.el=20= b/lisp/progmodes/gdb-mi.el=0Aindex=208c7e81d727..4b18c5cd80=20100644=0A= ---=20a/lisp/progmodes/gdb-mi.el=0A+++=20b/lisp/progmodes/gdb-mi.el=0A@@=20= -243,6=20+243,9=20@@=20gdb-output-sink=0A=20=09=20=20=20=20=20=20=20= disposition=20of=20output=20generated=20by=20commands=20that=0A=20=09=20=20= =20=20=20=20=20gdb=20mode=20sends=20to=20gdb=20on=20its=20own=20= behalf.")=0A=20=0A+(defvar=20gdb--window-configuration-before=20nil=0A+=20= =20"Stores=20the=20window=20configuration=20before=20starting=20gdb.")=0A= +=0A=20(defcustom=20gdb-discard-unordered-replies=20t=0A=20=20=20= "Non-nil=20means=20discard=20any=20out-of-order=20GDB=20replies.=0A=20= This=20protects=20against=20lost=20GDB=20replies,=20assuming=20that=20= GDB=20always=0A@@=20-762,6=20+765,10=20@@=20gdb=0A=20=20=20=20=20= (gdb-restore-windows)=0A=20=20=20=20=20(error=0A=20=20=20=20=20=20= "Multiple=20debugging=20requires=20restarting=20in=20text=20command=20= mode"))=0A+=0A+=20=20;;=20save=20window=20configuration=20before=20= starting=20gdb=20so=20we=20can=20restore=0A+=20=20;;=20it=20after=20gdb=20= quits=0A+=20=20(setq=20gdb--window-configuration-before=20= (window-state-get))=0A=20=20=20;;=0A=20=20=20(gud-common-init=20= command-line=20nil=20'gud-gdbmi-marker-filter)=0A=20=0A@@=20-4821,7=20= +4828,9=20@@=20gdb-reset=0A=20=20=20(if=20(boundp=20'speedbar-frame)=20= (speedbar-timer-fn))=0A=20=20=20(setq=20gud-running=20nil)=0A=20=20=20= (setq=20gdb-active-process=20nil)=0A-=20=20(remove-hook=20= 'after-save-hook=20'gdb-create-define-alist=20t))=0A+=20=20(remove-hook=20= 'after-save-hook=20'gdb-create-define-alist=20t)=0A+=20=20;;=20recover=20= window=20configuration=0A+=20=20(window-state-put=20= gdb--window-configuration-before))=0A=20=0A=20(defun=20= gdb-get-source-file=20()=0A=20=20=20"Find=20the=20source=20file=20where=20= the=20program=20starts=20and=20display=20it=20with=20related=0A--=20=0A= 2.25.0=0A=0A= --Apple-Mail=_B6AB3B29-8915-482E-BACC-057A6184FA32 Content-Disposition: attachment; filename=restore-after-quit.patch Content-Type: application/octet-stream; x-unix-mode=0700; name="restore-after-quit.patch" Content-Transfer-Encoding: quoted-printable =46rom=20fcee6b9498359b089d4f99ee23cd037e615a4568=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Yuan=20Fu=20=0ADate:=20Thu,=20= 16=20Jan=202020=2018:52:17=20-0500=0ASubject:=20[PATCH]=20Restore=20= window=20configuration=20when=20gdb=20quits=0A=0AMake=20gdb=20preserve=20= the=20window=20configuration=20that=20the=20user=20had=20before=0A= starting=20gdb.=0A=0A*=20lisp/progmodes/gdb-mi.el=20= (gdb--window-configuration-before):=20New=0Avariable.=0A(gdb):=20Save=20= configuration=20on=20startup.=0A(gdb-reset):=20Restore=20window=20= configuration=20after=20quit.=0A---=0A=20lisp/progmodes/gdb-mi.el=20|=20= 11=20++++++++++-=0A=201=20file=20changed,=2010=20insertions(+),=201=20= deletion(-)=0A=0Adiff=20--git=20a/lisp/progmodes/gdb-mi.el=20= b/lisp/progmodes/gdb-mi.el=0Aindex=203c2eee5b73..8b5c4f2ec1=20100644=0A= ---=20a/lisp/progmodes/gdb-mi.el=0A+++=20b/lisp/progmodes/gdb-mi.el=0A@@=20= -243,6=20+243,9=20@@=20gdb-output-sink=0A=20=09=20=20=20=20=20=20=20= disposition=20of=20output=20generated=20by=20commands=20that=0A=20=09=20=20= =20=20=20=20=20gdb=20mode=20sends=20to=20gdb=20on=20its=20own=20= behalf.")=0A=20=0A+(defvar=20gdb--window-configuration-before=20nil=0A+=20= =20"Stores=20the=20window=20configuration=20before=20starting=20gdb.")=0A= +=0A=20(defcustom=20gdb-discard-unordered-replies=20t=0A=20=20=20= "Non-nil=20means=20discard=20any=20out-of-order=20GDB=20replies.=0A=20= This=20protects=20against=20lost=20GDB=20replies,=20assuming=20that=20= GDB=20always=0A@@=20-762,6=20+765,10=20@@=20gdb=0A=20=20=20=20=20= (gdb-restore-windows)=0A=20=20=20=20=20(error=0A=20=20=20=20=20=20= "Multiple=20debugging=20requires=20restarting=20in=20text=20command=20= mode"))=0A+=0A+=20=20;;=20save=20window=20configuration=20before=20= starting=20gdb=20so=20we=20can=20restore=0A+=20=20;;=20it=20after=20gdb=20= quits=0A+=20=20(setq=20gdb--window-configuration-before=20= (window-state-get))=0A=20=20=20;;=0A=20=20=20(gud-common-init=20= command-line=20nil=20'gud-gdbmi-marker-filter)=0A=20=0A@@=20-4819,7=20= +4826,9=20@@=20gdb-reset=0A=20=20=20(if=20(boundp=20'speedbar-frame)=20= (speedbar-timer-fn))=0A=20=20=20(setq=20gud-running=20nil)=0A=20=20=20= (setq=20gdb-active-process=20nil)=0A-=20=20(remove-hook=20= 'after-save-hook=20'gdb-create-define-alist=20t))=0A+=20=20(remove-hook=20= 'after-save-hook=20'gdb-create-define-alist=20t)=0A+=20=20;;=20recover=20= window=20configuration=0A+=20=20(window-state-put=20= gdb--window-configuration-before))=0A=20=0A=20(defun=20= gdb-get-source-file=20()=0A=20=20=20"Find=20the=20source=20file=20where=20= the=20program=20starts=20and=20display=20it=20with=20related=0A--=20=0A= 2.25.0=0A=0A= --Apple-Mail=_B6AB3B29-8915-482E-BACC-057A6184FA32--