emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-goto before headline
@ 2012-02-10 14:19 Andrea Crotti
  2012-02-10 14:42 ` [PATCH] " Toby Cubitt
  0 siblings, 1 reply; 8+ messages in thread
From: Andrea Crotti @ 2012-02-10 14:19 UTC (permalink / raw)
  To: emacs-orgmode

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 ..

Couldn't it jump anyway or maybe go to first headline if the not there yet?

I've updated from git just now to try again:
Org-mode version 7.7 (release_7.8.03.330.gc804)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-10 14:19 org-goto before headline Andrea Crotti
@ 2012-02-10 14:42 ` Toby Cubitt
  2012-02-10 16:00   ` Andrea Crotti
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Toby Cubitt @ 2012-02-10 14:42 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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 --]

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-10 14:42 ` [PATCH] " Toby Cubitt
@ 2012-02-10 16:00   ` Andrea Crotti
  2012-02-13  0:08   ` Andrea Crotti
  2012-02-13 15:20   ` Bastien
  2 siblings, 0 replies; 8+ messages in thread
From: Andrea Crotti @ 2012-02-10 16:00 UTC (permalink / raw)
  To: emacs-orgmode

On 02/10/2012 02:42 PM, Toby Cubitt wrote:
> 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

Yes it was set to that..
I've tried the patch and it works perfectly here!
3 minutes to get a bug-fix is quite amazing ;)

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-10 14:42 ` [PATCH] " Toby Cubitt
  2012-02-10 16:00   ` Andrea Crotti
@ 2012-02-13  0:08   ` Andrea Crotti
  2012-02-13  9:20     ` Toby Cubitt
  2012-02-13 15:20     ` Bastien
  2012-02-13 15:20   ` Bastien
  2 siblings, 2 replies; 8+ messages in thread
From: Andrea Crotti @ 2012-02-13  0:08 UTC (permalink / raw)
  To: emacs-orgmode

On 02/10/2012 02:42 PM, Toby Cubitt wrote:
> 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
Is the patch already pushed to master then?
Just to check, it would be sad if it gets lost in the way..

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  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
  1 sibling, 1 reply; 8+ messages in thread
From: Toby Cubitt @ 2012-02-13  9:20 UTC (permalink / raw)
  To: emacs-orgmode

On Mon, Feb 13, 2012 at 12:08:48AM +0000, Andrea Crotti wrote:
> On 02/10/2012 02:42 PM, Toby Cubitt wrote:
> > 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
> Is the patch already pushed to master then?
> Just to check, it would be sad if it gets lost in the way..

I inserted the magic [PATCH] tag in the subject line, so it's been picked
up by patchwork (patchwork.newartisans.com/project/org-mode/list/), and
will get reviewed by the org-mode maintainers in due course. But they've
got a fairly large stack of patches to review, so give them a chance to
get to it!

The fact that I already have copyright papers for emacs on file with the
FSF might help speed things up a bit if it's accepted.

Best,
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-10 14:42 ` [PATCH] " Toby Cubitt
  2012-02-10 16:00   ` Andrea Crotti
  2012-02-13  0:08   ` Andrea Crotti
@ 2012-02-13 15:20   ` Bastien
  2 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-02-13 15:20 UTC (permalink / raw)
  To: emacs-orgmode

Hi Toby,

Toby Cubitt <tsc25@cantab.net> writes:

> 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).

Applied, thanks.

I added TINYCHANGE at the end of the log: we need this for small patches
from contributors that did not sign the FSF papers (yet).  Let me know if
you want to sign them for further bigger contributions.

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-13  0:08   ` Andrea Crotti
  2012-02-13  9:20     ` Toby Cubitt
@ 2012-02-13 15:20     ` Bastien
  1 sibling, 0 replies; 8+ messages in thread
From: Bastien @ 2012-02-13 15:20 UTC (permalink / raw)
  To: Andrea Crotti; +Cc: emacs-orgmode

Andrea Crotti <andrea.crotti.0@gmail.com> writes:

> Is the patch already pushed to master then?

It is now.

Thanks for the heads up!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] org-goto before headline
  2012-02-13  9:20     ` Toby Cubitt
@ 2012-02-13 15:23       ` Bastien
  0 siblings, 0 replies; 8+ messages in thread
From: Bastien @ 2012-02-13 15:23 UTC (permalink / raw)
  To: emacs-orgmode

Toby Cubitt <tsc25@cantab.net> writes:

> The fact that I already have copyright papers for emacs on file with the
> FSF might help speed things up a bit if it's accepted.

Ah, okay then.  

I added you to http://orgmode.org/worg/org-contribute.html

Thanks again!

-- 
 Bastien

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-02-13 18:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-10 14:19 org-goto before headline Andrea Crotti
2012-02-10 14:42 ` [PATCH] " Toby Cubitt
2012-02-10 16:00   ` 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

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).