Bastien <b...@gnu.org> writes:

> Esben Stien <b...@esben-stien.name> writes:
>
>> Are there any functions that copies the value of a parameter in drawers,
>> like: 
>>
>> :PROPERTIES:
>> :FOO: bar
>> :END:
>>
>> With mark over the line with :FOO:, is there a function that just
>> copies "bar"?
>
> Nope.

I've wanted this for a bit.

(defun org-property-value-save (&optional prop)
  (interactive)
  (let* ((props (org-entry-properties))
         (prop (or prop
                   (when (org-at-property-p)
                     (org-match-string-no-properties 2))
                   (org-completing-read
                    "Get property: "
                    props t)))
         (val (org-entry-get-with-inheritance prop)))
    (if val (progn
              (kill-new val)
              (message "Saved: %s" val))
      (message "No valid value for %s" prop))))


Reply via email to