emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [new exporter] Date format string not handled for LaTeX export
@ 2012-10-29  3:41 Michael Gauland
  2012-10-29 13:04 ` Nicolas Goaziou
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Gauland @ 2012-10-29  3:41 UTC (permalink / raw)
  To: emacs-orgmode

When I provide a format string to the #+DATE: option, the old LaTeX exporter
correctly uses it to format the current date; the new exporter just uses the
format string for the date.

The new HTML exporter does not have this problem.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29  3:41 [new exporter] Date format string not handled for LaTeX export Michael Gauland
@ 2012-10-29 13:04 ` Nicolas Goaziou
  2012-10-29 21:25   ` Michael Gauland
  0 siblings, 1 reply; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-29 13:04 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Hello,

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> When I provide a format string to the #+DATE: option, the old LaTeX exporter
> correctly uses it to format the current date; the new exporter just uses the
> format string for the date.

I wasn't aware of that "feature". Though, I don't like it: it is fragile
for technical reasons (it may or may not work on every exporter) and it
adds yet another special rule to remember.

On the other hand, you have a hard-coded macro to solve this problem:

  #+DATE: {{{time(%c)}}}

It will work across every back-end (but you need the latest Org version,
since I recently to fixed a bug related to it).

> The new HTML exporter does not have this problem.

I am going to remove this hack from new back-ends as it isn't necessary.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 13:04 ` Nicolas Goaziou
@ 2012-10-29 21:25   ` Michael Gauland
  2012-10-29 21:46     ` Nicolas Goaziou
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Gauland @ 2012-10-29 21:25 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
> On the other hand, you have a hard-coded macro to solve this problem:
> 
>   #+DATE: {{{time(%c)}}}
> 
> It will work across every back-end (but you need the latest Org version,
> since I recently to fixed a bug related to it).

Thanks--that will do nicely. Unfortunately, I can't seem to get it working. When
I export to HTML, I get a blank date; when I try to export to LaTeX, the
exporter doesn't appear to do anything. After hitting ^G, the .tex file is
unchanged.

I've grabbed the latest from git
(commit 1f3a2c42c6317a4b0e97b237f079c51f0028cc90).

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 21:25   ` Michael Gauland
@ 2012-10-29 21:46     ` Nicolas Goaziou
  2012-10-29 22:55       ` Michael Gauland
  0 siblings, 1 reply; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-29 21:46 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
>> On the other hand, you have a hard-coded macro to solve this problem:
>> 
>>   #+DATE: {{{time(%c)}}}
>> 
>> It will work across every back-end (but you need the latest Org version,
>> since I recently to fixed a bug related to it).
>
> Thanks--that will do nicely. Unfortunately, I can't seem to get it working. When
> I export to HTML, I get a blank date; when I try to export to LaTeX, the
> exporter doesn't appear to do anything. After hitting ^G, the .tex file is
> unchanged.

I just tried with a minimal init and it worked. Could you send the
example you're trying to export?

Thank you.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 21:46     ` Nicolas Goaziou
@ 2012-10-29 22:55       ` Michael Gauland
  2012-10-29 23:05         ` Nick Dokos
  0 siblings, 1 reply; 18+ messages in thread
From: Michael Gauland @ 2012-10-29 22:55 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:

> I just tried with a minimal init and it worked. Could you send the
> example you're trying to export?

The file is below. With a minimal init, I get the error "Symbol's function
definition is void: org-macro-initialize-templates'. If I use my full .emacs
file, the exporter just seems to freeze up.

------ test.org -----
#+DATE: {{{date(%c)}}}

This ia a test file.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 22:55       ` Michael Gauland
@ 2012-10-29 23:05         ` Nick Dokos
  2012-10-30  7:14           ` Nicolas Goaziou
  2012-10-30  8:58           ` Eric S Fraga
  0 siblings, 2 replies; 18+ messages in thread
From: Nick Dokos @ 2012-10-29 23:05 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Michael Gauland <mikelygee@no8wireless.co.nz> wrote:

> Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
> 
> > I just tried with a minimal init and it worked. Could you send the
> > example you're trying to export?
> 
> The file is below. With a minimal init, I get the error "Symbol's function
> definition is void: org-macro-initialize-templates'. If I use my full .emacs
> file, the exporter just seems to freeze up.
> 
> ------ test.org -----
> #+DATE: {{{date(%c)}}}
> 
> This ia a test file.
> 
> 
> 

With a minimal file, I get a cpu pegged at 100% with no end in
sight. Setting debug-on-quit and C-g gives me the following backtrace.

Org-mode version 7.9.2 (release_7.9.2-533-g07c889 @ /home/nick/elisp/org-mode/lisp/)

Nick


Debugger entered--Lisp error: (quit)
  mapc((lambda (type) (let* ((successor-fun (intern (format "org-element-%s-successor" (or (cdr ...) type)))) (obj (funcall successor-fun limit))) (and obj (setq next-candidates (cons obj next-candidates))))) (inline-babel-call inline-src-block latex-or-entity link macro sub/superscript text-markup))
  (let (next-candidates types-to-search) (if (not objects) (setq types-to-search restriction) (mapc (function (lambda (obj) (if (< (cdr obj) (point)) (setq types-to-search (cons ... types-to-search)) (setq next-candidates (cons obj next-candidates))))) objects)) (mapc (function (lambda (type) (let* ((successor-fun (intern ...)) (obj (funcall successor-fun limit))) (and obj (setq next-candidates (cons obj next-candidates)))))) types-to-search) next-candidates)
  org-element--get-next-object-candidates(23 (inline-babel-call inline-src-block latex-or-entity link macro sub/superscript text-markup) nil)
  (setq candidates (org-element--get-next-object-candidates end restriction candidates))
  (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let ((closest-cand (rassq (apply (quote min) (mapcar (quote cdr) candidates)) candidates))) (if (> (cdr closest-cand) origin) (throw (quote exit) parent) (let* ((object (progn (goto-char ...) (funcall ...))) (cbeg (org-element-property :contents-begin object)) (cend (org-element-property :contents-end object))) (cond ((< (org-element-property :end object) origin) (goto-char (org-element-property :end object))) ((or (not cbeg) (> cbeg origin) (< cend origin)) (throw (quote exit) (org-element-put-property object :parent parent))) (t (goto-char cbeg) (org-element-put-property object :parent parent) (setq parent object restriction (org-element-restriction object) end cend)))))))
  (catch (quote exit) (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let ((closest-cand (rassq (apply (quote min) (mapcar ... candidates)) candidates))) (if (> (cdr closest-cand) origin) (throw (quote exit) parent) (let* ((object (progn ... ...)) (cbeg (org-element-property :contents-begin object)) (cend (org-element-property :contents-end object))) (cond ((< ... origin) (goto-char ...)) ((or ... ... ...) (throw ... ...)) (t (goto-char cbeg) (org-element-put-property object :parent parent) (setq parent object restriction ... end cend))))))) parent)
  (let ((restriction (org-element-restriction type)) (parent element) candidates) (catch (quote exit) (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let ((closest-cand (rassq (apply ... ...) candidates))) (if (> (cdr closest-cand) origin) (throw (quote exit) parent) (let* ((object ...) (cbeg ...) (cend ...)) (cond (... ...) (... ...) (t ... ... ...)))))) parent))
  (if (not (or (let ((post (org-element-property :post-affiliated element))) (and post (> post origin) (< (org-element-property :begin element) origin) (progn (beginning-of-line) (looking-at org-element--affiliated-re) (member (upcase ...) org-element-parsed-keywords)) (setq type (quote keyword)) (if (and (match-end 2) (<= origin ...)) (progn (goto-char ...) (setq end ...)) (goto-char (match-end 0)) (setq end (line-end-position))))) (and (eq type (quote item)) (let ((tag (org-element-property :tag element))) (and tag (progn (beginning-of-line) (search-forward tag ...) (goto-char ...) (and ... ...))))) (and (memq type (quote (headline inlinetask))) (progn (beginning-of-line) (skip-chars-forward "* ") (setq end (point-at-eol)))) (and (memq type (quote (paragraph table-row verse-block))) (let
  ((cbeg (org-element-property :contents-begin element)) (cend (org-element-property :contents-end element))) (and (>= origin cbeg) (<= origin cend) (progn (goto-char cbeg) (setq end cend))))
 ) (and (eq type (quote keyword)) (let ((key (org-element-property :key element))) (and (member key org-element-document-properties) (progn (beginning-of-line) (search-forward key ... t) (forward-char) (setq end ...))))))) element (let ((restriction (org-element-restriction type)) (parent element) candidates) (catch (quote exit) (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let ((closest-cand (rassq ... candidates))) (if (> (cdr closest-cand) origin) (throw (quote exit) parent) (let* (... ... ...) (cond ... ... ...))))) parent)))
  (let* ((origin (point)) (element (org-element-at-point)) (type (car element)) end) (if (not (or (let ((post (org-element-property :post-affiliated element))) (and post (> post origin) (< (org-element-property :begin element) origin) (progn (beginning-of-line) (looking-at org-element--affiliated-re) (member ... org-element-parsed-keywords)) (setq type (quote keyword)) (if (and ... ...) (progn ... ...) (goto-char ...) (setq end ...)))) (and (eq type (quote item)) (let ((tag ...)) (and tag (progn ... ... ... ...)))) (and (memq type (quote (headline inlinetask))) (progn (beginning-of-line) (skip-chars-forward "* ") (setq end (point-at-eol)))) (and (memq type (quote (paragraph table-row verse-block))) (let ((cbeg ...) (cend ...)) (and (>= origin cbeg) (<= origin cend) (progn ... ...)))) (and 
 (eq type (quote keyword)) (let ((key ...)) (and (member key org-element-document-properties) (progn ... ... ... ...)))))) element (let ((restriction (org-element-restriction type)) (parent e
 lement) candidates) (catch (quote exit) (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let ((closest-cand ...)) (if (> ... origin) (throw ... parent) (let* ... ...)))) parent))))
  (save-restriction (widen) (let* ((origin (point)) (element (org-element-at-point)) (type (car element)) end) (if (not (or (let ((post ...)) (and post (> post origin) (< ... origin) (progn ... ... ...) (setq type ...) (if ... ... ... ...))) (and (eq type (quote item)) (let (...) (and tag ...))) (and (memq type (quote ...)) (progn (beginning-of-line) (skip-chars-forward "* ") (setq end ...))) (and (memq type (quote ...)) (let (... ...) (and ... ... ...))) (and (eq type (quote keyword)) (let (...) (and ... ...))))) element (let ((restriction (org-element-restriction type)) (parent element) candidates) (catch (quote exit) (while (setq candidates (org-element--get-next-object-candidates end restriction candidates)) (let (...) (if ... ... ...))) parent)))))
  (save-excursion (save-restriction (widen) (let* ((origin (point)) (element (org-element-at-point)) (type (car element)) end) (if (not (or (let (...) (and post ... ... ... ... ...)) (and (eq type ...) (let ... ...)) (and (memq type ...) (progn ... ... ...)) (and (memq type ...) (let ... ...)) (and (eq type ...) (let ... ...)))) element (let ((restriction (org-element-restriction type)) (parent element) candidates) (catch (quote exit) (while (setq candidates ...) (let ... ...)) parent))))))
  org-element-context()
  (let ((object (org-element-context))) (if (eq (org-element-type object) (quote macro)) (progn (let ((value (org-macro-expand object templates))) (if value (progn (delete-region (org-element-property :begin object) (progn ... ... ...)) (save-excursion (insert value))))))))
  (while (re-search-forward "{{{[-A-Za-z0-9_]" nil t) (let ((object (org-element-context))) (if (eq (org-element-type object) (quote macro)) (progn (let ((value (org-macro-expand object templates))) (if value (progn (delete-region ... ...) (save-excursion ...))))))))
  (save-excursion (goto-char (point-min)) (while (re-search-forward "{{{[-A-Za-z0-9_]" nil t) (let ((object (org-element-context))) (if (eq (org-element-type object) (quote macro)) (progn (let ((value ...)) (if value (progn ... ...))))))))
  org-macro-replace-all((("author" . #("Nick Dokos" 0 10 (:parent nil))) ("date" . "{{{date(%c)}}}") ("email" . "nick@alphaville") ("title" . " *temp*")))
  (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title))))))
  (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title)))))) (setq tree (org-export-filter-apply-functions (plist-get
  info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)))
  (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noex
 pand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (o
 r (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title)))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info))))
  (progn (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (
 if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data ...)) (cons "date" (org-element-interpret-data ...)) (cons "email" (or ... "")) (cons "title" (org-ele
 ment-interpret-data ...))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)))))
  (unwind-protect (progn (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file ...)) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))
 ) (if noexpand nil (org-macro-replace-all (list (cons "author" ...) (cons "date" ...) (cons "email" ...) (cons "title" ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :
 filter-parse-tree) (org-element-parse-buffer nil visible-only) info))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let (...) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend 
 subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list ... ... ... ...))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-bu
 ffer nil visible-only) info))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (with-current-buffer temp-buffer (unwind-protect (progn (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let (...) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-
 plist))) (if noexpand nil (org-macro-replace-all (list ... ... ... ...))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visi
 ble-only) info))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov ... ... ...)) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ... ...)) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters ...)) (if noexpand nil (org-macro-replace-all ...)) (setq tree (or
 g-export-filter-apply-functions ... ... info))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (with-temp-buffer (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext
 -plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data ...)) (cons "date" (org-element-interpret-data ...)) (cons "email" (or ... "")) (cons "titl
 e" (org-element-interpret-data ...))))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)))))
  (let* ((--original-buffer (current-buffer)) (--region (list (point-min) (point-max))) (--buffer-string (org-with-wide-buffer (buffer-string))) (--overlays (mapcar (quote copy-overlay) (apply (quote overlays-in) --region)))) (with-temp-buffer (let ((buffer-invisibility-spec nil)) (org-clone-local-variables --original-buffer "^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)") (insert --buffer-string) (apply (quote narrow-to-region) --region) (mapc (lambda (ov) (move-overlay ov (overlay-start ov) (overlay-end ov) (current-buffer))) --overlays) (goto-char (point-min)) (progn (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file ...)) (org-export-blocks-preprocess))) (
 org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment
  backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" ...) (cons "date" ...) (cons "email" ...) (cons "title" ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info))))))
  (org-export-with-current-buffer-copy (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title)))))) (setq tree (org-export-fil
 ter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info)))
  (let (info tree) (org-export-with-current-buffer-copy (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data (plist-get info :author))) (cons "date" (org-element-interpret-data (plist-get info :date))) (cons "email" (or (plist-get info :email) "")) (cons "title" (org-element-interpret-data (plist-get info :title)))))) (setq tre
 e (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) info))) (setq info (org-combine-plists info (org-export-collect-tree-prop
 erties tree info))) (let* ((body (org-element-normalize-string (org-export-data tree info))) (template (cdr (assq (quote template) (plist-get info :translate-alist)))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or (not ...) body-only) body (funcall template body info)) info))) (if org-export-copy-to-kill-ring (progn (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 tree) (org-export-with-current-buffer-copy (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file (current-buffer))) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" (org-element-interpret-data ...)) (
 cons "date" (org-element-interpret-data ...)) (cons "email" (or ... "")) (cons "title" (org-element-interpret-data ...))))) (setq tree (org-export-filter-apply-functions (plist-get info :fil
 ter-parse-tree) (org-element-parse-buffer nil visible-only) 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 (cdr (assq (quote template) (plist-get info :translate-alist)))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if (or ... body-only) body (funcall template body info)) info))) (if org-export-copy-to-kill-ring (progn (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 tree) (org-export-with-current-buffer-copy (if noexpand nil (org-export-expand-include-keyword) (org-macro-initialize-templates) (org-macro-replace-all org-macro-templates) (let ((org-current-export-file ...)) (org-export-blocks-preprocess))) (org-update-radio-target-regexp) (goto-char (point-min)) (run-hook-with-args (quote org-export-before-parsing-hook) backend) (setq info (org-export-install-filters (org-export-get-environment backend subtreep ext-plist))) (if noexpand nil (org-macro-replace-all (list (cons "author" ...) (cons "date" ...) (cons "em
 ail" ...) (cons "title" ...)))) (setq tree (org-export-filter-apply-functions (plist-get info :filter-parse-tree) (org-element-parse-buffer nil visible-only) 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 (cdr (assq ... ...))) (output (org-export-filter-apply-functions (plist-get info :filter-final-output) (if ... body ...) info))) (if org-export-copy-to-kill-ring (progn (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))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert out) (let ((coding-system-for-write org-export-coding-system)) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  org-export-to-file(e-latex "./date.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)
  funcall(org-e-latex-export-to-latex nil nil nil)
  (cond ((eql action (quote publish-current-file)) (org-e-publish-current-file (memq (quote force) optns))) ((eql action (quote publish-current-project)) (org-e-publish-current-project (memq (quote force) optns))) ((eql action (quote publish-choose-project)) (org-e-publish (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist) (memq (quote force) optns))) ((eql action (quote publish-all)) (org-e-publish-all (memq (quote force) optns))) (t (funcall action (memq (quote subtree) optns) (memq (quote visible) optns) (memq (quote body) optns))))
  (let* ((input (let ((wconfig (current-window-configuration))) (unwind-protect (progn (unwind-protect (org-export-dispatch-ui ... nil org-export-dispatch-use-expert-ui) (and ... ...))) (set-window-configuration wconfig)))) (action (car input)) (optns (cdr input))) (cond ((eql action (quote publish-current-file)) (org-e-publish-current-file (memq (quote force) optns))) ((eql action (quote publish-current-project)) (org-e-publish-current-project (memq (quote force) optns))) ((eql action (quote publish-choose-project)) (org-e-publish (assoc (org-icompleting-read "Publish project: " org-e-publish-project-alist nil t) org-e-publish-project-alist) (memq (quote force) optns))) ((eql action (quote publish-all)) (org-e-publish-all (memq (quote force) optns))) (t (funcall action (memq (quote subtre
 e) optns) (memq (quote visible) optns) (memq (quote body) optns)))))
  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)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 23:05         ` Nick Dokos
@ 2012-10-30  7:14           ` Nicolas Goaziou
  2012-10-30  8:29             ` Achim Gratz
  2012-10-30  9:18             ` Michael Gauland
  2012-10-30  8:58           ` Eric S Fraga
  1 sibling, 2 replies; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-30  7:14 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Michael Gauland

Hello,

Nick Dokos <nicholas.dokos@hp.com> writes:

> Michael Gauland <mikelygee@no8wireless.co.nz> wrote:
>
>> Nicolas Goaziou <n.goaziou <at> gmail.com> writes:
>> 
>> > I just tried with a minimal init and it worked. Could you send the
>> > example you're trying to export?
>> 
>> The file is below. With a minimal init, I get the error "Symbol's function
>> definition is void: org-macro-initialize-templates'. If I use my full .emacs
>> file, the exporter just seems to freeze up.
>> 
>> ------ test.org -----
>> #+DATE: {{{date(%c)}}}
>> 
>> This ia a test file.
>> 
>> 
>> 
>
> With a minimal file, I get a cpu pegged at 100% with no end in
> sight. Setting debug-on-quit and C-g gives me the following backtrace.
>
> Org-mode version 7.9.2 (release_7.9.2-533-g07c889 @
> /home/nick/elisp/org-mode/lisp/)

This is {{{time(...)}}}, not {{{date(...)}}}.

{{{date(%c)}}} is another macro that is replaced with the #+DATE: value
during export. Since you try to replace #+DATE: value with itself, you
dive into an inf loop.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  7:14           ` Nicolas Goaziou
@ 2012-10-30  8:29             ` Achim Gratz
  2012-10-30  9:27               ` Nicolas Goaziou
  2012-10-30  9:18             ` Michael Gauland
  1 sibling, 1 reply; 18+ messages in thread
From: Achim Gratz @ 2012-10-30  8:29 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou writes:
> {{{date(%c)}}} is another macro that is replaced with the #+DATE: value
> during export. Since you try to replace #+DATE: value with itself, you
> dive into an inf loop.

Which raises the question if this shouldn't be detected and prevented,
at least if direct recursion is involved.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf microQ V2.22R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-29 23:05         ` Nick Dokos
  2012-10-30  7:14           ` Nicolas Goaziou
@ 2012-10-30  8:58           ` Eric S Fraga
  1 sibling, 0 replies; 18+ messages in thread
From: Eric S Fraga @ 2012-10-30  8:58 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Michael Gauland

Nick Dokos <nicholas.dokos@hp.com> writes:
> With a minimal file, I get a cpu pegged at 100% with no end in
> sight. Setting debug-on-quit and C-g gives me the following backtrace.

I get this same problem (100% cpu) if I use the date macro in the #+DATE
line; I don't get this if I use the modification-time macro instead.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-536-g1f3a2c

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  7:14           ` Nicolas Goaziou
  2012-10-30  8:29             ` Achim Gratz
@ 2012-10-30  9:18             ` Michael Gauland
  2012-10-30  9:29               ` Nicolas Goaziou
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Gauland @ 2012-10-30  9:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: nicholas.dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

On 30/10/12 20:14, Nicolas Goaziou wrote:
> This is {{{time(...)}}}, not {{{date(...)}}}.
>
> {{{date(%c)}}} is another macro that is replaced with the #+DATE: value
> during export. Since you try to replace #+DATE: value with itself, you
> dive into an inf loop.

I think I understand what's going on now, but I'm still at a loss as to
how to get the date I want. Can I tell the exporter that the date on the
document should be derived from the current time (or the last
modification time), formatted a particular way? For example, I can use
this macro to put the current time in my document:

    {{{time(%Y-%m-%d %H:%M)}}}

How can I set #+DATE to get an equivalent result?

Thanks for your help.

Kind regards,
Mike



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  8:29             ` Achim Gratz
@ 2012-10-30  9:27               ` Nicolas Goaziou
  0 siblings, 0 replies; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-30  9:27 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hello,

Achim Gratz <Stromeko@nexgo.de> writes:

> Nicolas Goaziou writes:
>> {{{date(%c)}}} is another macro that is replaced with the #+DATE: value
>> during export. Since you try to replace #+DATE: value with itself, you
>> dive into an inf loop.
>
> Which raises the question if this shouldn't be detected and prevented,
> at least if direct recursion is involved.

It has already been fixed in master. I wouldn't leave an infloop in the
wild.


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  9:18             ` Michael Gauland
@ 2012-10-30  9:29               ` Nicolas Goaziou
  2012-10-30 16:43                 ` Michael Gauland
  2012-10-30 18:48                 ` Eric S Fraga
  0 siblings, 2 replies; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-30  9:29 UTC (permalink / raw)
  To: Michael Gauland; +Cc: nicholas.dokos, emacs-orgmode

Michael Gauland <mikelygee@no8wireless.co.nz> writes:

> I think I understand what's going on now, but I'm still at a loss as to
> how to get the date I want. Can I tell the exporter that the date on the
> document should be derived from the current time (or the last
> modification time), formatted a particular way? For example, I can use
> this macro to put the current time in my document:
>
>     {{{time(%Y-%m-%d %H:%M)}}}
>
> How can I set #+DATE to get an equivalent result?

Doesn't

   #+DATE: {{{time(%Y-%m-%d %H:%M)}}}

get you what you expect?


Regards,

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  9:29               ` Nicolas Goaziou
@ 2012-10-30 16:43                 ` Michael Gauland
  2012-10-30 17:25                   ` Nick Dokos
  2012-10-30 18:48                 ` Eric S Fraga
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Gauland @ 2012-10-30 16:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: nicholas.dokos, emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 170 bytes --]

On 30/10/12 22:29, Nicolas Goaziou wrote:
> Doesn't
>
>    #+DATE: {{{time(%Y-%m-%d %H:%M)}}}
>
> get you what you expect?

That gives me an empty date string.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30 16:43                 ` Michael Gauland
@ 2012-10-30 17:25                   ` Nick Dokos
  2012-10-30 18:01                     ` Nicolas Goaziou
  0 siblings, 1 reply; 18+ messages in thread
From: Nick Dokos @ 2012-10-30 17:25 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode, Nicolas Goaziou

Michael Gauland <mikelygee@no8wireless.co.nz> wrote:

> On 30/10/12 22:29, Nicolas Goaziou wrote:
> > Doesn't
> >
> >    #+DATE: {{{time(%Y-%m-%d %H:%M)}}}
> >
> > get you what you expect?
> 
> That gives me an empty date string.
> 

Works for me.

Nick

PS Re: the infinite loop with date() - D'oh! That's what I get by mindlessly
   cutting and pasting...

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30 17:25                   ` Nick Dokos
@ 2012-10-30 18:01                     ` Nicolas Goaziou
  2012-10-30 22:24                       ` Michael Gauland
  0 siblings, 1 reply; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-30 18:01 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, Michael Gauland

Hello,

Nick Dokos <nicholas.dokos@hp.com> writes:

> Michael Gauland <mikelygee@no8wireless.co.nz> wrote:
>
>> On 30/10/12 22:29, Nicolas Goaziou wrote:
>> > Doesn't
>> >
>> >    #+DATE: {{{time(%Y-%m-%d %H:%M)}}}
>> >
>> > get you what you expect?
>> 
>> That gives me an empty date string.
>> 
>
> Works for me.

I also get a correct date with it, even with a minimal set-up.

Michael: have you tried it on different back-ends?


Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30  9:29               ` Nicolas Goaziou
  2012-10-30 16:43                 ` Michael Gauland
@ 2012-10-30 18:48                 ` Eric S Fraga
  2012-10-30 20:13                   ` Nicolas Goaziou
  1 sibling, 1 reply; 18+ messages in thread
From: Eric S Fraga @ 2012-10-30 18:48 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: nicholas.dokos, emacs-orgmode, Michael Gauland

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Michael Gauland <mikelygee@no8wireless.co.nz> writes:
>> How can I set #+DATE to get an equivalent result?
>
> Doesn't
>
>    #+DATE: {{{time(%Y-%m-%d %H:%M)}}}

Works perfectly fine for me.  And thanks for the explanation of the
cause of the inf-loop!

The problem with the inf-loop now makes sense but the documentation
implies otherwise:

,----
| Also,
| `{{{date(FORMAT)}}}' and `{{{modification-time(FORMAT)}}}' refer to
| current date time and to the modification time of the file being
`----

thanks,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.2.50.1 and Org release_7.9.2-536-g1f3a2c

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30 18:48                 ` Eric S Fraga
@ 2012-10-30 20:13                   ` Nicolas Goaziou
  0 siblings, 0 replies; 18+ messages in thread
From: Nicolas Goaziou @ 2012-10-30 20:13 UTC (permalink / raw)
  To: Michael Gauland; +Cc: nicholas.dokos, emacs-orgmode

Eric S Fraga <e.fraga@ucl.ac.uk> writes:

> The problem with the inf-loop now makes sense but the documentation
> implies otherwise:
>
> ,----
> | Also,
> | `{{{date(FORMAT)}}}' and `{{{modification-time(FORMAT)}}}' refer to
> | current date time and to the modification time of the file being
> `----

I changed the date macro on purpose.

Since {{{title}}}, {{{author}}} and {{{email}}} refer to, respectively,
#+TITLE:, #+AUTHOR: and #+EMAIL:, {{{date}}} could as well refer to
#+DATE:.

For the sake of completeness, other hard-coded macros are
{{{property(name)}}}, {{{time(format-string)}}}, {{{input-file}}} and
{{{modification-time(format-string)}}}.


Regards,

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [new exporter] Date format string not handled for LaTeX export
  2012-10-30 18:01                     ` Nicolas Goaziou
@ 2012-10-30 22:24                       ` Michael Gauland
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Gauland @ 2012-10-30 22:24 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <n.goaziou <at> gmail.com> writes:

> 
> Hello,
> 
> Nick Dokos <nicholas.dokos <at> hp.com> writes:
> > Works for me.
> 
> I also get a correct date with it, even with a minimal set-up.



Well, this is embarassing. I tackled it fresh, after a cup of coffee (for me)
and a re-start (emacs), and it's working. User error? Quantum effects? Whatever
the cause, thanks for your patience and support.

Kind regards,
Mike

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-10-30 22:25 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-29  3:41 [new exporter] Date format string not handled for LaTeX export Michael Gauland
2012-10-29 13:04 ` Nicolas Goaziou
2012-10-29 21:25   ` Michael Gauland
2012-10-29 21:46     ` Nicolas Goaziou
2012-10-29 22:55       ` Michael Gauland
2012-10-29 23:05         ` Nick Dokos
2012-10-30  7:14           ` Nicolas Goaziou
2012-10-30  8:29             ` Achim Gratz
2012-10-30  9:27               ` Nicolas Goaziou
2012-10-30  9:18             ` Michael Gauland
2012-10-30  9:29               ` Nicolas Goaziou
2012-10-30 16:43                 ` Michael Gauland
2012-10-30 17:25                   ` Nick Dokos
2012-10-30 18:01                     ` Nicolas Goaziou
2012-10-30 22:24                       ` Michael Gauland
2012-10-30 18:48                 ` Eric S Fraga
2012-10-30 20:13                   ` Nicolas Goaziou
2012-10-30  8:58           ` Eric S Fraga

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).