From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: confusion with file search with org-links Date: Thu, 11 Nov 2010 10:09:31 -0600 Message-ID: <5ABB896D-6F04-435A-B6F0-890776F81B57@gmail.com> References: <4CDC12AA.6080104@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=46587 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGZiT-00062G-9W for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 11:09:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGZiS-0001Ur-8r for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 11:09:37 -0500 Received: from mail-yw0-f41.google.com ([209.85.213.41]:65448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGZiS-0001Sh-6Y for emacs-orgmode@gnu.org; Thu, 11 Nov 2010 11:09:36 -0500 Received: by ywi6 with SMTP id 6so876701ywi.0 for ; Thu, 11 Nov 2010 08:09:34 -0800 (PST) In-Reply-To: <4CDC12AA.6080104@gmail.com> 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: "I.S." Cc: emacs-orgmode@gnu.org Hi I.S. This should already work out of the box in bibtex files, but it will use the citation key instead of the title as the thing to search for. the code for this functionality is in org-bibtex.el - Carsten On Nov 11, 2010, at 9:58 AM, I.S. wrote: > 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. > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode