unofficial mirror of emacs-orgmode@gnu.org
 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

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


code repositories for project(s) associated with this inbox:

	orgmode.git.git (no URL configured)

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git