[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gud keybindings
Re: Gud keybindings
Wed, 13 Aug 2014 21:14:08 +0200
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)
Yuri Khan <address@hidden> writes:
> * What would I need to do if I wanted to implement
> single-letter key bindings for Gud commands? Define a
> minor mode with an appropriate keymap that sets
> buffer-read-only when enabled and restores it when
> disabled? How do I arrange for this mode to be
> enabled when visiting any source buffer if and only
> if Gud is active?
For what modes do you want it?
For one or but a few, how about binding the self-insert
keys to either self-insert, or, if buffer-read-only (or
`Gud-alive-p' if such a predicate exists - otherwise
write it). I don't think that'll be too slow/much work
for just a couple of keys.
If it is, you can write a defun, we-are-debugging which
rebinds the keys, and correspondingly no-bugs-left to
reset. You can automatize this second part like, if a
non-debug key is pressed, it is not only self-inserted,
it also disables the debugging keys.
Check out this minor-mode - it works just like that.
Enable it to get new keys. Disable it to get back to
normal. Or do something that makes sense normally, but
not with the minor-mode on - that gets implemented
"normally", and disables the minor mode as well.
Same thing, for zsh:
> I am trying to debug C++ programs using Emacs, Gud
> and GDB. This involves setting breakpoints, stepping
> through and over function calls, and examining
Yeah, you got GDB to work with C++ on Linux? I asked
about it on gnu.gdb.bug and it seems the post is
(Wow, that's a long URL.)
For whatever reason the reply I got isn't available,
but he said something to the effect "that's a bug,
report it". But I take it GDB is written in C so
nothing would have stopped me from using it to debug
underground experts united
- Gud keybindings, Yuri Khan, 2014/08/13
- Re: Gud keybindings,
Emanuel Berg <=