From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Gerlach Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export Date: Wed, 11 Mar 2015 22:55:48 -0400 Message-ID: References: <87k34zqv9r.fsf@gmail.com> <87bnqbv27b.fsf@nicolasgoaziou.fr> <87fvfjow6p.fsf@gmail.com> <8738bi13te.fsf@gmx.us> <87zjdkl7h0.fsf@gmail.com> <87zjdkw7jt.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a1133746c5d7a1f05110e85c6 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVtHu-0008Hg-48 for emacs-orgmode@gnu.org; Wed, 11 Mar 2015 22:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVtHo-0002VC-Sq for emacs-orgmode@gnu.org; Wed, 11 Mar 2015 22:55:54 -0400 Received: from mail-qc0-x230.google.com ([2607:f8b0:400d:c01::230]:42920) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVtHo-0002V2-NG for emacs-orgmode@gnu.org; Wed, 11 Mar 2015 22:55:48 -0400 Received: by qcwb13 with SMTP id b13so15443542qcw.9 for ; Wed, 11 Mar 2015 19:55:48 -0700 (PDT) In-Reply-To: <87zjdkw7jt.fsf@nicolasgoaziou.fr> 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: Org-mode --001a1133746c5d7a1f05110e85c6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, Sep 28, 2014 at 3:03 AM, Nicolas Goaziou w= rote: > Aaron Ecay writes: >> The links issue (re-)raised by Jacob in >> >> is a bit harder to deal with, since each backend currently does >> something a little different. It would be possible to make every >> backend=E2=80=99s org-X-link function error out at the end, but I=E2=80= =99m not sure >> if that=E2=80=99s the right thing to do or not. > > A more workable solution would be to focus on internal links only and > patch `org-export-resolve-id-link', `org-export-resolve-fuzzy-link', > `org-export-resolve-coderef' (not needed for radio links). Patch attached for fuzzy links. I don't really use code blocks, so I wasn't sure what to do with org-export-resolve-coderef. Should the final (when (re-search... (cond ... become (or (re-search... (cond ... (error ID links are tricky. AFAICT, an invalid id link will always resolve to the file it's contained in. The last check in org-export-resolve-id-link is looking for the id in `:id-alist'. Is this the same `:id-alist' built in org-export-get-environment? If so, is it desirable for org-id-find-id-file to fall back on the current buffer (the current behavior)? It seems like this will mistakenly cause org-export-get-environment to think that the bad link is valid and pointing to an "external" file. IIUC, the fall back behavior doesn't occur inside org-test-with-parsed-data because buffer-file-name returns nil. I don't know the implications of changing org-id-find-id-file. The fall back behavior was introduced in ac83bc01 when org-id was mostly rewritten. Removing the fall back behavior doesn't cause any failures on `make test'. If it's acceptable to remove the fall back, I can provide a similar patch for org-export-resolve-id-link. Example, foo.org: [[id:points-nowhere]] [[id:this-one-too][also bad]] Exports (latex) to: \url{foo.org} \href{foo.org}{also bad} Regards, Jake --001a1133746c5d7a1f05110e85c6 Content-Type: text/x-patch; charset=US-ASCII; name="0001-ox.el-Issue-error-for-unresolved-fuzzy-link.patch" Content-Disposition: attachment; filename="0001-ox.el-Issue-error-for-unresolved-fuzzy-link.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i75kbo5h0 RnJvbSAyMGY4NDQyMGE4NDk5N2ZjMGUxNWRmNWFmMmU2NWIzY2ZkZTg3YWMxIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBKYWNvYiBHZXJsYWNoIDxqYWNvYmdlcmxhY2hAZ21haWwuY29t PgpEYXRlOiBXZWQsIDExIE1hciAyMDE1IDIyOjM5OjExIC0wNDAwClN1YmplY3Q6IFtQQVRDSF0g b3guZWw6IElzc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