From mboxrd@z Thu Jan 1 00:00:00 1970 From: vdyadov@elvees.com (=?utf-8?B?0JTRj9C00L7QsiDQktCw0YHQuNC7INCh0YI=?= =?utf-8?B?0L7Rj9C90L7Qsg==?=) Subject: Bug: [PATCH] Org-babel: separate #+attr_... for code block and for results block [7.9.3d (release_7.9.3d-834-g60083a.dirty @ /home/vdyadov/Work/Tools/emacs/org-mode/lisp/)] Date: Wed, 23 Jan 2013 15:43:40 +0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:49794) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Txyja-00027k-Lf for emacs-orgmode@gnu.org; Wed, 23 Jan 2013 06:43:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TxyjW-0005OG-KV for emacs-orgmode@gnu.org; Wed, 23 Jan 2013 06:43:14 -0500 Received: from mail.elvees.com ([80.90.126.250]:53243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TxyjW-0005Mq-9R for emacs-orgmode@gnu.org; Wed, 23 Jan 2013 06:43:10 -0500 Received: from canopus-pc.elvees.com.elvees.com (horse.elvees.com [80.90.126.253]) (authenticated bits=0) by mail.elvees.com (8.14.3/8.14.2) with ESMTP id r0NBgq20095224 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Wed, 23 Jan 2013 15:42:52 +0400 (MSK) (envelope-from vdyadov@elvees.com) 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 --=-=-= Content-Type: text/plain Remember to cover the basics, that is, what you expected to happen and what in fact did happen. You don't know how to make a good report? See http://orgmode.org/manual/Feedback.html#Feedback Your bug report will be posted to the Org-mode mailing list. ------------------------------------------------------------------------ With current org-babel it is not possible to set separate html attributes for result block. Simple case: ,---- | #+begin_src ditaa :file 123.png :cache yes | ... | #+end_src | | #+results[f8f8...]: | file:123.png `---- Suppose, I want to add some html attributes to image: ,---- | #+begin_src ditaa :file 123.png :cache yes | ... | #+end_src | | #+attr_html: alt="big image" width="100%" | | #+results[f8f8...]: | file:123.png `---- But when I do C-c C-c on ditaa block, it inserts one more result block: ,---- | #+begin_src ditaa :file 123.png :cache yes | ... | #+end_src | | #+results[f8f8...]: | file:123.png | | #+attr_html: alt="big image" width="100%" | | #+results[f8f8...]: | file:123.png `---- Because org-babel does not skip #+attr_ ... lines when searching results block with `org-babel-where-is-src-block-result' function. I've added skipping every #+attr_ line between #+end_src and #+results blocks. Patch is attached. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=ob-core.patch Content-Description: Patch for ob-core.el diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 9e4c8b1..00fd715 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -1761,6 +1761,12 @@ following the source block." (progn ;; unnamed results line already exists (re-search-forward "[^ \f\t\n\r\v]" nil t) (beginning-of-line 1) + (while (looking-at-p "[ \t]*\\#\\+[Aa][Tt][Tt][Rr]_") + (end-of-line 1) + (setq end (point)) + (re-search-forward "[\n\r]" nil t) + (re-search-forward "[^ \f\t\n\r\v]" nil t) + (beginning-of-line 1)) (looking-at (concat org-babel-result-regexp "\n"))) (prog1 (point) --=-=-= Content-Type: text/plain Emacs : GNU Emacs 24.2.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.18.9) of 2012-12-25 on canopus-pc.elvees.com Package: Org-mode version 7.9.3d (release_7.9.3d-834-g60083a.dirty @ /home/vdyadov/Work/Tools/emacs/org-mode/lisp/) --=-=-=--