From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Behr Subject: Bug: Can't export subtree with links to headlines outside of the subtree [8.3.1 (8.3.1-95-g1dbb25-elpa)] Date: Tue, 1 Sep 2015 14:14:49 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a113fe5fac30798051eb3878c Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWq5Q-00029B-Mr for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 14:15:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWq5O-0002EG-Sl for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 14:15:12 -0400 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:36625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWq5O-0002Bp-Fk for emacs-orgmode@gnu.org; Tue, 01 Sep 2015 14:15:10 -0400 Received: by ioii196 with SMTP id i196so10910907ioi.3 for ; Tue, 01 Sep 2015 11:15:09 -0700 (PDT) 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 --001a113fe5fac30798051eb3878c Content-Type: text/plain; charset=UTF-8 I want to export a subtree of a file, but that subtree has links to headings in the file that are outside of the subtree. I expect the exporting process to produce some sort of valid result, but instead it throws an "Unable to resolve link" error. Here's a test file to reproduce: * Foo * Bar :export: [[*Foo][Foo]] Making a file with those contents and trying to export it to e.g. latex will fail, but if the :export: tag is removed, exporting succeeds. I can't easily get a backtrace because the error comes from user-error, but it happens in org-export-resolve-fuzzy-link. Of course the exported file can't link to a target that doesn't exist, but it's probably better to strip out the link in this case than to throw an error, right? Emacs : GNU Emacs 24.4.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2014-10-20 on builder10-9.porkrind.org Package: Org-mode version 8.3.1 (8.3.1-95-g1dbb25-elpa) current state: ============== (setq org-tab-first-hook '(org-hide-block-toggle-maybe org-babel-hide-result-toggle-maybe org-babel-header-arg-expand) org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook) org-occur-hook '(org-first-headline-recenter) org-metaup-hook '(org-babel-load-in-session-maybe) org-html-format-drawer-function '(lambda (name contents) contents) org-latex-format-inlinetask-function 'org-latex-format-inlinetask-default-function org-confirm-shell-link-function 'yes-or-no-p org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default org-latex-format-headline-function 'org-latex-format-headline-default-function org-after-todo-state-change-hook '(org-clock-out-if-current) org-latex-format-drawer-function '(lambda (name contents) contents) org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer) org-agenda-before-write-hook '(org-agenda-add-entry-text) org-babel-pre-tangle-hook '(save-buffer) org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-show-block-all append local] 5] #[nil "\300\301\302\303\304$\207" [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5] org-babel-result-hide-spec org-babel-hide-all-hashes) org-archive-hook '(org-attach-archive-delete-maybe) org-ascii-format-drawer-function '(lambda (name contents width) contents) org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-confirm-elisp-link-function 'yes-or-no-p org-metadown-hook '(org-babel-pop-to-session-maybe) org-html-format-headline-function 'org-html-format-headline-default-function org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function org-clock-out-hook '(org-clock-remove-empty-clock-drawer) ) --001a113fe5fac30798051eb3878c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I want to export a subtree of a file, but that s= ubtree has links to
headings in the file that are outside of the = subtree. I expect the
exporting process to produce some sort of v= alid result, but instead it
throws an "Unable to resolve lin= k" error. Here's a test file to
reproduce:
* Foo
* Bar :export:
[[*Foo][Foo]]

Making a file with those contents and trying to export it = to e.g.
latex will fail, but if the :export: tag is removed, expo= rting
succeeds. I can't easily get a backtrace because the er= ror comes from
user-error, but it happens in org-export-resolve-f= uzzy-link.

Of course the exported file can't l= ink to a target that doesn't exist,
but it's probably bet= ter to strip out the link in this case than to
throw an error, ri= ght?

Emacs =C2=A0: GNU Emacs 24.4.1 (x86_64-= apple-darwin13.4.0, NS apple-appkit-1265.21)
=C2=A0of 2014-10-20 = on builder10-9.porkrind.org=
Package: Org-mode version 8.3.1 (8.3.1-95-g1dbb25-elpa)

current state:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D
(setq
=C2=A0org-tab-first-hook '(org-hide= -block-toggle-maybe
= =C2=A0 =C2=A0 =C2=A0org-babel-hide-result-toggle-maybe
=C2=A0 =C2=A0 =C2=A0org-= babel-header-arg-expand)
=C2=A0org-speed-command-hook '(org-s= peed-command-default-hook
=C2=A0org-babel-speed-command-hook)
=C2=A0org-occu= r-hook '(org-first-headline-recenter)
=C2=A0org-metaup-hook &= #39;(org-babel-load-in-session-maybe)
=C2=A0org-html-format-drawe= r-function '(lambda (name contents) contents)
=C2=A0org-latex= -format-inlinetask-function 'org-latex-format-inlinetask-default-functi= on
=C2=A0org-confirm-shell-link-function 'yes-or-no-p
=C2=A0org-ascii-format-inlinetask-function 'org-ascii-format-inlinet= ask-default
=C2=A0org-latex-format-headline-function 'org-lat= ex-format-headline-default-function
=C2=A0org-after-todo-state-ch= ange-hook '(org-clock-out-if-current)
=C2=A0org-latex-format-= drawer-function '(lambda (name contents) contents)
=C2=A0org-= src-mode-hook '(org-src-babel-configure-edit-buffer
=C2=A0 =C2=A0 org-src-mode-conf= igure-edit-buffer)
=C2=A0org-agenda-before-write-hook '(org-a= genda-add-entry-text)
=C2=A0org-babel-pre-tangle-hook '(save-= buffer)
=C2=A0org-mode-hook '(#[nil "\300\301\302\303\30= 4$\207"
= =C2=A0 [org-add-hook change-major-mode-hook org-show-block-all
<= span class=3D"" style=3D"white-space:pre"> =C2=A0 =C2=A0append loc= al]
=C2=A0 5= ]
#[nil &quo= t;\300\301\302\303\304$\207"
=C2=A0 [org-add-hook change-major-mode-hook
=C2=A0 =C2=A0org-babe= l-show-result-all append local]
=C2=A0 5]
org-babel-result-hide-spec org-babel-hide-all-hashes)
=C2=A0org-archive-hook '(org-attach-archive-delete-maybe)
<= div>=C2=A0org-ascii-format-drawer-function '(lambda (name contents widt= h) contents)
=C2=A0org-ctrl-c-ctrl-c-hook '(org-babel-hash-at= -point
=C2= =A0org-babel-execute-safely-maybe)
=C2=A0org-cycle-hook '(org= -cycle-hide-archived-subtrees org-cycle-hide-drawers
=C2=A0org-cycle-show-empty-lines<= /div>
=C2=A0org-op= timize-window-after-visibility-change)
=C2=A0org-confirm-elisp-li= nk-function 'yes-or-no-p
=C2=A0org-metadown-hook '(org-ba= bel-pop-to-session-maybe)
=C2=A0org-html-format-headline-function= 'org-html-format-headline-default-function
=C2=A0org-html-fo= rmat-inlinetask-function 'org-html-format-inlinetask-default-function
=C2=A0org-clock-out-hook '(org-clock-remove-empty-clock-drawer= )
=C2=A0)

--001a113fe5fac30798051eb3878c--