help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Mode for files visited by GUD


From: Juanma
Subject: Re: Mode for files visited by GUD
Date: Sat, 19 Jul 2008 03:40:42 +0200
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

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 via email to

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