emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Jacob Gerlach <jacobgerlach@gmail.com>
Cc: Org-mode <emacs-orgmode@gnu.org>
Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export
Date: Sun, 15 Mar 2015 09:44:45 +0100	[thread overview]
Message-ID: <8761a23b0i.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <CAA6UvuEPDwjCOG9o1MYxsqk6eUN3muYBqeLRj670FKQ2iAPK8A@mail.gmail.com> (Jacob Gerlach's message of "Wed, 11 Mar 2015 22:55:48 -0400")

Jacob Gerlach <jacobgerlach@gmail.com> 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,

  reply	other threads:[~2015-03-17 15:22 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-19 19:12 [RFC] [PATCH] Warn about unexpanded macros on export Aaron Ecay
2014-09-19 19:29 ` Nicolas Goaziou
2014-09-23  3:25   ` Aaron Ecay
2014-09-23 16:59     ` Grant Rettke
2014-09-23 17:18       ` Aaron Ecay
2014-09-23 17:29         ` Jacob Gerlach
2014-09-23 21:10           ` Nicolas Goaziou
2014-09-23 20:24     ` Nicolas Goaziou
2014-09-28  3:53       ` Aaron Ecay
2014-09-28  6:59         ` Nicolas Goaziou
2014-10-12 15:48           ` Aaron Ecay
2014-09-23 20:26     ` Rasmus
2014-09-28  4:00       ` Aaron Ecay
2014-09-28  7:03         ` Nicolas Goaziou
2014-10-12 15:49           ` Aaron Ecay
2014-10-12 17:19             ` Nicolas Goaziou
2015-03-12  2:55           ` Jacob Gerlach
2015-03-15  8:44             ` Nicolas Goaziou [this message]
2015-03-17 16:20               ` Jacob Gerlach
2015-03-17 22:38                 ` Nicolas Goaziou
2015-03-18 20:25                   ` Jacob Gerlach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8761a23b0i.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=jacobgerlach@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).