emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Easy way of inspecting / showing value of property?
Date: Wed, 10 Sep 2014 11:59:46 +0200	[thread overview]
Message-ID: <87lhprvlrh.fsf@gmail.com> (raw)
In-Reply-To: m2sijzx52y.fsf@krugs.de

Rainer M Krug <Rainer@krugs.de> writes:

Hi,

> From time to time my exports / tangles / executions of code blocks do
> not work as expected, and in many cases this is caused by a wrong value
> in the :header-arguments property.
>
> Is there an easy way to inspect the value of this (or any other?)
> property in org?
>
> If I use the column view defined as 
>
> ,----
> | #+PROPERTY: header-args :tangle-mode (identity #o444)
> | #+PROPERTY: header-args+ :tangle no
> | #+PROPERTY: header-args+ :mkdirp yes
> | #+PROPERTY: header-args+ :exports both
> | #+PROPERTY: header-args+ :comments both
> | #+PROPERTY: header-args+ :padline yes
> | #+PROPERTY: header-args+ :eval no-export
> | 
> | #+PROPERTY: header-args:R :session *R_proMixStands*
> | 
> | #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO %header-args
> `----
>
> the header-args column is always empty, although the property is set at
> the file level (see above) and also at the subtree level.
>
> Also, column view does not show the properties of code blocks.
>
> Is there a way of showing the value of the property :header-args?

Try this:

#+PROPERTY: header-args :tangle-mode (identity #o444)
#+PROPERTY: header-args+ :tangle no
#+PROPERTY: header-args+ :mkdirp yes
#+PROPERTY: header-args+ :exports both
#+PROPERTY: header-args+ :comments both
#+PROPERTY: header-args+ :padline yes
#+PROPERTY: header-args+ :eval no-export
#+PROPERTY: header-args:R :session *R_proMixStands*

#+BEGIN_SRC R 
2 + 2
#+END_SRC

#+BEGIN_SRC emacs-lisp
(defun tj/get-property-values ()
  (interactive)
  (let (lst)
    (org-element-map (org-element-parse-buffer) 'keyword
      (lambda (--kw)
	(when (equal (org-element-property :key --kw) "PROPERTY")
	  (let ((val (org-element-property :value --kw)))
	    (setq lst
		  (cons (split-string val " :" t) lst))))))
    lst))
#+END_SRC

#+results:
: tj/get-property-values

#+BEGIN_SRC emacs-lisp :results table
(tj/get-property-values)
#+END_SRC

#+results:
| header-args:R | session *R_proMixStands*     |
| header-args+  | eval no-export               |
| header-args+  | padline yes                  |
| header-args+  | comments both                |
| header-args+  | exports both                 |
| header-args+  | mkdirp yes                   |
| header-args+  | tangle no                    |
| header-args   | tangle-mode (identity #o444) |


-- 
cheers,
Thorsten

      reply	other threads:[~2014-09-10 10:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-10  8:17 Easy way of inspecting / showing value of property? Rainer M Krug
2014-09-10  9:59 ` Thorsten Jolitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhprvlrh.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).