From mboxrd@z Thu Jan 1 00:00:00 1970 From: Toby Cubitt Subject: Re: [PATCH] org-goto before headline Date: Fri, 10 Feb 2012 15:42:18 +0100 Message-ID: <20120210144218.GA20814@c3po> References: <4F35276F.4040601@gmail.com> Reply-To: Toby Cubitt Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8P1HSweYDcXXzwPJ" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvrgs-0000CV-4B for emacs-orgmode@gnu.org; Fri, 10 Feb 2012 09:43:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvrgm-00016s-83 for emacs-orgmode@gnu.org; Fri, 10 Feb 2012 09:43:10 -0500 Received: from sanddollar.geekisp.com ([216.168.135.167]:4192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvrgm-00016U-4Z for emacs-orgmode@gnu.org; Fri, 10 Feb 2012 09:43:04 -0500 Content-Disposition: inline In-Reply-To: <4F35276F.4040601@gmail.com> 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: emacs-orgmode@gnu.org --8P1HSweYDcXXzwPJ Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=20 > first headline to work? >=20 > 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 --=20 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 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="0001-Fix-bug-in-org-goto-outline-path-completion-interfac.patch" Content-Transfer-Encoding: quoted-printable =46rom f0cfaa5cb13996ba7a24bffa998e1c2a327d95be Mon Sep 17 00:00:00 2001 =46rom: Toby S. Cubitt 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 --=20 1.7.3.4 --GvXjxJ+pjyke8COw-- --8P1HSweYDcXXzwPJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (GNU/Linux) iEYEARECAAYFAk81LMoACgkQRJrkoWvoje5gJwCfenu8BY6qttxqx2j2syk3uXOM x5kAn0eogBSHdBzZX2nWHqEsJDAepEP5 =gS7D -----END PGP SIGNATURE----- --8P1HSweYDcXXzwPJ--