Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions progs/init-julia.scm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : init-julia.scm
;; DESCRIPTION : Initialize the julia plugin
Expand All @@ -9,7 +9,7 @@
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(define (julia-serialize lan t)
(with u (pre-serialize lan t)
Expand Down Expand Up @@ -37,5 +37,26 @@
(:tab-completion #t)
(:session "Julia"))

(when (supports-julia?)
(plugin-input-converters julia))
;; NOTE: We intentionally do NOT call (plugin-input-converters julia) here.
;;
;; Calling (plugin-input-converters julia) β€” even with no rules β€” registers
;; "julia" into the `plugin-input-converters%` logic group. The predicate
;; `plugin-supports-math-input-ref` (defined in plugin-convert.scm) checks
;; exactly that group:
;;
;; (tm-define (plugin-supports-math-input-ref key)
;; (lazy-input-converter-force key)
;; (logic-in? key plugin-input-converters%)) ; <-- the check
;;
;; When it returns #t, `plugin-preprocess` (in plugin-eval.scm) converts the
;; input tree through `plugin-math-input`, which flattens the document tree
;; into a single math expression and strips all newline characters. This
;; breaks multiline code in executable folds (Insert β†’ Fold β†’ Executable).
;;
;; Julia's custom `julia-serialize` serializer already handles the full
;; input tree correctly via `texmacs->code` with "SourceCode" style, so
;; math-input pre-processing is not needed and must be kept disabled.
;;
;; References:
;; https://github.com/mgubi/tm-julia/issues/12