From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: Re: new exporter Date: Sun, 01 Jul 2012 18:33:05 +0200 Message-ID: <87r4sv5tmm.fsf@Rainer.invalid> References: <3C38420E-E2FA-4CAB-B3FD-9C5F8584E60A@gmail.com> <81fwadrgoo.fsf@gmail.com> <87396dzlai.fsf_-_@Rainer.invalid> <871ulqgb4t.fsf@gmail.com> <87y5nyx4ku.fsf@Rainer.invalid> <87a9zq7htj.fsf@Rainer.invalid> <87r4t261fw.fsf@Rainer.invalid> <87k3yu15wj.fsf@gmail.com> <87395hkj7u.fsf@Rainer.invalid> <87fw9gwmet.fsf@Rainer.invalid> <87pq8j2a0y.fsf@gmail.com> <87r4sy3rve.fsf@Rainer.invalid> <87fw9d1eif.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:58239) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlN5Q-0004rU-Vi for emacs-orgmode@gnu.org; Sun, 01 Jul 2012 12:33:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlN5O-0006XC-Rr for emacs-orgmode@gnu.org; Sun, 01 Jul 2012 12:33:24 -0400 Received: from plane.gmane.org ([80.91.229.3]:60615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlN5O-0006X5-IO for emacs-orgmode@gnu.org; Sun, 01 Jul 2012 12:33:22 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1SlN5K-0002jW-LM for emacs-orgmode@gnu.org; Sun, 01 Jul 2012 18:33:18 +0200 Received: from pd9eb2a8c.dip.t-dialin.net ([217.235.42.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 01 Jul 2012 18:33:18 +0200 Received: from Stromeko by pd9eb2a8c.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 01 Jul 2012 18:33:18 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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