From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: link bug Date: Tue, 7 Nov 2006 08:19:46 +0100 Message-ID: <3199c869c75f4496038ba138bf3fcd71@science.uva.nl> References: Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GhLFN-0000ji-4T for emacs-orgmode@gnu.org; Tue, 07 Nov 2006 02:19:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GhLFL-0000iB-UR for emacs-orgmode@gnu.org; Tue, 07 Nov 2006 02:19:48 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GhLFL-0000i0-Dk for emacs-orgmode@gnu.org; Tue, 07 Nov 2006 02:19:47 -0500 Received: from [146.50.4.51] (helo=imap.science.uva.nl) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GhLFL-0006Zr-5f for emacs-orgmode@gnu.org; Tue, 07 Nov 2006 02:19:47 -0500 In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eddward DeVilla Cc: emacs-orgmode There are two issues here: The first is when you want to *store* a link to a file-less buffer, using `C-c l'. This should be an error, because links are for the future and if there is no file, there is no point linking to it. Org-mode is throwing an error, but there is a bug if the file-less buffer is in org-mode. The second problem is the one you describe. I am fixing it in the way you propose. Both problems fixed for 4.54. Thanks for the report. - Carsten On Nov 6, 2006, at 18:44, Eddward DeVilla wrote: > Hi, > > I'm not on the latest version yet and it will be a few day until I > can get there. However, I found a bug in 4.51 when trying to store a > link using C-c C-l. I believe that's org-insert-link. In any case > org-insert-link gets called in there somewhere and dies calling > (file-truename buffer-file-name) to determine if the link is in the > same file as the org buffer. This is invalid when the buffer doesn't > have a file behind it. There needs to be a check to make sure > buffer-file-name is not nil. (Or org has to not allow file-less > buffers). The reason for the file-less buffer was that I've started > creating small outlines with links when I want to throw together a > quick code review. > > I'm not sure what the right answer is. may you just skip the case if > there is not file behind the buffer since links into file-less buffer > would seem to be impossible. On the other hand, You may want to allow > links back to the same buffer just in case the user decides to save it > to a file later. For now, I'm going to hack mine by wrapping the "(if > (equal ..." inside an "(if (buffer-file-name) ..." > > Edd > > > _______________________________________________ > Emacs-orgmode mailing list > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > -- Carsten Dominik Sterrenkundig Instituut "Anton Pannekoek" Universiteit van Amsterdam Kruislaan 403 NL-1098SJ Amsterdam phone: +31 20 525 7477