From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: Gud keybindings Date: Wed, 13 Aug 2014 21:14:08 +0200 Organization: Aioe.org NNTP Server Message-ID: <87ha1gtd6n.fsf@debian.uxu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407957334 21707 80.91.229.3 (13 Aug 2014 19:15:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2014 19:15:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 13 21:15:29 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHe1A-0006sx-Ko for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 21:15:28 +0200 Original-Received: from localhost ([::1]:49800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHe1A-0003Fn-4C for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 15:15:28 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.ecp.fr!aioe.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 58 Original-NNTP-Posting-Host: SIvZRMPqRkkTHAHL6NkRuw.user.speranza.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Notice: Filtered by postfilter v. 0.8.2 Cancel-Lock: sha1:K0Dms8HJ872GubsSarDfpYuYyYE= Mail-Copies-To: never Original-Xref: usenet.stanford.edu gnu.emacs.help:206919 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99195 Archived-At: Yuri Khan 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: http://user.it.uu.se/~embe8573/conf/emacs-init/caps.el Same thing, for zsh: http://user.it.uu.se/~embe8573/conf/.zsh/caps > 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: http://www.archivum.info/gnu.gdb.bug/2013-09/00000/C++-linux-gate.so.1-'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 itself... -- underground experts united