emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* header-args property
@ 2021-04-01  8:23 Michael Gauland
  2021-04-01 11:04 ` Greg Minshall
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michael Gauland @ 2021-04-01  8:23 UTC (permalink / raw)
  To: emacs-orgmode

I'm confused about the use of the header-args property. It works as
expected when I
export a file, but not when I evaluate a code block manually. For example,
consider this file:

    #+PROPERTY: header-args :var x="Hello" :exports both

    #+begin_src shell
      echo X is $x
    #+end_src

When I export, the result of the code block is "X is Hello", but when I
use C-c
C-c to evaluate the block in emacs, I get "X is"--the variable isn't
defined.

In practice, this means I generally define things like :session for each
block,
rather than using a file-level property. Is this behaviour expected? 

Kind regards,

Mike



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: header-args property
  2021-04-01  8:23 header-args property Michael Gauland
@ 2021-04-01 11:04 ` Greg Minshall
  2021-04-01 11:10 ` ian martins
  2021-04-01 11:47 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Minshall @ 2021-04-01 11:04 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

Michael,

i see "Hello" when i C-c C-c.  i see this with "emacs -Q".

cheers, Greg


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: header-args property
  2021-04-01  8:23 header-args property Michael Gauland
  2021-04-01 11:04 ` Greg Minshall
@ 2021-04-01 11:10 ` ian martins
  2021-04-01 11:47 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: ian martins @ 2021-04-01 11:10 UTC (permalink / raw)
  To: Michael Gauland; +Cc: Org-Mode mailing list

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On Thu, Apr 1, 2021 at 4:23 AM Michael Gauland <mikelygee@gmail.com> wrote:

> When I export, the result of the code block is "X is Hello", but when I
> use C-c
> C-c to evaluate the block in emacs, I get "X is"--the variable isn't
> defined.
>

This works for me on org 9.4.

I had trouble getting a file-level property to work across source blocks
before, but it worked in a property drawer. I thought this was going to be
that case, but I guess not. This seemed to work.

[-- Attachment #2: Type: text/html, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: header-args property
  2021-04-01  8:23 header-args property Michael Gauland
  2021-04-01 11:04 ` Greg Minshall
  2021-04-01 11:10 ` ian martins
@ 2021-04-01 11:47 ` Eric S Fraga
  2 siblings, 0 replies; 4+ messages in thread
From: Eric S Fraga @ 2021-04-01 11:47 UTC (permalink / raw)
  To: Michael Gauland; +Cc: emacs-orgmode

On Thursday,  1 Apr 2021 at 21:23, Michael Gauland wrote:
> When I export, the result of the code block is "X is Hello", but when
> I use C-c C-c to evaluate the block in emacs, I get "X is"--the
> variable isn't defined.

Did you hit C-c C-c on the property line to update org's view of the
properties set?  I think on export it will read these anew for the
export but executing C-cC-c on the src block will not pick up the value
unless you have re-initialized.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-254-g37749c


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-01 12:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-01  8:23 header-args property Michael Gauland
2021-04-01 11:04 ` Greg Minshall
2021-04-01 11:10 ` ian martins
2021-04-01 11:47 ` Eric S Fraga

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).