From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#39181: 27.0.50; [PATCH] Allow users to store & restore gdb-mi layout Date: Thu, 5 Mar 2020 10:14:46 +0100 Message-ID: <5c8d9f6a-0bc5-b2ff-1513-4b8631fee1a3@gmx.at> References: <75FC69BA-CCD4-46D0-B9F5-109200C796F3@gmail.com> <55235252-FD03-4801-804A-864EFC1DCA0A@gmail.com> <90254CFF-2FFD-4D54-8467-717FF10166A2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="77605"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39181@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 05 10:15:49 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 1j9mbd-000K7n-57 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Mar 2020 10:15:49 +0100 Original-Received: from localhost ([::1]:45404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9mbb-0005HB-W8 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Mar 2020 04:15:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57160) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9mat-0005GF-IA for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 04:15:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9mas-0004pb-Ec for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 04:15:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36187) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j9mas-0004pT-Aw for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 04:15:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j9mas-0003Bz-6g for bug-gnu-emacs@gnu.org; Thu, 05 Mar 2020 04:15:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Mar 2020 09:15: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.158339969512245 (code B ref 39181); Thu, 05 Mar 2020 09:15:02 +0000 Original-Received: (at 39181) by debbugs.gnu.org; 5 Mar 2020 09:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:42160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9mak-0003BR-SV for submit@debbugs.gnu.org; Thu, 05 Mar 2020 04:14:55 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:50199) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j9maj-0003BE-I6 for 39181@debbugs.gnu.org; Thu, 05 Mar 2020 04:14:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1583399687; bh=+xINhxtGd9EAq3uWF0yVKrl+H3Tuk8CKRyk8oRjtsW0=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=a5tFqyMauWwFOMMYWi5b4RYfjNx4wQzDJ8DdGMHZ40Cy73AjXfZ20DjDFo1XgcOa7 F9NfYbVNJTPyCTuP9cSAwwwQGgESdXrUm+sq16hK0DfZd74abfR8OomQ1N5wxYQjI0 3kjxaNfo8D3VtgwsSwRcO9J/w2hWdXa76tpYUX3k= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.18]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJE6F-1iv95R40Yl-00KeTR; Thu, 05 Mar 2020 10:14:47 +0100 In-Reply-To: <90254CFF-2FFD-4D54-8467-717FF10166A2@gmail.com> Content-Language: en-US X-Provags-ID: V03:K1:i1EKuvWfKox+9+A75fiBSmjBhLQBTlqi10vJpkpiibbW3xJplzb H5UdVPZ0XMoJZcdy4L/HjgSNEECWk86+nx6nBhAkF4ioAG82Zq7398kJYXEDfcsmA73qYbB F3vF433rK6SFK1RVj9VH670KXyYXwM0KDYdOTsJEBWrCP1SAehfx566L8z1YA0seLepPeYP aIzdjwdUCx/7kKOwsQWtg== X-UI-Out-Filterresults: notjunk:1;V03:K0:r1lBtcTvqF4=:9qupxomxS0ZnRzL/Wssnr1 E8loI+L0uSnEgeh9iWk0KKTjGm0otUKVOxFNFD/tQTzd9YEZ6wi8w7mWWWqsVMJgbejcB80bJ hcQk1EgEejdeoljSu/PtPnIjdihNiSJSgcqWak8SACd0BErgP4u2KBrrRWcYQ/magtFWW+yJC ex7fzayOaWyjfVe7H6g8YlRmkD/ib+HaGq8vAE0u1wDyiD6AZuuuhzv2u4JBMpGpw3vHG8y3c MvXC4hCiB92s1DY7sZNk/uZXSgDTX/GNyfbJXVLyq1yKOg3w9yImmF06ccKsLd3s+6lySt/Sm 082qwLoGvPC88HerG7xMin7rWQRLP4eWSbfkDGtzTcUOwdyhbJBEEfVhgTRjCar+e/rX/ETmG kK58GsuzwpoeHWcRfP5QnGLV48KbA8eVXg3u34ozncj6EdHUKA9Zoj9I7m/Wa+FWbbCKk1iUX kweGOXP9IuNQBruCPnyZ/EIIc9IGGfCFH+6Ccu67zriWiWoQN4H0IchTnnkW/jml9uIv7WHWZ m0wfUOaHNdyrr14/2zY5iZLCfi+IREOprnIcw3K5DIISAxtv+UM7FbZ6Utf0KvrDO9UXDUgAv ZfUnEEjd5D1Y4bXVHXV7JDMWM5Orpaxhq88YReWSRYy7CQAbkF89Ni7UwMB9MD0ATe6iOFS38 Jb/+jCxlr+uJ7HOBuV5YYnUYaurBbt8o0us88y0dP51JTt81w2ofBNbzFdXYYtrx/gFcALbg3 tONh66Zpg+J12obsquMJdYpcJky7oZ+iVevMpVN2GJw8OqLMP4aNYjnD81Top/hGmyIGiYAH 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:176890 Archived-At: > Here is the patch. Thanks. It gets me here the following warnings when building on master (sorry, I'm a complete ignorant of the 'cl-' snafu): ELC progmodes/gdb-mi.elc In toplevel form: =2E./../lisp/progmodes/gdb-mi.el:4738:1: Warning: Unused lexical variable= =E2=80=98window-config=E2=80=99 In end of data: =2E./../lisp/progmodes/gdb-mi.el:5069:1: Warning: the following functions= might not be defined at runtime: cl-delete-if, cl-find-if, cl-mapcar A few remarks: + "If non-nil, gdb loads this window layout file on startup. +If not absolute, GDB will look under `gdb-window-layout-directory'." We should settle in descriptions on whether we write gdb or GDB. Also, "if not absolute" is too terse IMHO. + (define-key menu [load-layout] '("Load window layout" "Load GDB window= layout from a file" . gdb-load-window-layout)) + (define-key menu [save-layout] '("Save window layout" "Save current GD= B window layout to a file" . gdb-save-window-layout)) I think we could omit the "window" in these which should allow us to, instead of + '(menu-item "Restore window layout" say + '(menu-item "Restore layout after quit" so it becomes more clear that "load" and "save" act _immediately_ on the current state while "restore" is a more general setting that becomes effective only when the user quits. (Note also that in general we cannot guarantee that menu tooltips are always shown on each and every system where Emacs runs.) Also, I would mention all four possible values of 'gdb-restore-window-layout-after-quit' (currently "toggle" indicates that there are only two of them) like, for example, with the side values for tool-bar mode. + "Return a buffer displaying source file or nil. + +The source file would be the most relevant file or the main file." This is IMHO too terse in every respect. Neither "source file" nor "main file" are canonical terms in the context of GDB so we should explain here how they are set up (what is nil in this context?). +E.g., locals buffer, registers buffer, but don't include the main I would say "Function buffers are locals buffers, ...". +(defun gdb--buffer-type (buffer) + "Return the buffer type of BUFFER or nil. Maybe "Return the type of BUFFER if it is a GDB function buffer." would be better. Thanks for your work on this, martin