From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Newsgroups: gmane.emacs.help Subject: Re: Mode for files visited by GUD Date: Sat, 19 Jul 2008 03:40:42 +0200 Message-ID: <200807190340.43137.juanma_bellon@yahoo.es> References: <200807170135.53892.juanma_bellon@yahoo.es> <200807180308.34236.juanma_bellon@yahoo.es> <18559.62122.772406.76782@kahikatea.snap.net.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1216431694 27590 80.91.229.12 (19 Jul 2008 01:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jul 2008 01:41:34 +0000 (UTC) To: help-gnu-emacs@gnu.org, Nick Roberts Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 19 03:42:22 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KK1Sn-0000lp-25 for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Jul 2008 03:42:21 +0200 Original-Received: from localhost ([127.0.0.1]:48586 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK1Ru-0002Mq-8x for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Jul 2008 21:41:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KK1RI-00029m-Ag for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 21:40:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KK1RG-000280-0V for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 21:40:47 -0400 Original-Received: from [199.232.76.173] (port=56444 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK1RF-00027s-SJ for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 21:40:45 -0400 Original-Received: from n28.bullet.mail.mud.yahoo.com ([68.142.206.223]:27506) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KK1RF-0000GG-FP for help-gnu-emacs@gnu.org; Fri, 18 Jul 2008 21:40:45 -0400 Original-Received: from [209.191.108.97] by n28.bullet.mail.mud.yahoo.com with NNFMP; 19 Jul 2008 01:40:44 -0000 Original-Received: from [68.142.201.70] by t4.bullet.mud.yahoo.com with NNFMP; 19 Jul 2008 01:40:44 -0000 Original-Received: from [127.0.0.1] by omp422.mail.mud.yahoo.com with NNFMP; 19 Jul 2008 01:40:44 -0000 X-Yahoo-Newman-Id: 547705.15087.bm@omp422.mail.mud.yahoo.com Original-Received: (qmail 43850 invoked from network); 19 Jul 2008 01:40:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.es; h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-Disposition:Message-Id; b=cGsCxY4NMOa1XQA4GdbkNnYtpEMdQVtrmBoyDbC5Iqg71llW5MT/Zt+jonNyDRq9p4eKYDTHk66MQKJDwAFAwIofk70bOyVliOSnfcA69T4h6ru5K3kQ7zFod5DPzRV9DGBF9VKmjXeSEYJN2l0s6M41iJMVoRjzQ4sa1YKQAIs= ; Original-Received: from unknown (HELO 084202170072.customer.alfanett.no) (juanma_bellon@84.202.170.72 with plain) by smtp124.plus.mail.mud.yahoo.com with SMTP; 19 Jul 2008 01:40:43 -0000 X-YMail-OSG: bhjVycoVM1mtTlbKRTNG4cjWJeHy8pfRCAwPLWLxyjQZUCukULUFvLGxIILFvO5V1z1y5TIY5yjbtTW5r9B5NUMqwsaxR5.eOWir62z8LhQ0ILXOkgrHZvmSvab81CuCreI- X-Yahoo-Newman-Property: ymail-3 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) In-Reply-To: <18559.62122.772406.76782@kahikatea.snap.net.nz> Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:55720 Archived-At: On Friday 18 July 2008, Nick Roberts wrote: > A file called gdbsrc.el used to do something like this in XEmacs and I > considered it for a while. I think it's the wrong approcah because generally > in a debug session you end up wanting to edit your code. But there is nothing wrong with it. Sure, you end up editing, but that happens at the *end*, first you have to quit debugging to do anything useful with the editing task. Besides, I make 'q' exit the read-only modes; it can't get much easier than that; and while I'm just doing "next", "step" and friends, I can do it with 'n', 's' and so on, and if I need to select a piece of code (e.g., for evaluating), I don't have to switch to another window, and back: I'm there. > This way, as you say, source-guding-mode is evaluated for all files. > gdb-find-file-hook is also evaluated for all files but it doesn't do > anything if gud-minor-mode is not 'gdba or 'gdbmi. IMHO, it breaks the principle of least astonishment. At least I was astonished :-) So I could do this, right?: (defadvice gdb-find-file-hook (after activate-guding activate) (and gud-minor-mode (memq gud-minor-mode '(gdba gdbmi)) (source-guding-mode 1))) > Since you probably want to set source-guding-mode for existing buffers too > it may be best to advise gdb-init-buffer. This function only gets called > for GDB related buffers. I haven't found such function with [C-h f]. In which version was it introduced? Thanks. -- Juanma "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr