From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export Date: Sun, 15 Mar 2015 09:44:45 +0100 Message-ID: <8761a23b0i.fsf@nicolasgoaziou.fr> 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: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtKF-0005kP-UD for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:22:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXtK9-0000OH-Rc for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:22:35 -0400 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:38571) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXtK9-0000O7-Ln for emacs-orgmode@gnu.org; Tue, 17 Mar 2015 11:22:29 -0400 In-Reply-To: (Jacob Gerlach's message of "Wed, 11 Mar 2015 22:55:48 -0400") 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: Jacob Gerlach Cc: Org-mode Jacob Gerlach writes: > Patch attached for fuzzy links. Thank you. > 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 No, the whole body could be wrapped with an `or': (or (org-element-map ...) (user-error "Unable to resolve code reference: %s" ref)) > 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? Yes, it is. > If so, is it desirable for org-id-find-id-file to fall back on the > current buffer (the current behavior)? According to its docstring, `org-id-find-id-file' returns nil when search failed. Isn't it the case? > 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. `org-export-resolve-id-link' could throw an error, indeed. > Subject: [PATCH] ox.el: Issue error for unresolved fuzzy link > > * lisp/org-capture.el (org-export-resolve-fuzzy-link): throw error ^^^^^^^^^^^ wrong file You need to capitalize sentence: "Throw an error" > instead of returning nil when link can't be resolved. > > * testing/lisp/test-ox.el (test-org-export/resolve-fuzzy-link): change > last test from should-not to should-error Ditto. > + ;; No destination found: error. > + (unless match-title-p > + (error (format "Unable to resolve link \"%s\"" raw-path))))))))) You don't need to check `match-title-p' here. Also, it should be `user-error' instead of `error'. Regards,