From: Aaron Ecay <aaronecay@gmail.com>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>,
Org-mode <emacs-orgmode@gnu.org>
Subject: Re: [RFC] [PATCH] Warn about unexpanded macros on export
Date: Sun, 12 Oct 2014 16:48:45 +0100 [thread overview]
Message-ID: <87d29xi90i.fsf@gmail.com> (raw)
In-Reply-To: <874mvsxmbn.fsf@nicolasgoaziou.fr>
Hi Nicolas,
2014ko irailak 28an, Nicolas Goaziou-ek idatzi zuen:
>
> Hello,
>
> Aaron Ecay <aaronecay@gmail.com> writes:
>
>> Attached is a revised patch. WDYT?
>
> Looks good. Some small comments follow.
>
>> + (if value
>> + (progn
>> + (push signature record)
>> + (delete-region
>> + begin
>> + ;; Preserve white spaces after the macro.
>> + (progn (goto-char (org-element-property :end object))
>> + (skip-chars-backward " \t")
>> + (point)))
>> + ;; Leave point before replacement in case of recursive
>> + ;; expansions.
>> + (save-excursion (insert value)))
>> + (when finalize
>> + (error "Macro %s was undefined at line %s"
>> + (org-element-property :key object)
>> + (line-number-at-pos))))))))))))
>
> Nitpick: I find the following more readable
>
> (cond (value (push signature record)
> ...)
> (finalize (error ...)))
>
> Also, don't provide error line as macro are replaced after include
> keywords are expanded. IOW, in some cases, the line number will be
> misleading. The key is sufficient, e.g.,
>
> (error "Undefined Org macro: %s. Aborting"
> (org-element-property :key object))
>
> You can commit it once this is fixed. Thank you for the patch.
Pushed; thanks for the feedback.
--
Aaron Ecay
next prev parent reply other threads:[~2014-10-12 15:49 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87d29xi90i.fsf@gmail.com \
--to=aaronecay@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=mail@nicolasgoaziou.fr \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.