Suggest to add a hydra interface for org-transclusion.
Sometimes I will forget org-transclusion property keywords, I have to lookup document again. So I hope org-transclusion can provide an interface which contains all property keywords.
Here is my own config for your reference.
(require 'hydra)
(defmacro hydra-org-transclusion--detect-transclude-at-point-wrapper (body)
`(let ((line-text (buffer-substring-no-properties
(line-beginning-position) (line-end-position)))
(position (point))
(end-of-line (line-end-position)))
(if (string-match-p "#\\+transclude:" line-text)
(progn
(unless (eq position end-of-line) (end-of-line))
(insert " ")
,body)
(user-error "You'r not on #+transclude: [[link]] line."))))
(defhydra hydra-org-transclusion (:color "blue" :hint nil :exit nil)
"
^Toggle status^ ^Options^
^---------------^ ^--------------------^
_m_: toggle minor Mode _l_: :level N
_p_: add transclude #+transclude at Point. _o_: :only-contents
_a_: add ALL transclusions in current buffer. _e_: :expand-links
"
("m" org-transclusion-mode :color black)
("p" org-transclusion-add :color blue)
("a" org-transclusion-add-all :color blue)
("l" (lambda ()
(interactive)
(hydra-org-transclusion--detect-transclude-at-point-wrapper
(insert (format ":level %s"
(read-string "Set org-transclusion content headline level: ")))))
:color green)
("o" (lambda ()
(interactive)
(hydra-org-transclusion--detect-transclude-at-point-wrapper
(insert ":only-contents")))
:color green)
("e" (lambda ()
(interactive)
(hydra-org-transclusion--detect-transclude-at-point-wrapper
(insert ":expand-links")))
:color green)
)
(define-key org-mode-map (kbd "C-c o l") 'hydra-org-transclusion/body)
Here is the screenshot:

Thank you for your suggestion and code! I agree with you on the point that UX for the optional props should be improved.
I have an idea that I'd like to explore a bit. I do not have enough bandwidth at the moment but I'd like to give it a shot when I have a bit of breathing space. The idea is simple and goes like this:
- Create a set of functions, each of which handles adding/removing a property to the
#+transclude:keyword - These can be added to keybinding
At the moment, you are using lambda functions in your Hydra configuration. And you could replace them with the functions.
This way, it does not have to be Hydra. I guess it can be Transient, Which-key, or the built-in menu system.
Perhaps I could borrow the code you did for the lambda functions...
Indeed, your idea is better and improved. Added into wishlist now.
Exploring the aforementioned idea in PR #185. If @stardiviner or anyone has time to comment, that will be much appreciated. Thank you.
Exploring the aforementioned idea in PR #185. If @stardiviner or anyone has time to comment, that will be much appreciated. Thank you.
I reviewed the PR and commented.