emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Easy way of inspecting / showing value of property?


From: Thorsten Jolitz
Subject: Re: [O] Easy way of inspecting / showing value of property?
Date: Wed, 10 Sep 2014 11:59:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Rainer M Krug <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]