(defun ecli-metadata-single (ecli meta)
"meta needs to be quotes \n example: (case-metadata ECLI:NL:HR:2013:BY6108 'identifier)"
(interactive "sEnter ecli: \nxEnter identifier: ")
(insert (car (cddr (assoc meta (ecli-metadata-full ecli)))))
)
(ecli-metadata-single "ECLI:NL:HR:2007:BA2511" 'date)
What this code does is getting some metadata from a remote xml-file. The code seems to work fine when I use just type the expression, however, the interactive version does not insert the data, instead throwing an error saying
wrong type argument: char-or-string-p, nil.
I have looked up (interactive) in C-h f
, and tried many of the alternative characters for input. However, I still get the same (non-)result. After browsing stack-overflow and not finding a suitable answer, I 'gave up' and decided to ask this question.
To recap:
My goal is to make the above function interactively insert data. The first argument is an identifier-code, and the second argument is the data I want from the retrieved xml (other code not shown due to length). The first argument is a string "ECLI:NL:HR:2013:BY6108"
, and the second argument is a quoted item 'date
.
A second question would be how I can remove the required quote from the input-arguments. I have tried something like (quote meta)
, but that did not work.