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

Links to paragraph target #101

Closed oatmealm closed 3 years ago

oatmealm commented 3 years ago

Hi! I'm trying to transclude a paragraph. I've noticed that when I'm trying to generate a link to a paragraph target, I'm now seeing this org-ref links instead of the default ones you'd expect.

Screenshot from 2021-11-02 08-51-37

They look like this: [[Crefrange:x1][Crefrange:x1]]

Any idea what's happening? I'm not sure why is org-ref taking over in this case...

Looking at the varaible I see:

org-store-link-plist is a variable defined in ol.el.

Value
(:type "Crefrange" :link "Crefrange:target")
nobiot commented 3 years ago

Sorry, no idea, really. I don't use Org-ref.

oatmealm commented 3 years ago

Seem to have bee a problem in load order... sorry to have bothered you!

oatmealm commented 2 years ago

Hi there... problems solved with help from @jkitchin (https://github.com/jkitchin/org-ref/issues/929#issuecomment-960087953)... problem though is similar to what I've reported on org-roam recently. I've reverted to org-mode 9.5 but now org-transclusion seem to include the complete file from the point of the target.

Link style:

#+transclude: [[file:~/Nextcloud/roam/references/ocr/כהן1996.org::תרבות_ברק]] 

This is the complete paragraph, which has line breaks before and after.

במיוחד להקשר ההיסטורי, וברצוננו להיעזר אפוא בהגדרתו של ההיסטוריון [[id:98da41c4-2b22-4d1b-b89e-4dc8f2bec308][פ' ברק]]
(‏Burke), בספרו על התרבות העממית של ראשית העת החדשה באירופה: <<תרבות_ברק>> 'תרבות
היא ‏מערכת של משמעויות, גישות וערכים משותפים, והצורות הסמליות (מופעים, חפצים)‎
שבהם היא מתבטאת או מתגלמת'.[fn:4]
nobiot commented 2 years ago

Let me look…

nobiot commented 2 years ago

@oatmealm for the paragraph error, it's my bad. I can repro it and know what's wrong. I'm working so need to come back for a fix after work/weekend.

For now, two options for a quick fix.

  1. Back out newest commits and (probably) go back to this 296264f1680736cc03dbbea1fed5fb4741a87b78 -- this should be free of the problem but cannot confirm now -- sorry
  2. Remove this extension from customizing/setq, and reload Emacs (if you don't use :src and :lines properties this should be no problem). image

For option 2, reload is required as the extension's library gets loaded and cannot be unload.

The issue is in the src-lines extension, where I mistakingly defined the condion to include ANY search option. This of course includes ::para -- obvious interference.

Nothing to do with your going back to 9.5; completely my own making.

I'll open a new issue as it is not related to Org-ref issue.

nobiot commented 2 years ago

This line of the code is the problem... But need to take some time to fix it properly.

https://github.com/nobiot/org-transclusion/blob/main/org-transclusion-src-lines.el#L54

oatmealm commented 2 years ago

Hi. Thanks for looking into it.

  1. Reverting didn't help. When I enable transclusion it doesn't bring in any text at all.
  2. Back to the current version, I tried disabling the extensions feature via the customize interface, but I'm getting this error when I enable transclusion or try to add.
 '(org-transclusion-extensions nil)
progn: ‘recenter’ing a window that does not display current-buffer.
jkitchin commented 2 years ago

Hi there... problems solved with help from @jkitchin (jkitchin/org-ref#929 (comment))... problem though is similar to what I've reported on org-roam recently. I've reverted to org-mode 9.5 but now org-transclusion seem to include the complete file from the point of the target.

Link style:

#+transclude: [[file:~/Nextcloud/roam/references/ocr/כהן1996.org::תרבות_ברק]] 

This is the complete paragraph, which has line breaks before and after.

במיוחד להקשר ההיסטורי, וברצוננו להיעזר אפוא בהגדרתו של ההיסטוריון [[id:98da41c4-2b22-4d1b-b89e-4dc8f2bec308][פ' ברק]]
(‏Burke), בספרו על התרבות העממית של ראשית העת החדשה באירופה: <<תרבות_ברק>> 'תרבות
היא ‏מערכת של משמעויות, גישות וערכים משותפים, והצורות הסמליות (מופעים, חפצים)‎
שבהם היא מתבטאת או מתגלמת'.[fn:4]

I think you will see this link problem with any org-link that can store a position on a target. I asked on the org mailing list about it to see if there is a solution.

nobiot commented 2 years ago

progn: ‘recenter’ing a window that does not display current-buffer.

This is a known issue with Doom. Can you see an entry in the Known Limitation section in readme and see if it helps?

oatmealm commented 2 years ago

Right. I think I had it setup in my old configuration and I forgot about that solution. Thanks

nobiot commented 2 years ago

@oatmealm The paragraph issue should be fixed now. Let me know if you still experience any oddities. Once the Doom issue is fixed, for now I hope you are good to go.

The Doom issue is related to use of org-link-search in transclusion and Doom's hack for the lang:org module. I am not 100% happy with the behaviour of org-link-search but so far it works to some degree. I might revisit it a little later.