Hello, Aaron Ecay <aarone...@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. Regards, -- Nicolas Goaziou