[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
From: |
Brian Leung |
Subject: |
bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map |
Date: |
Tue, 27 Jul 2021 06:09:14 +0200 (CEST) |
> 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.
When I wrote initially wrote gud-set-repeat-map-property, I couldn't figure out
how to make gud-set-repeat-map-property work as a function since the repeat-map
property needed to be a symbol corresponding to a keymap, and not an evaluated
keymap.
I've updated the patch with a change to the repeat-post-hook function in
repeat.el to accept an evaluated keymap, which permits a function version of
gud-set-repeat-map-property.
> ----------------------------------------
> From: Juri Linkov <juri@linkov.net>
> Sent: Tue Jul 27 00:48:20 CEST 2021
> To: Brian Leung <leungbk@mailfence.com>
> Cc: Lars Ingebrigtsen <larsi@gnus.org>, <49632@debbugs.gnu.org>
> Subject: Re: bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map
>
>
> >> 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.
--
Sent with https://mailfence.com
Secure and private email
--
Mailfence.com
Private and secure email
0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
Description: File Attachment: 0001-Ensure-that-gud-commands-for-M-x-gdb-are-handled-by-.patch
0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
Description: File Attachment: 0002-Ensure-that-gud-commands-for-non-GDB-debuggers-are-h.patch
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, (continued)
bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Brian Leung, 2021/07/19
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Juri Linkov, 2021/07/19
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Lars Ingebrigtsen, 2021/07/19
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Brian Leung, 2021/07/23
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Lars Ingebrigtsen, 2021/07/25
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Juri Linkov, 2021/07/25
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Brian Leung, 2021/07/25
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Juri Linkov, 2021/07/26
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map,
Brian Leung <=
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Brian Leung, 2021/07/27
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Juri Linkov, 2021/07/27
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Eli Zaretskii, 2021/07/28
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Juri Linkov, 2021/07/28
- bug#49632: [PATCH] Ensure that M-x gdb populates gud-repeat-map, Eli Zaretskii, 2021/07/28