Why call find-file-noselect there? If this is meant to operate on the
file that was just visited, it already has a buffer, and it is the
current buffer when gdb-find-file-hook runs. Why not just use
that buffer?
That might have been true but I'm now using this function to address Kim's
point about enabling gud-minor-mode for existing buffers.
I don't understand this explanation. In the case where you're enabling gud-minor-mode in existing buffers, the buffers also already exist so you shouldn't call find-file-noselect (which may cause new files to be visited). Maybe you want something like find-buffer-visiting, but even that sounds doubtful because it seems that you always know the buffer before you even know the file name
I am just using find-file-noselect to recover the name of the buffer. I have a buffer
and a file associated with it. Generally, I don't see the big deal whether I pass the
buffer-name or filename across the functions. However since the code is part of
find-file-hook, I'll pass the buffer-name to avoid the possibility of some kind of
recursion.
Nick
_______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel