From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] find-file-noselect-1 Date: Sun, 13 Feb 2005 18:31:27 +1300 Message-ID: <420EE62F.5020400@snap.net.nz> References: <16907.50624.707323.36975@farnswood.snap.net.nz> <16908.7466.270296.502380@farnswood.snap.net.nz> <16908.8338.858602.199031@farnswood.snap.net.nz> <16909.56012.478599.348349@farnswood.snap.net.nz> <87vf8x67yl.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1108273540 24003 80.91.229.2 (13 Feb 2005 05:45:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Feb 2005 05:45:40 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 13 06:45:40 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D0CZZ-0005f7-G5 for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 06:45:33 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0Coq-0003Wr-Mk for ged-emacs-devel@m.gmane.org; Sun, 13 Feb 2005 01:01:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D0Cjw-000280-Qg for emacs-devel@gnu.org; Sun, 13 Feb 2005 00:56:18 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D0Cjj-00022C-PF for emacs-devel@gnu.org; Sun, 13 Feb 2005 00:56:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D0Cji-0001yj-Iq for emacs-devel@gnu.org; Sun, 13 Feb 2005 00:56:02 -0500 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D0CMY-0007JD-AI; Sun, 13 Feb 2005 00:32:06 -0500 Original-Received: from snap.net.nz (p31-tnt1.snap.net.nz [202.124.110.31]) by viper.snap.net.nz (Postfix) with ESMTP id B892F343758; Sun, 13 Feb 2005 18:32:02 +1300 (NZDT) User-Agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en Original-To: Stefan Monnier X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: main.gmane.org gmane.emacs.devel:33334 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:33334 > > >>>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