nobiot / org-transclusion

Emacs package to enable transclusion with Org Mode
https://nobiot.github.io/org-transclusion/
GNU General Public License v3.0
938 stars 47 forks source link

paragraph promote/demote .... #103

Open oatmealm opened 2 years ago

oatmealm commented 2 years ago

Taking into consideration I'm probably missing the point here, but I'm wondering if transcluding a paragraph using the label target as some limitations. I.e. I'm not able, in my setup, to promte/demote such a node. In the attached screengrab the transclude directive is nested inside an unordered list, but it's the same under a heading etc.

https://user-images.githubusercontent.com/68159077/140473253-304bab04-8053-44f1-ba38-e58bedac0ed9.mp4

nobiot commented 2 years ago

If I understand the issue correctly (sorry I'm not used to seeing right-to-left languages on Emacs screen), the issue is caused by the fact that transcluded text regions are read-only. The #+transclude: keyword is not read-only and just a line of normal text. Could you try the same operation with #+transclude: before you "add" transclusions?

oatmealm commented 2 years ago

Sorry about the Hebrew I'm just reporting while working :) Here's a better example I hope.

  1. The nesting of the transcluded paragraph. It's flushed to the first column an not under the bullet where it's placed.
  2. The actions on the transcluded block (which I understand is r/o) don't seem to do much. I've tried to invoke org-transclusion-open-source and others manually to test.

Question is, should a "promote" action in this example do anything at all?

It's doom + evil, but I'm changing to "insert" mode. Also, have this setup:

  (when (featurep! :editor evil +everywhere)
    (map! :map org-transclusion-map
          "D" #'org-transclusion-demote-subtree
          "O" #'org-transclusion-move-to-source
          "P" #'org-transclusion-promote-subtree
          "d" #'org-transclusion-remove
          "e" #'org-transclusion-live-sync-start
          "g" #'org-transclusion-refresh
          "o" #'org-transclusion-open-source))

https://user-images.githubusercontent.com/68159077/140481686-e8d3c39c-77d3-4be0-85d5-db17e1b4e1f4.mp4

nobiot commented 2 years ago

I see...

For indentation, I thought I managed to do this with org-transclusion-content-format-org but apparently, this is not the case. Indentation with Org is complex. I will try to look but it will not be a quick one.

For promote/demote, they work only when subtrees are transcluded, not paragraphs . So they shouldn't do anything in your example on list item.

As far as I can check, open-source, move-to-source, remove, live-sync-start, refresh all work as intended.

In your case, "* Hierocracy 2" can be promoted/demoted by normal Org functions (or adding/removing stars).