unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Juanma <juanma_bellon@yahoo.es>
To: help-gnu-emacs@gnu.org, Nick Roberts <nickrob@snap.net.nz>
Subject: Re: Mode for files visited by GUD
Date: Sat, 19 Jul 2008 03:40:42 +0200	[thread overview]
Message-ID: <200807190340.43137.juanma_bellon@yahoo.es> (raw)
In-Reply-To: <18559.62122.772406.76782@kahikatea.snap.net.nz>

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







  reply	other threads:[~2008-07-19  1:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 23:35 Mode for files visited by GUD Juanma
2008-07-17  0:13 ` Nick Roberts
2008-07-17 23:54   ` Juanma
2008-07-18  0:21     ` Juanma
2008-07-18  0:30     ` Nick Roberts
2008-07-18  1:08       ` Juanma
2008-07-18  1:32         ` Nick Roberts
2008-07-19  1:40           ` Juanma [this message]
2008-07-19  2:20             ` Nick Roberts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200807190340.43137.juanma_bellon@yahoo.es \
    --to=juanma_bellon@yahoo.es \
    --cc=help-gnu-emacs@gnu.org \
    --cc=nickrob@snap.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).