From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map Date: Tue, 27 Jul 2021 01:48:20 +0300 Organization: LINKOV.NET Message-ID: <875ywwbth7.fsf@mail.linkov.net> References: <89178870.2006793.1626665845848@ichabod.co-bxl> <87eebupi5k.fsf@gnus.org> <343742107.2068902.1626706305280@ichabod.co-bxl> <87k0lml3wt.fsf@mail.linkov.net> <874kcql2r8.fsf@gnus.org> <2097190220.304800.1627097630028@ichabod.co-bxl> <87sg02zz65.fsf@gnus.org> <8735s2ru7o.fsf@mail.linkov.net> <2138242899.459686.1627248504532@ichabod.co-bxl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 49632@debbugs.gnu.org To: Brian Leung Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 27 01:01:21 2021 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 1m89b6-00016a-Tq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 01:01:20 +0200 Original-Received: from localhost ([::1]:46756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m89b5-0004O5-Tt for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Jul 2021 19:01:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m89ao-0004Nf-PP for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40160) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m89ao-0003rY-9X for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m89an-0002uA-Ua for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:01:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 26 Jul 2021 23:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49632 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49632-submit@debbugs.gnu.org id=B49632.162734043811108 (code B ref 49632); Mon, 26 Jul 2021 23:01:01 +0000 Original-Received: (at 49632) by debbugs.gnu.org; 26 Jul 2021 23:00:38 +0000 Original-Received: from localhost ([127.0.0.1]:51703 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m89aQ-0002t5-EM for submit@debbugs.gnu.org; Mon, 26 Jul 2021 19:00:38 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:51191) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m89aN-0002sn-CH for 49632@debbugs.gnu.org; Mon, 26 Jul 2021 19:00:36 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id ABFA11C0004; Mon, 26 Jul 2021 23:00:27 +0000 (UTC) In-Reply-To: <2138242899.459686.1627248504532@ichabod.co-bxl> (Brian Leung's message of "Sun, 25 Jul 2021 23:28:24 +0200 (CEST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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:210769 Archived-At: >> There is one thing that I don't understand: is the >> helper function gud-set-repeat-map-property really needed? >> >> If e.g. the defvar gud-gdb-repeat-map uses such symbols as 'gud-next', >> could it put the 'repeat-map' property on the same symbols >> with reference to the variable 'map' directly in these defvars? >> Then only defvars will be needed, and no changes in gud-gdb, gdb. > > If we assign the repeat-map property within the defvars and avoid doing so > in the M-x gdb commands, then after gud.el gets loaded, the repeat-map > property on (say) gud-next will be 'jdb, since jdb-repeat-map is the last > such foo-repeat-map defvar appearing in gud.el. In that case, calling M-x > perldb and then running gud-next when repeat-mode is on will bring up the > jdb-repeat-map, which contains some commands that aren't defined for > perldb. So I think the gud-set-repeat-map-property macro (or something like > it) is necessary. You are right. Then I have only minor comments: 1. I thought that you want to create two separate maps for gud-gdb and gdb. This is the reason why I suggested to rename gud-repeat-map to gud-gdb-repeat-map. But since you use only one map for gbd and gud-gdb, then the name gud-repeat-map is fine. 2. Is there a reason why gud-set-repeat-map-property should be a macro, but not a function? When it's a macro, there are problems such that when the user modifies the map, then the function that uses the macro needs to be recompiled.