[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gud keybindings

From: Emanuel Berg
Subject: Re: Gud keybindings
Date: Wed, 13 Aug 2014 21:14:08 +0200
User-agent: 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.
Straight Ghostbusters!

For Emacs:

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
> variables.

Yeah, you got GDB to work with C++ on Linux? I asked
about it on gnu.gdb.bug and it seems the post is
archived here:'set-solib-search-path'-and-'set-sysroot'.html

(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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]