From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Gud keybindings Date: Wed, 13 Aug 2014 12:30:54 +0700 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1407907874 9952 80.91.229.3 (13 Aug 2014 05:31:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2014 05:31:14 +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 07:31:07 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 1XHR9P-00064I-N8 for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 07:31:07 +0200 Original-Received: from localhost ([::1]:45118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHR9P-0006hq-AU for geh-help-gnu-emacs@m.gmane.org; Wed, 13 Aug 2014 01:31:07 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49780) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHR9E-0006hl-LG for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 01:30:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHR9D-0006ti-EM for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 01:30:56 -0400 Original-Received: from mail-ig0-x22f.google.com ([2607:f8b0:4001:c05::22f]:61083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHR9D-0006s7-9t for help-gnu-emacs@gnu.org; Wed, 13 Aug 2014 01:30:55 -0400 Original-Received: by mail-ig0-f175.google.com with SMTP id uq10so9108212igb.8 for ; Tue, 12 Aug 2014 22:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=GQUUSyENAuNttcLPlJpcGzD5A6l6NBIPqYc5oxxO104=; b=r3KkW0Dy0w6L9Z9yV0jt2SNKrWJhnWd4C57jHpQyjm6JeLf8lny8suA2V6h7X9BoCE 729yY4s7NMjul9d+UYAU7X+fM92k4maJz98im94XawED+bqaCBWxx7vmbV/0gBVyC9sk L7cdlE3ZoTnMXYZXr8kv/kfmzgRl5kX01e4865Q3Zk+yoL8y3Q8u2vC0M/1Ws3I95qtQ o1dSsFyk4BYyG7PeqTWbXq7Isa4OszhQpSXhjtRY2sK2GMxsCMCzSSLIqPa9a6ZZwk7g XevUWjmTjSA0WvoQ2SLgj/6Vf52A94dkjax32y9Apz8Yb5bSsCf8nQAcBSNMxwdDAsfu 0NCQ== X-Received: by 10.50.79.132 with SMTP id j4mr8107118igx.9.1407907854265; Tue, 12 Aug 2014 22:30:54 -0700 (PDT) Original-Received: by 10.107.6.30 with HTTP; Tue, 12 Aug 2014 22:30:54 -0700 (PDT) X-Google-Sender-Auth: l_uakZCOpvSjDrlAVosSfue2lCM X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c05::22f 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:99184 Archived-At: Hello list, 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. By executing (gdb-many-windows) I can see the usual six Gud windows: GDB interaction, variables, source, in/output, stack, and breakpoints. I can focus the source buffer and navigate the source. In the source buffer, I can use such keybindings as C-x C-a C-b to set a breakpoint, and C-x C-a C-n to run until the next line. This set of keybindings strikes me as very unintuitive and inefficient. As a user coming from a different IDE, I would like such keys as Ctrl+F2 to set a breakpoint, F7/F8 for =E2=80=9Cstep=E2=80=9D and = =E2=80=9Cnext=E2=80=9D, and Ctrl+F9 for =E2=80=9Ccontinue=E2=80=9D. Or as a user familiar with console = GDB, I might like to press =E2=80=9Cb=E2=80=9D, =E2=80=9Cs=E2=80=9D, =E2=80=9Cn=E2= =80=9D and =E2=80=9Cc=E2=80=9D in the source window to invoke those same actions, but now they just act as self-insert-command. My two questions are: * Surely I am not the first user who wants easy debugging keys? What existing solutions are there? Or does everybody just (global-set-key (kbd "f8") 'gud-next)? * 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?