Re: [O] [BUG] src code block header does not override buffer-wide header in property

2016-06-29 Thread Nick Dokos
"Charles C. Berry"  writes:

> Not a bug. See below.
>
> On Wed, 29 Jun 2016, Nick Dokos wrote:
>
>> This was reported on SO:
>>
>> http://stackoverflow.com/questions/37414837/org-mode-overwriting-globals-properties-in-block-headers
>>
>> The ECM is as follows:
>>
>> --8<---cut here---start->8---
>> #+PROPERTY: header-args :results silent
>>
>> #+BEGIN_SRC elisp
>> ;; this one is silent
>> (setq foo "bar)
>> #+END_SRC
>>
>> #+BEGIN_SRC elisp :results output
>> ;; this one is being outputted
>> (princ "foo")
>> #+END_SRC
>> --8<---cut here---end--->8---
>>
>> The second code block *should* output "foo" as its result, but it does
>> not: the :results silent header in the property seems to be in conrol.
>
> Maybe you meant
>
> #+BEGIN_SRC elisp :results output replace :exports both
> ;; this one is being outputted
> (princ "foo")
> #+END_SRC
>

OK - I can never remember the meaning of all the results permutations
but replace does reverse the result of silent (I don't care about export
in this case).

>
> i.e. export code and results and replace the existing result or insert a 
> new result.
>
> See (info "(org) results") and scroll down to the 'Handling' paragraph.
>

Thanks for the reference - I obviously need to re-read this a few times.

-- 
Nick




Re: [O] [BUG] src code block header does not override buffer-wide header in property

2016-06-29 Thread Charles C. Berry


Not a bug. See below.

On Wed, 29 Jun 2016, Nick Dokos wrote:


This was reported on SO:

http://stackoverflow.com/questions/37414837/org-mode-overwriting-globals-properties-in-block-headers

The ECM is as follows:

--8<---cut here---start->8---
#+PROPERTY: header-args :results silent

#+BEGIN_SRC elisp
;; this one is silent
(setq foo "bar)
#+END_SRC

#+BEGIN_SRC elisp :results output
;; this one is being outputted
(princ "foo")
#+END_SRC
--8<---cut here---end--->8---

The second code block *should* output "foo" as its result, but it does
not: the :results silent header in the property seems to be in conrol.


Maybe you meant

#+BEGIN_SRC elisp :results output replace :exports both
;; this one is being outputted
(princ "foo")
#+END_SRC


i.e. export code and results and replace the existing result or insert a 
new result.


See (info "(org) results") and scroll down to the 'Handling' paragraph.

Chuck