emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Yagnesh Raghava Yakkala <yagnesh@live.com>
To: emacs-orgmode@gnu.org
Subject: Re: Macros [was: Re: ATTR_HTML for a clickable image, howto?]
Date: Sun, 20 May 2012 17:34:49 +0900	[thread overview]
Message-ID: <87pq9zz1w6.fsf@okhotsk19.lowtem.hokudai.ac.jp> (raw)
In-Reply-To: 87txzbcmbm.fsf@gmail.com


Hello Nicolas,

Nicolas Goaziou <n.goaziou@gmail.com> writes:
> #+TITLE: Macro test
> #+MACRO: test2 recursive $1
> #+MACRO: test A {{{test2(inner)}}} macro, $1.
> #+MACRO: html-builder (eval (+ $1 $2))
>
>
> {{{test(and an outer one)}}}
>
> Some complex macro {{{html-builder(1,2)}}}.


out of curiosity I tried to export above snippet. it is working nice except for
new exporter latex option. (org-export-dispatch and d option)

here is the back trace:

--8<---------------cut here---------------start------------->8---
Debugger entered--Lisp error: (void-variable \1)
  (+ \1 \2)
  (eval (+ \1 \2))
  eval((eval (+ \1 \2)))
  (setq value (eval (read value)))
  (progn (setq value (eval (read value))))
  (if (string-match "\\`(eval\\>" value) (progn (setq value (eval (read value)))))
  (when (string-match "\\`(eval\\>" value) (setq value (eval (read value))))
  (let* ((key (org-element-property :key macro)) (args (org-element-property :args macro)) (value (org-export-data (plist-get info (intern (format ":macro-%s" key))) info))) (let ((s 0) n) (while (string-match "\\$\\([0-9]+\\)" value s) (setq s (1+ (match-beginning 0)) n (string-to-number (match-string 1 value))) (and (>= (length args) n) (setq value (replace-match (nth (1- n) args) t t value))))) (when (string-match "\\`(eval\\>" value) (setq value (eval (read value)))) (format "%s" (or value "")))
  org-export-expand-macro((macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  org-e-latex-macro((macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) nil (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  funcall(org-e-latex-macro (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) nil (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  (and (fboundp transcoder) (funcall transcoder data nil info))
  (let ((transcoder (org-export-transcoder data info))) (and (fboundp transcoder) (funcall transcoder data nil info)))
  (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let ((transcoder (org-export-transcoder data info))) (if transcoder (funcall transcoder data info) data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat (lambda (blob) (org-export-data blob info)) (org-element-contents data) "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type (quote headline)) (eq (plist-get info :with-archived-trees) (quote headline)) (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and ... ...)) (contents (mapconcat ... ... ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))))
  (let* ((type (org-element-type data)) (results (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let (...) (if transcoder ... data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat ... ... "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type ...) (eq ... ...) (org-element-property :archivedp data))) (let ((transcoder ...)) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder ...)) (when transcoder (let* ... ...))))))) (cond ((not results) nil) ((memq type (quote (org-data plain-text nil))) results) (t (let ((results (org-export-filter-apply-functions (plist-get info ...) (let ... ...) info))) results))))
  org-export-data((macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  (lambda (element) (org-export-data element info))((macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)))
  mapconcat((lambda (element) (org-export-data element info)) ("Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) ".") "")
  (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data (when ... ...)))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))
  (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (if transcoder (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let ((transcoder (org-export-transcoder data info))) (if transcoder (funcall transcoder data info) data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat (lambda (blob) (org-export-data blob info)) (org-element-contents data) "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type (quote headline)) (eq (plist-get info :with-archived-trees) (quote headline)) (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and ... ...)) (contents (mapconcat ... ... ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))))
  (let* ((type (org-element-type data)) (results (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let (...) (if transcoder ... data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat ... ... "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type ...) (eq ... ...) (org-element-property :archivedp data))) (let ((transcoder ...)) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder ...)) (when transcoder (let* ... ...))))))) (cond ((not results) nil) ((memq type (quote (org-data plain-text nil))) results) (t (let ((results (org-export-filter-apply-functions (plist-get info ...) (let ... ...) info))) results))))
  org-export-data((paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) ".") (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  (lambda (element) (org-export-data element info))((paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) "."))
  mapconcat((lambda (element) (org-export-data element info)) ((keyword (:key "TITLE" :value "Macro test" :begin 1 :end 21 :post-blank 0)) (keyword (:key "MACRO" :value "test2 recursive $1" :begin 21 :end 49 :post-blank 0)) (keyword (:key "MACRO" :value "test A {{{test2(inner)}}} macro, $1." :begin 49 :end 95 :post-blank 0)) (keyword (:key "MACRO" :value "html-builder (eval (+ $1 $2))" :begin 95 :end 136 :post-blank 2)) (paragraph (:begin 136 :end 166 :contents-begin 136 :contents-end 164 :post-blank 1) (macro (:key "test" :value "{{{test(and an outer one)}}}" :args ("and an outer one") :begin 136 :end 164 :post-blank 0))) (paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) ".")) "")
  (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data (when ... ...)))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))
  (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (if transcoder (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let ((transcoder (org-export-transcoder data info))) (if transcoder (funcall transcoder data info) data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat (lambda (blob) (org-export-data blob info)) (org-element-contents data) "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type (quote headline)) (eq (plist-get info :with-archived-trees) (quote headline)) (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and ... ...)) (contents (mapconcat ... ... ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))))
  (let* ((type (org-element-type data)) (results (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let (...) (if transcoder ... data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat ... ... "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type ...) (eq ... ...) (org-element-property :archivedp data))) (let ((transcoder ...)) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder ...)) (when transcoder (let* ... ...))))))) (cond ((not results) nil) ((memq type (quote (org-data plain-text nil))) results) (t (let ((results (org-export-filter-apply-functions (plist-get info ...) (let ... ...) info))) results))))
  org-export-data((section (:begin 1 :end 210 :contents-begin 1 :contents-end 210 :post-blank 0) (keyword (:key "TITLE" :value "Macro test" :begin 1 :end 21 :post-blank 0)) (keyword (:key "MACRO" :value "test2 recursive $1" :begin 21 :end 49 :post-blank 0)) (keyword (:key "MACRO" :value "test A {{{test2(inner)}}} macro, $1." :begin 49 :end 95 :post-blank 0)) (keyword (:key "MACRO" :value "html-builder (eval (+ $1 $2))" :begin 95 :end 136 :post-blank 2)) (paragraph (:begin 136 :end 166 :contents-begin 136 :contents-end 164 :post-blank 1) (macro (:key "test" :value "{{{test(and an outer one)}}}" :args ("and an outer one") :begin 136 :end 164 :post-blank 0))) (paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) ".")) (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  (lambda (element) (org-export-data element info))((section (:begin 1 :end 210 :contents-begin 1 :contents-end 210 :post-blank 0) (keyword (:key "TITLE" :value "Macro test" :begin 1 :end 21 :post-blank 0)) (keyword (:key "MACRO" :value "test2 recursive $1" :begin 21 :end 49 :post-blank 0)) (keyword (:key "MACRO" :value "test A {{{test2(inner)}}} macro, $1." :begin 49 :end 95 :post-blank 0)) (keyword (:key "MACRO" :value "html-builder (eval (+ $1 $2))" :begin 95 :end 136 :post-blank 2)) (paragraph (:begin 136 :end 166 :contents-begin 136 :contents-end 164 :post-blank 1) (macro (:key "test" :value "{{{test(and an outer one)}}}" :args ("and an outer one") :begin 136 :end 164 :post-blank 0))) (paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) ".")))
  mapconcat((lambda (element) (org-export-data element info)) ((section (:begin 1 :end 210 :contents-begin 1 :contents-end 210 :post-blank 0) (keyword (:key "TITLE" :value "Macro test" :begin 1 :end 21 :post-blank 0)) (keyword (:key "MACRO" :value "test2 recursive $1" :begin 21 :end 49 :post-blank 0)) (keyword (:key "MACRO" :value "test A {{{test2(inner)}}} macro, $1." :begin 49 :end 95 :post-blank 0)) (keyword (:key "MACRO" :value "html-builder (eval (+ $1 $2))" :begin 95 :end 136 :post-blank 2)) (paragraph (:begin 136 :end 166 :contents-begin 136 :contents-end 164 :post-blank 1) (macro (:key "test" :value "{{{test(and an outer one)}}}" :args ("and an outer one") :begin 136 :end 164 :post-blank 0))) (paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) "."))) "")
  (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data (when ... ...)))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))
  (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (if transcoder (progn (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if (or greaterp objectp) data (org-element-normalize-contents data ...))) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info)))
  (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and (not greaterp) (memq type org-element-recursive-objects))) (contents (mapconcat (lambda (element) (org-export-data element info)) (org-element-contents (if ... data ...)) ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))
  (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let ((transcoder (org-export-transcoder data info))) (if transcoder (funcall transcoder data info) data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat (lambda (blob) (org-export-data blob info)) (org-element-contents data) "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type (quote headline)) (eq (plist-get info :with-archived-trees) (quote headline)) (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder (org-export-transcoder data info))) (when transcoder (let* ((greaterp (memq type org-element-greater-elements)) (objectp (and ... ...)) (contents (mapconcat ... ... ""))) (funcall transcoder data (if greaterp (org-element-normalize-string contents) contents) info))))))
  (let* ((type (org-element-type data)) (results (cond ((member data (plist-get info :ignore-list)) nil) ((eq type (quote plain-text)) (org-export-filter-apply-functions (plist-get info :filter-plain-text) (let (...) (if transcoder ... data)) info)) ((not (org-export-interpret-p data info)) (org-export-data (org-export-expand data (mapconcat ... ... "")) info)) ((not type) (mapconcat (lambda (obj) (org-export-data obj info)) data "")) ((or (not (org-element-contents data)) (and (eq type ...) (eq ... ...) (org-element-property :archivedp data))) (let ((transcoder ...)) (and (fboundp transcoder) (funcall transcoder data nil info)))) (t (let ((transcoder ...)) (when transcoder (let* ... ...))))))) (cond ((not results) nil) ((memq type (quote (org-data plain-text nil))) results) (t (let ((results (org-export-filter-apply-functions (plist-get info ...) (let ... ...) info))) results))))
  org-export-data((org-data nil (section (:begin 1 :end 210 :contents-begin 1 :contents-end 210 :post-blank 0) (keyword (:key "TITLE" :value "Macro test" :begin 1 :end 21 :post-blank 0)) (keyword (:key "MACRO" :value "test2 recursive $1" :begin 21 :end 49 :post-blank 0)) (keyword (:key "MACRO" :value "test A {{{test2(inner)}}} macro, $1." :begin 49 :end 95 :post-blank 0)) (keyword (:key "MACRO" :value "html-builder (eval (+ $1 $2))" :begin 95 :end 136 :post-blank 2)) (paragraph (:begin 136 :end 166 :contents-begin 136 :contents-end 164 :post-blank 1) (macro (:key "test" :value "{{{test(and an outer one)}}}" :args ("and an outer one") :begin 136 :end 164 :post-blank 0))) (paragraph (:begin 166 :end 210 :contents-begin 166 :contents-end 209 :post-blank 0) "Some complex macro " (macro (:key "html-builder" :value "{{{html-builder(1,2)}}}" :args ("1" "2") :begin 185 :end 208 :post-blank 0)) "."))) (:author "Yagnesh Raghava Yakkala" :creator "Generated by Org mode 7.8.10 in Emacs 24.1.50.5." :date "\\today" :description nil :email "yagnesh@okhotsk19.lowtem.hokudai.ac.jp" :exclude-tags ("noexport") :headline-levels 3 :keywords nil :language "en" :preserve-breaks nil :section-numbers t :select-tags ("export") :time-stamp-file t :title ("Macro test") :with-archived-trees headline :with-author t :with-clocks nil :with-creator comment :with-drawers t :with-email nil :with-emphasize t :with-entities t :with-fixed-width t :with-footnotes t :with-plannings nil ...))
  (org-element-normalize-string (org-export-data tree info))
  (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not (fboundp template)) body-only) body (funcall template body info)) info))) (when org-export-copy-to-kill-ring (org-kill-new output)) output)
  (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf (or (buffer-file-name ...) (current-buffer)))) (org-export-with-current-buffer-copy (unless noexpand (org-export-expand-include-keyword) (let (...) (org-export-blocks-preprocess))) (goto-char (point-min)) (let ((org-export-current-backend backend)) (run-hooks (quote org-export-before-parsing-hook))) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) body (funcall template body info)) info))) (when org-export-copy-to-kill-ring (org-kill-new output)) output))
  (save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf (or ... ...))) (org-export-with-current-buffer-copy (unless noexpand (org-export-expand-include-keyword) (let ... ...)) (goto-char (point-min)) (let (...) (run-hooks ...)) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... body-only) body (funcall template body info)) info))) (when org-export-copy-to-kill-ring (org-kill-new output)) output)))
  (save-excursion (save-restriction (cond ((org-region-active-p) (narrow-to-region (region-beginning) (region-end))) (subtreep (org-narrow-to-subtree) (goto-char (point-min)) (forward-line) (narrow-to-region (point) (point-max)))) (let ((info (org-export-install-filters (org-export-store-footnote-definitions (org-export-get-environment backend subtreep ext-plist)))) (tree (let ((buf ...)) (org-export-with-current-buffer-copy (unless noexpand ... ...) (goto-char ...) (let ... ...) (org-element-parse-buffer nil visible-only))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) tree info)) (setq info (org-combine-plists info (org-export-collect-tree-properties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (intern (format "org-%s-template" backend))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... body ...) info))) (when org-export-copy-to-kill-ring (org-kill-new output)) output))))
  org-export-as(e-latex nil nil nil nil nil)
  (let ((out (org-export-as backend subtreep visible-only body-only ext-plist noexpand))) (with-temp-buffer (insert out) (let ((coding-system-for-write org-export-coding-system)) (write-file file))))
  org-export-to-file(e-latex "/tmp/org-scratch.tex" nil nil nil nil)
  (let ((outfile (org-export-output-file-name ".tex" subtreep pub-dir))) (org-export-to-file (quote e-latex) outfile subtreep visible-only body-only ext-plist))
  org-e-latex-export-to-latex(nil nil nil nil nil)
  (org-e-latex-compile (org-e-latex-export-to-latex subtreep visible-only body-only ext-plist pub-dir))
  org-e-latex-export-to-pdf(nil nil nil)
  (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))
  (cond ((eql --cl-var-- (quote 113)) nil) ((member* --cl-var-- (quote (65 78 85))) (let ((outbuf (org-export-to-buffer (quote e-ascii) "*Org E-ASCII Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset ...))))) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((member* --cl-var-- (quote (97 110 117))) (org-e-ascii-export-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key (97 ...) (110 ...) (t ...))))))) ((eql --cl-var-- (quote 76)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 108)) (org-e-latex-export-to-latex (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 112)) (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 100)) (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 72)) (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 104)) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 98)) (org-open-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 111)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 79)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 70)) (org-e-publish-current-file (memq (quote force) optns))) ((eql --cl-var-- (quote 80)) (org-e-publish-current-project (memq (quote force) optns))) ((eql --cl-var-- (quote 88)) (let ((project (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist))) (org-e-publish project (memq (quote force) optns)))) ((eql --cl-var-- (quote 69)) (org-e-publish-all (memq (quote force) optns))) (t (error "No command associated with key %s" (char-to-string raw-key))))
  (let ((--cl-var-- (if (< raw-key 27) (+ raw-key 96) raw-key))) (cond ((eql --cl-var-- (quote 113)) nil) ((member* --cl-var-- (quote (65 78 85))) (let ((outbuf (org-export-to-buffer (quote e-ascii) "*Org E-ASCII Export*" (memq ... optns) (memq ... optns) (memq ... optns) (\` ...)))) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((member* --cl-var-- (quote (97 110 117))) (org-e-ascii-export-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key ... ... ...)))))) ((eql --cl-var-- (quote 76)) (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 108)) (org-e-latex-export-to-latex (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 112)) (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 100)) (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 72)) (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((eql --cl-var-- (quote 104)) (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 98)) (org-open-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 111)) (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) ((eql --cl-var-- (quote 79)) (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) ((eql --cl-var-- (quote 70)) (org-e-publish-current-file (memq (quote force) optns))) ((eql --cl-var-- (quote 80)) (org-e-publish-current-project (memq (quote force) optns))) ((eql --cl-var-- (quote 88)) (let ((project (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist))) (org-e-publish project (memq (quote force) optns)))) ((eql --cl-var-- (quote 69)) (org-e-publish-all (memq (quote force) optns))) (t (error "No command associated with key %s" (char-to-string raw-key)))))
  (case (if (< raw-key 27) (+ raw-key 96) raw-key) (113 nil) ((65 78 85) (let ((outbuf (org-export-to-buffer (quote e-ascii) "*Org E-ASCII Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset ...))))) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((97 110 117) (org-e-ascii-export-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key (97 ...) (110 ...) (t ...))))))) (76 (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (108 (org-e-latex-export-to-latex (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (112 (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (100 (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (72 (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (104 (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (98 (org-open-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (111 (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (79 (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (70 (org-e-publish-current-file (memq (quote force) optns))) (80 (org-e-publish-current-project (memq (quote force) optns))) (88 (let ((project (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist))) (org-e-publish project (memq (quote force) optns)))) (69 (org-e-publish-all (memq (quote force) optns))) (t (error "No command associated with key %s" (char-to-string raw-key))))
  (let* ((input (org-export-dispatch-ui (if (listp org-export-initial-scope) org-export-initial-scope (list org-export-initial-scope)) org-export-dispatch-use-expert-ui)) (raw-key (car input)) (optns (cdr input))) (case (if (< raw-key 27) (+ raw-key 96) raw-key) (113 nil) ((65 78 85) (let ((outbuf (org-export-to-buffer (quote e-ascii) "*Org E-ASCII Export*" (memq ... optns) (memq ... optns) (memq ... optns) (\` ...)))) (with-current-buffer outbuf (text-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) ((97 110 117) (org-e-ascii-export-to-ascii (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns) (\` (:ascii-charset (\, (case raw-key ... ... ...)))))) (76 (let ((outbuf (org-export-to-buffer (quote e-latex) "*Org E-LaTeX Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (latex-mode)) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (108 (org-e-latex-export-to-latex (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (112 (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (100 (org-open-file (org-e-latex-export-to-pdf (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (72 (let ((outbuf (org-export-to-buffer (quote e-html) "*Org E-HTML Export*" (memq ... optns) (memq ... optns) (memq ... optns)))) (with-current-buffer outbuf (if (featurep (quote nxhtml-mode)) (nxhtml-mode) (nxml-mode))) (when org-export-show-temporary-export-buffer (switch-to-buffer-other-window outbuf)))) (104 (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (98 (org-open-file (org-e-html-export-to-html (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (111 (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))) (79 (org-open-file (org-e-odt-export-to-odt (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns)))) (70 (org-e-publish-current-file (memq (quote force) optns))) (80 (org-e-publish-current-project (memq (quote force) optns))) (88 (let ((project (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist))) (org-e-publish project (memq (quote force) optns)))) (69 (org-e-publish-all (memq (quote force) optns))) (t (error "No command associated with key %s" (char-to-string raw-key)))))
  org-export-dispatch()
  call-interactively(org-export-dispatch record nil)
  command-execute(org-export-dispatch record)
  execute-extended-command(nil "org-export-dispatch")
  call-interactively(execute-extended-command nil nil)
--8<---------------cut here---------------end--------------->8---

org version: pulled a while ago.
Org-mode version 7.8.10 (release_7.8.10-574-g57cfa6 @ /home/yagnesh/.emacs.d/el-get/org-mode/lisp/)

-- 
ఎందరో మహానుభావులు అందరికి వందనములు
YYR

  reply	other threads:[~2012-05-20  8:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-01 21:27 ATTR_HTML for a clickable image, howto? François Pinard
2012-04-02  8:14 ` Bastien
2012-04-02 10:34   ` Christian Moe
2012-04-02 15:06     ` Bastien
2012-04-02 21:30       ` Samuel Wales
2012-04-03  5:42         ` Bastien
2012-04-05 23:34           ` Samuel Wales
2012-04-05 15:02   ` François Pinard
2012-04-06  8:52     ` Christian Moe
2012-04-06  9:29       ` Christian Moe
2012-04-06 18:41       ` Samuel Wales
2012-04-06 18:45         ` Samuel Wales
2012-04-07 13:15         ` Christian Moe
2012-04-10 23:53           ` Samuel Wales
2012-04-11  8:11             ` Christian Moe
2012-05-12  0:43               ` Samuel Wales
2012-05-20  1:00               ` Macros [was: Re: ATTR_HTML for a clickable image, howto?] François Pinard
2012-05-20  8:02                 ` Nicolas Goaziou
2012-05-20  8:34                   ` Yagnesh Raghava Yakkala [this message]
2012-05-20 10:24                     ` Nicolas Goaziou
2012-05-22 23:23                 ` Bastien
2012-07-05 14:40                 ` Bastien
2012-07-05 15:09                   ` Nicolas Goaziou
2012-07-05 15:51                     ` Sebastien Vauban
2012-07-05 20:44                       ` Nicolas Goaziou
2012-08-05  9:19                     ` Bastien
2012-05-20  0:39           ` ATTR_HTML for a clickable image, howto? François Pinard
2012-04-06  9:02     ` Bastien

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=87pq9zz1w6.fsf@okhotsk19.lowtem.hokudai.ac.jp \
    --to=yagnesh@live.com \
    --cc=emacs-orgmode@gnu.org \
    /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).