emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Toby Cubitt <tsc25@cantab.net>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] org-goto before headline
Date: Fri, 10 Feb 2012 15:42:18 +0100	[thread overview]
Message-ID: <20120210144218.GA20814@c3po> (raw)
In-Reply-To: <4F35276F.4040601@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 912 bytes --]

On Fri, Feb 10, 2012 at 02:19:27PM +0000, Andrea Crotti wrote:
> What is exactly the reason for org-goto to need to be at least in the 
> first headline to work?
> 
> I always get this error when I just try to jump in the first line:
> byte-code: Before first headline at position 1 in buffer ..

Do you by any chance have `org-goto-interface' set to
outline-path-completion (or are you using org-goto with a prefix
argument)?

If so, I've also come across this problem. I think it's a bug in
org-goto, which should pass NO-EXCLUDE to org-refile-get-location (but
doesn't). The attached patch fixes this for me (or you can pull the
"org-goto" branch from http://www.dr-qubit.org/git/org-mode.git).

HTH,

Toby
-- 
Dr T. S. Cubitt
Mathematics and Quantum Information group
Department of Mathematics
Complutense University
Madrid, Spain

email: tsc25@cantab.net
web:   www.dr-qubit.org

[-- Attachment #1.2: 0001-Fix-bug-in-org-goto-outline-path-completion-interfac.patch --]
[-- Type: text/plain, Size: 1045 bytes --]

From f0cfaa5cb13996ba7a24bffa998e1c2a327d95be Mon Sep 17 00:00:00 2001
From: Toby S. Cubitt <tsc25@cantab.net>
Date: Wed, 8 Feb 2012 10:21:13 +0100
Subject: [PATCH] Fix bug in org-goto `outline-path-completion' interface

* lisp/org.el (org-goto): call org-refile-get-location with NO-EXCLUDE
argument set, otherwise not only are headlines in the current subtree
excluded, but it throws an error if point happens not to be within a
subtree (e.g. at start of buffer).
---
 lisp/org.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 882a41c..7030847 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6812,7 +6812,7 @@ hierarchy above."
 	 (selected-point
 	  (if (eq interface 'outline)
 	      (car (org-get-location (current-buffer) org-goto-help))
-	    (let ((pa (org-refile-get-location "Goto")))
+	    (let ((pa (org-refile-get-location "Goto" nil nil t)))
 	      (org-refile-check-position pa)
 	      (nth 3 pa)))))
     (if selected-point
-- 
1.7.3.4


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2012-02-10 14:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 14:19 org-goto before headline Andrea Crotti
2012-02-10 14:42 ` Toby Cubitt [this message]
2012-02-10 16:00   ` [PATCH] " Andrea Crotti
2012-02-13  0:08   ` Andrea Crotti
2012-02-13  9:20     ` Toby Cubitt
2012-02-13 15:23       ` Bastien
2012-02-13 15:20     ` Bastien
2012-02-13 15:20   ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210144218.GA20814@c3po \
    --to=tsc25@cantab.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=toby-dated-1330094582.dc8cbf@dr-qubit.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).