nobiot / org-transclusion

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

use org-transclusion-make-from-link in a LaTeX file? #155

Closed ouboub closed 1 year ago

ouboub commented 1 year ago

Hi

org-transclusion-mode is a minor mode.

Would it be possible to use a LaTeX file as a target file and and org file as a source. I tried it out.

1) turn on org-transclusion-mode in LaTeX
2) inserted an org link, but
3)  org-transclusion-make-from-link then gave an error
Debugger entered--Lisp error: (error "rx ‘**’ range error")
  signal(error ("rx ‘**’ range error"))
  error("rx `%s' range error" **)
  rx--translate-bounded-repetition(** (1 0 "*"))
  rx--translate-**((1 0 "*"))
  rx--translate-form((** 1 0 "*"))
  rx--translate((** 1 0 "*"))
  mapcar(rx--translate (line-start (** 1 0 "*") " "))
  rx--translate-seq((line-start (** 1 0 "*") " "))
  rx--translate-form((seq line-start (** 1 0 "*") " "))
  rx--translate((seq line-start (** 1 0 "*") " "))
  rx-to-string((seq line-start (** 1 0 "*") " "))
  org-element-headline-parser(nil fast)
  org-element--parse-to(7244)
  org-element-at-point()
  org-element-context()
  org-transclusion-make-from-link(nil)
  funcall-interactively(org-transclusion-make-from-link nil)
  call-interactively(org-transclusion-make-from-link record nil)
  command-execute(org-transclusion-make-from-link record)
  execute-extended-command(nil "org-transclusion-make-from-link" "org-transclusion-mak")
  funcall-interactively(execute-extended-command nil "org-transclusion-make-from-link" "org-transclusion-mak")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Not sure how to interpret this error trace.

regards

nobiot commented 1 year ago

Hi @ouboub

Would it be possible to use a LaTeX file as a target file and and org file as a source. I tried it out.

It's an interesting experiment. I think that your result confirmed my suspicion that it would not work. Org-transclusion uses the built-in org-element to parse the buffer you are currently in... So if you use LaTex syntax and a mojor mode for it, Org and Org-transclusion via org-element would not know what are a link and keyword (#+transclude:).

Maybe I should implement a message when the minor mode is turned on in a buffer that is not Org-mode... That might be more user-friendly.

Thanks for your experiment and reporting the outcome; helpful for me.

ouboub commented 1 year ago

"NO" == Noboru Ota @.***> writes:

Hi @ouboub

Would it be possible to use a LaTeX file as a target file and and org file as a source. I tried it out.

It's an interesting experiment. I think that your result confirmed my suspicion that it would not work. Org-transclusion uses the built-in org-element to purse the buffer you are currently in... So if you use LaTex syntax and a mojor mode for it, Org and Org-transclusion via org-element would not know what are a link and keyword (#+transclude:).

I see, ok, makes sense but it was worth a try.

nobiot commented 1 year ago

Yes, thank for your experiment and representing:)