From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hendy Subject: Re: internal links not being followed; instead, offer to create new heading Date: Sun, 10 Feb 2013 15:21:51 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4eLV-00055U-HC for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 16:22:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U4eLR-0006Iq-Rt for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 16:21:57 -0500 Received: from mail-lb0-f173.google.com ([209.85.217.173]:42534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U4eLR-0006IJ-KY for emacs-orgmode@gnu.org; Sun, 10 Feb 2013 16:21:53 -0500 Received: by mail-lb0-f173.google.com with SMTP id gf7so4248264lbb.32 for ; Sun, 10 Feb 2013 13:21:52 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Brian van den Broek Cc: emacs-orgmode On Sun, Feb 10, 2013 at 12:53 PM, Brian van den Broek wrote: > Hi all, > > I am having trouble with following internal org links. After carefully > reading the documentation (especially 4.2 Internal Links > ) with the following > test.org file, I would expect that C-c C-o on the link text in the bar > tree would jump to the corresponding text in the foo tree. I'd never heard of being able to do this, so I read the documentation as well and this how I parsed it: - Is link text a URL? - If yes -> open url - If no, check current file - Is link text a custom ID? - If yes -> go to headline with matching ID - If no, check for custom target - Is there a match between [[link text]] and an occurrence of <> (dedicated target)? - If yes -> go to the dedicated target location - If no, check file type - Is this a .org file? - If yes, check for a *headline* (or possibly keywords/tags) matching the [[link text]] [1] - If no, conduct a string search for the [[link text]] [1] Quote: "If no dedicated target exists, Org will search for a headline that is exactly the link text but may also include a TODO keyword and tags" So, let's test this out... I created test.org with your contents and can verify that C-c C-o asks if I should create a new headline. I also created test.txt with the same contents, did =M-x org-mode= and tried the same and got the same results. So, either: 1) The documentation is incorrect (maybe), or 2) I don't know how to do C-c C-o provided by Org in a non-org file correctly (more probable) Scratch that... tried again and left Emacs in text mode (default for me when opening .txt) and manually did =M-x org-open-at-point= and the cursor moves to the first "s" in "string to search." So, the documentation, at least from my read, does seem to describe the situation accurately. Best regards, John > > #+BEGIN_EXAMPLE > * foo > > a string to search for > > * bar > > [[string to search]] > #+END_EXAMPLE > > Instead, what occurs is that I get the following in the Messages > buffer: > > #+BEGIN_QUOTE > Position saved to mark ring, go back with C-c &. > No match - create this as a new heading? (y or n) > org-link-search: No match > #+END_QUOTE > > where the last line appears after I hit `n' in respond to the prompt. > > This works as expected with a minimal init loading org 6.33 that > shipped with my Emacs. > > I have tried it with the following minimal init: > > #+BEGIN_SRC emacs-lisp > (setq load-path (cons "/home/brian/code/foreign/org-mode/lisp" load-path)) > (setq load-path (cons "/home/brian/code/foreign/org-mode/contrib/lisp" > load-path)) > > (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) > > (global-set-key "\C-cl" 'org-store-link) > (global-set-key "\C-cc" 'org-capture) > (global-set-key "\C-ca" 'org-agenda) > (global-set-key "\C-cb" 'org-iswitchb) > > (setq org-directory "/home/brian/docs/org") > (setq org-default-notes-file "~/docs/org/inbox.org") > #+END_SRC > > My emacs and org: > > Org-mode version 7.9.3e (7.9.3e-973-gba38de @ > /home/brian/code/foreign/org-mode/lisp/) > GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1) of > 2012-08-24 on trouble, modified by Debian > > I don't rule out that I have misunderstood something, but the observed > behaviour doesn't match (how I understand) the documented behaviour. > > Thanks and best, > > Brian vdB >