emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] [PATCH] Warn about unexpanded macros on export


From: Aaron Ecay
Subject: Re: [O] [RFC] [PATCH] Warn about unexpanded macros on export
Date: Sun, 12 Oct 2014 16:48:45 +0100
User-agent: Notmuch/0.18.1+51~gbbbdf04 (http://notmuchmail.org) Emacs/24.4.50.2 (x86_64-unknown-linux-gnu)

Hi Nicolas,

2014ko irailak 28an, Nicolas Goaziou-ek idatzi zuen:
> 
> Hello,
> 
> Aaron Ecay <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]