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: Nick Roberts
Subject: Re: Mode for files visited by GUD
Date: Fri, 18 Jul 2008 13:32:26 +1200

 > > What is it you are trying to do?  If your changes are of general interest,
 > > maybe we could include them in Emacs.
 > 
 > I want to turn on a minor mode for source code files visited during
 > debugging. I want to make them read-only and have many commands bound to
 > single keys (I use View mode in addition to my minor mode).

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.


 >...
 > Then I have this in my .emacs:
 > 
 > (autoload 'source-guding-mode "source-guding.el")
 > (defadvice gdb-find-file-hook (after activate-guding activate)
 >   (source-guding-mode 1))

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.

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.

-- 
Nick                                           http://www.inet.net.nz/~nickrob




reply via email to

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