[Top][All Lists]

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

[Orgmode] The patch (org-exp-blocks), the question and the bug

From: emacs-orgmode
Subject: [Orgmode] The patch (org-exp-blocks), the question and the bug
Date: Sun, 17 May 2009 14:36:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux)


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

(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)
                 (mapconcat (lambda (x) (substring x (if (> (length x) 1) 2 1)))
                            (org-split-string body "\n")
     ((or htmlp latexp)
      (with-temp-file data-file (insert body))
      (message (concat "asy -globalwrite -f pdf -o " out-file " " args " " 
      (shell-command (concat "asy -globalwrite -f pdf -o " out-file " " args " 
" data-file))
      (format "\n[[file:%s]]\n" out-file))
     (t (concat
         body (if (string-match "\n$" body) "" "\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).


Nicolas Goaziou

reply via email to

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