From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: begin_src org :results replace does not work Date: Wed, 31 May 2017 16:15:55 +0200 Message-ID: <87shjl3yec.fsf@nicolasgoaziou.fr> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG4Pq-0003B8-G3 for emacs-orgmode@gnu.org; Wed, 31 May 2017 10:16:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG4Pn-0002f8-5e for emacs-orgmode@gnu.org; Wed, 31 May 2017 10:16:02 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:37011) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dG4Pm-0002es-QC for emacs-orgmode@gnu.org; Wed, 31 May 2017 10:15:59 -0400 In-Reply-To: (Charles C. Berry's message of "Mon, 29 May 2017 10:06:58 -0700") 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" To: "Charles C. Berry" Cc: "emacs-orgmode@gnu.org" , Vikas Rawal Hello, "Charles C. Berry" writes: > On Mon, 29 May 2017, Vikas Rawal wrote: > >> Why does the replace keyword not work? It prepends the results. I have >> tried both ":results value replace" and ":results output replace". >> >> I am on org-version 9.0.7 >> >> Vikas >> >> >> >> >> #+NAME: one >> #+BEGIN_SRC org :results value replace export both >> ,#+NAME: table-yield >> ,#+CAPTION: Simple table created using latex tabular environment >> ,#+attr_latex: :environment tabular :width \textwidth :align lrr >> | State | Variable one | Varia two | >> |----------------+---------------+----------------| >> | MP | 672 | 13000 | >> | Har | 300 | 25000 | >> | Pun | 260 | 35000 | >> #+End_SRC >> > > The problem is that the results you generate is a table with > affiliated keywords NAME and CAPTION and ATTR_[backend]. > > `org-at-table-p' does not recognize that the keywords are followed by > a table. Altering this function might be asking for trouble as it is > used outside babel. > > So maybe the cond test should refer to `org-element-context' to better > sort this out and correctly identify the table end. Even though that change may be interesting on its own, it isn't a proper solution here. Raw values cannot be replaced. The only possible handling is "prepend" since Org cannot possibly know what the results are. For example, with the following src block #+begin_src org Pargraph 1 Paragaph 2 #+end_src Org cannot know if a raw "Parapraph 2" belongs the the results or is a paragraph following them. Since "raw" format is special, the most surprising thing here is that Org src blocks use it as a default. Anyway, I don't think there is anything to fix (except maybe the documentation). The OP is requesting an impossible combination of parameters. Regards, -- Nicolas Goaziou