Org のプロパティ値をサクッとコピーする
Elisp code to copy puroperty value at point
(defun my/org-copy-property-as-kill (property)
"Copy the value of PROPERTY to `kill-ring'.
If the value matches $(...) format, ... will be treated as a
shell command, and the output of the command will be copied to
the `kill-ring' instead."
(interactive (progn (setq properties (org-entry-properties))
(list (completing-read "Property: " properties))))
(pcase (setq value (alist-get property properties nil nil #'equal))
((rx (seq "$(" (group (+ print)) ")"))
(setq value (shell-command-to-string (match-string 1 value)))))
(when (stringp value)
(kill-new value)
(message "Copied: %s" value)))
(with-eval-after-load 'org
(keymap-set org-mode-map "C-c K"
#'my/org-copy-property-as-kill)
(setf (alist-get "K" org-speed-commands nil nil #'equal)
#'my/org-copy-property-as-kill))
ちょうどプロパティにシェルコマンドを埋め込みたいという特殊なニーズがあったので、それに対応するコードも入ってます。今日は短めで、失礼します。