From mboxrd@z Thu Jan 1 00:00:00 1970 From: "I.S." Subject: confusion with file search with org-links Date: Thu, 11 Nov 2010 10:58:34 -0500 Message-ID: <4CDC12AA.6080104@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=44730 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGZXy-0000o1-Ub for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 10:58:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGZXx-0006xm-Mh for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 10:58:46 -0500 Received: from mail-vw0-f41.google.com ([209.85.212.41]:33088) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGZXx-0006xR-K0 for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 10:58:45 -0500 Received: by vws18 with SMTP id 18so365196vws.0 for ; Thu, 11 Nov 2010 07:58:44 -0800 (PST) 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: emacs-orgmode@gnu.org Dear Experts, I am a little confused about how file links are supposed to work in orgmode. I have a link like [[file:/tmp/bug.bib::a bug][blah]] linking to a BiBTeX file but when I try to follow it via C-c C-o it just goes to the top of the file. Interestingly, when I open the file and set it to be in text mode and then follow the link, org puts me to the proper place in the file. I suspect that org-mode is getting confused with the file search feature when it opens a BiBTeX file. Why do I care? I'd like to be able to use a function like the one below to link to bib items: (defun store-bibtex-link () "Make link to a bibtex entry. Calling this function inside a BiBTeX entry will create a link to that entry and store it so you can extract it via C-c C-l. This is useful for making links to BiBTeX items from your org files. " (interactive) (let* ((title (bibtex-autokey-get-field "title")) (myfile (buffer-file-name)) (mylink (format "file:%s::%s" myfile title)) ) (setq org-stored-links (cons (list mylink title) org-stored-links)) (message "Stored: %s" (or title mylink)) )) An example of the bug.bib illustrating the problem is shown below % start bug.bib % foo % bar @article{me98, title={a bug}, author={me}, journal={it}, year=1998, } %blah -- Thanks, -I.S.