emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] new exporter


From: Achim Gratz
Subject: Re: [O] new exporter
Date: Sun, 01 Jul 2012 18:33:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Nicolas Goaziou writes:
> I will look more carefully at the `org-export-with-current-buffer-copy'
> macro, but, since I cannot reproduce the compilation error it may be
> hard to find the mistake.

After some consideration, I think this is what the macro should look
like:

--8<---------------cut here---------------start------------->8---
(defmacro org-export-with-current-buffer-copy (&rest body)
  "Apply BODY in a copy of the current buffer.

The copy preserves local variables and visibility of the original
buffer.

Point is at buffer's beginning when BODY is applied."
  `(org-with-gensyms (original-buffer offset buffer-string overlays)
     (let ((original-buffer (current-buffer))
           (offset (1- (point-min)))
           (buffer-string (buffer-string))
           (overlays (mapcar
                       'copy-overlay (overlays-in (point-min) (point-max)))))
       (with-temp-buffer
         (let ((buffer-invisibility-spec nil))
           (org-clone-local-variables
            original-buffer
            
"^\\(org-\\|orgtbl-\\|major-mode$\\|outline-\\(regexp\\|level\\)$\\)")
           (insert buffer-string)
           (mapc (lambda (ov)
                   (move-overlay
                    ov
                    (- (overlay-start ov) offset)
                    (- (overlay-end ov) offset)
                    (current-buffer)))
                 overlays)
           (goto-char (point-min))
           (progn ,@body))))))
(def-edebug-spec org-export-with-current-buffer-copy (body))
--8<---------------cut here---------------end--------------->8---

In other words I think you'll want to quote the whole expansion
including the let-forms into the place of the macro call.  The expansion
actually is into (org-with-gensyms... which then gets expanded further
into what you want to compile, but at that point the formal parameter of
the original macro call is already resolved.  This is what happens
during (non-compiled) interpretation anyway.  With that change the file
compiles and seems to work the same compiled and uncompiled.

The org-export-define-derived-backend macro seems similarly starstruck,
but I really don't know what you think the expansion should be.
Fortunately it's only used in org-e-beamer so far...

One of your recent changes introduced four test fail when org-element is
compiled.  I haven't yet looked why that would be, the four tests are:

   FAILED  test-org-export/table-cell-alignment
   FAILED  test-org-export/table-cell-borders
   FAILED  test-org-export/table-row-ends-header-p
   FAILED  test-org-export/table-row-starts-header-p

The new org-e-beamer.el doesn't compile at all:
org-e-beamer.el:258:1:Error: Wrong type argument: listp, 
org-e-beamer-export-block



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

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




reply via email to

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