Skip to content

Instantly share code, notes, and snippets.

@Gastove
Created March 9, 2016 18:33
Show Gist options
  • Save Gastove/a7096d7d06d32dea774a to your computer and use it in GitHub Desktop.
Save Gastove/a7096d7d06d32dea774a to your computer and use it in GitHub Desktop.

All the src blocks in the file are supposed to inherit the global options specified above ^. Note that if you change a header arg in the property block above, you need to put the cursor on that property line and hit C-c C-c to “refresh configuration”.

For instance, my current working directory is not my home dir, but when I do this, I get the contents of my home dir because of the global :dir flag:

ls -la | head

If I now put a header arg on a src block, it merges with global settings – here we specify :results output, and we stay in the specified :dir:

ls -la | head

Nesting

You can set header args in a properties drawer, as here. HOWEVER: the properties drawer overrides all global properties. So for instance, I set :results verbatim in the properties drawer above, and now:

ls -la | head

I get verbatim results, but I’m no longer in the working directory specified by :dir. Property drawers override global properties completely.

Next level nesting

Nested property drawers also override what’s above them. Here we set :dir, and now I’m back in my home dir, but I’ve lost :results verbatim:

ls -la | head

However, src block headings will merge with property drawer headings perfectly nicely – I can set :results verbatim and stay in my home dir:

ls -la | head

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment