From mboxrd@z Thu Jan 1 00:00:00 1970 From: emacs-orgmode@gnu.org Subject: The patch (org-exp-blocks), the question and the bug Date: Sun, 17 May 2009 14:36:53 +0200 Message-ID: <87skj3q522.fsf@selenimh.orion.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M5fgP-0007Gc-4M for emacs-orgmode@gnu.org; Sun, 17 May 2009 08:41:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M5fgN-0007FH-VM for emacs-orgmode@gnu.org; Sun, 17 May 2009 08:41:36 -0400 Received: from [199.232.76.173] (port=37111 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M5fgN-0007FE-QV for emacs-orgmode@gnu.org; Sun, 17 May 2009 08:41:35 -0400 Received: from smtp22.services.sfr.fr ([93.17.128.11]:61248) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M5fgN-0004ch-8Q for emacs-orgmode@gnu.org; Sun, 17 May 2009 08:41:35 -0400 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id 14A4D700008F for ; Sun, 17 May 2009 14:41:33 +0200 (CEST) Received: from lowzel.ath.cx (203.133.206-77.rev.gaoland.net [77.206.133.203]) by msfrf2206.sfr.fr (SMTP Server) with ESMTP id E6BC47000086 for ; Sun, 17 May 2009 14:41:32 +0200 (CEST) Received: from selenimh.orion.org. (unknown [93.9.218.123]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by lowzel.ath.cx (Postfix) with ESMTPSA id DDF7C2603EC for ; Sun, 17 May 2009 14:41:32 +0200 (CEST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hello, I have created (in fact, I have copied and pasted with slights modifications) a function to use asymptote's code (http://asymptote.sourceforge.net) with the help of org-exp-blocks. Unfortunately, I am clueless about how to make a patch with git. So, with all my apologies, I will put it here as it might be useful to someone. (defun org-export-blocks-format-asy (body &rest headers) "Pass block BODY to the asy utility creating an image. Specify the path at which the image should be saved as the first element of headers, any additional elements of headers will be passed to the asy utility as command line arguments. The default output format is pdf, but you can specify any format supported by Imagemagick convert program with '-f outformat'." (message "asy-formatting...") (let ((out-file (if headers (car headers))) (args (if (cdr headers) (mapconcat 'identity (cdr headers) " "))) (data-file (make-temp-file "org-asy"))) (setq body (if (string-match "^\\([^:\\|:[^ ]\\)" body) body (mapconcat (lambda (x) (substring x (if (> (length x) 1) 2 1))) (org-split-string body "\n") "\n"))) (cond ((or htmlp latexp) (with-temp-file data-file (insert body)) (message (concat "asy -globalwrite -f pdf -o " out-file " " args " " data-file)) (shell-command (concat "asy -globalwrite -f pdf -o " out-file " " args " " data-file)) (format "\n[[file:%s]]\n" out-file)) (t (concat "\n#+BEGIN_EXAMPLE\n" body (if (string-match "\n$" body) "" "\n") "#+END_EXAMPLE\n"))))) Don't forget to change accordingly org-export-blocks. But that leads me to a question. I use (setq org-export-latex-image-default-option "") in my .emacs. But, as it might not be convenient for everyone, I would like to disable locally that option in the asymptote's block. In fact, the code should take precedence above export options : if I put 'size(5cm,0);' in my block, I don't want no variable messing with that. Is there a way to do that ? Last, but not least, I have something looking like a bug to report. Sometimes, when I hit C-k in agenda view, it kills me 2 lines instead of the one I am currently on. I can tell that kill-whole-line has nothing to do with that. It scares me so much that I have to TAB first while in agenda view in order to kill the item I want to make disappear. I use 6.26d but I could swear this bug has been on for ages (maybe 4.xx, certainly 5.xx). Thanks. -- Nicolas Goaziou