branch: externals/org-transclusion
commit 86993b844121e709d0a623e37d8dc31c1a7e28fc
Author: Noboru Ota <[email protected]>
Commit: Noboru Ota <[email protected]>

    chg(transient): Adding more properties (:noweb-chunk, etc.)
---
 org-transclusion-transient.el | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/org-transclusion-transient.el b/org-transclusion-transient.el
index 8a84086b6e..c0dea79ff7 100644
--- a/org-transclusion-transient.el
+++ b/org-transclusion-transient.el
@@ -86,6 +86,10 @@ which automatically calls the appropriate transient-prefix."
                    org-transclusion-transient--exclude-elements
                    :inapt-if-not org-transclusion-at-keyword-p)
                   ("el" "expand-links" org-transclusion-transient--expand-links
+                   :inapt-if-not org-transclusion-at-keyword-p)
+                  ("no" "no-first-heading" 
org-transclusion-transient--no-first-heading
+                   :inapt-if-not org-transclusion-at-keyword-p)
+                  ("da" "disable-auto" org-transclusion-transient--disable-auto
                    :inapt-if-not org-transclusion-at-keyword-p)]
 
     [:description "Addiitonal options: :src and :lines"
@@ -107,7 +111,11 @@ which automatically calls the appropriate 
transient-prefix."
                    :inapt-if-not org-transclusion-at-keyword-p)
                   ("st" "thing-at-point"
                    org-transclusion-transient--thingatpt
+                   :inapt-if-not org-transclusion-at-keyword-p)
+                  ("sn" "noweb-chunk"
+                   org-transclusion-transient--noweb-chunk
                    :inapt-if-not org-transclusion-at-keyword-p)]]
+
   [[:description "Undo / Redo"
                  ("<left>" "Undo" undo-only :transient t)
                  ("<right>" "Redo" undo-redo :transient t)]
@@ -236,6 +244,21 @@ you type a certain character (typically a comma). See 
`crm-separator'."
     (org-transclusion-transient--detect-transclude-at-point-wrapper
      (insert (format ":exclude-elements %S" elements-string)))))
 
+(transient-define-suffix org-transclusion-transient--no-first-heading ()
+  ":no-first-heading will remove the headline of a subtree.
+This is useful when you wish to merge a subtree into another headline."
+  :transient 'transient--do-stay
+  (interactive)
+  (org-transclusion-transient--detect-transclude-at-point-wrapper
+   (insert ":no-first-heading")))
+
+(transient-define-suffix org-transclusion-transient--disable-auto ()
+  "`org-transclusion-add-all' will skip transclusions with :disable-auto."
+  :transient 'transient--do-stay
+  (interactive)
+  (org-transclusion-transient--detect-transclude-at-point-wrapper
+   (insert ":disable-auto")))
+
 (transient-define-suffix org-transclusion-transient--src ()
   ":src property lets you wrap the content in a src-block.
 Choose a language from items in
@@ -288,6 +311,17 @@ Choose one of the things \"sentence\" \"paragraph\" 
\"defun\" \"sexp\"."
       (org-transclusion-transient--detect-transclude-at-point-wrapper
        (insert (format ":thingatpt %s" string))))))
 
+(transient-define-suffix org-transclusion-transient--noweb-chunk ()
+  ":noweb-chunk lets you transclude named chunks of noweb.
+The name of the chunk is appended to the file name, separated by `::'
+like this example:
+
+    #+transclude: [[./file.nw::chunk-A]] :noweb-chunk"
+  :transient 'transient--do-stay
+  (interactive)
+  (org-transclusion-transient--detect-transclude-at-point-wrapper
+   (insert ":noweb-chunk")))
+
 (transient-define-suffix org-transclusion-transient--add ()
   "Call `org-transclusion-add'.
 This will not exit the transient menu. You will navigate to another menu

Reply via email to