branch: externals/termint commit 06f4ddf00cdd66b6d4c926f2a7a64af9e8cacf4a Author: Milan Glacier <d...@milanglacier.com> Commit: Milan Glacier <d...@milanglacier.com>
feat!: change builtin source syntax variable names to avoid confusion. --- README.md | 4 ++-- termint.el | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8a1b265cff..ae6ee6298a 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ In the below example, we created two REPL schemas: :config (termint-define "ipython" "ipython" :bracketed-paste-p t - :source-syntax termint--ipython-source-syntax) + :source-syntax termint-ipython-source-syntax-template) ;; C-c m s: `termint-ipython-start' ;; C-c m r: `termint-ipython-send-region' @@ -145,7 +145,7 @@ In the below example, we created two REPL schemas: :config (setq termint-backend 'eat) (termint-define "zsh" "zsh" :bracketed-paste-p t - :source-syntax termint--bash-source-syntax)) + :source-syntax termint-bash-source-syntax-template)) ``` diff --git a/termint.el b/termint.el index 5c903dd493..8020ca360e 100644 --- a/termint.el +++ b/termint.el @@ -348,23 +348,28 @@ Delete the temp file afterwards unless KEEP-FILE is non-nil." (unless keep-file (run-with-idle-timer 5 nil #'delete-file file)) file)) -(defvar termint--python-source-syntax +(defvar termint-python-source-syntax-template "exec(compile(open(\"{{file}}\", \"r\").read(), \"{{file}}\", \"exec\"))" - "The syntax used to source code content into the Python REPL. + "The template syntax used to source code content into the Python REPL. Be aware that if you intend to use PDB with functions sourced from a temporary file, you should avoid deleting the temporary file. In such scenarios, use `:source-func' instead of `:source-syntax', as `:source-syntax' will delete the temporary file.") -(defvar termint--ipython-source-syntax +(defvar termint-ipython-source-syntax-template "%run -i \"{{file}}\"" - "The syntax used to source code content into the iPython REPL.") + "The template syntax used to source code content into the iPython REPL. +Be aware that if you intend to use PDB with functions sourced from a +temporary file, you should avoid deleting the temporary file. In such +scenarios, use `:source-func' instead of `:source-syntax', as +`:source-syntax' will delete the temporary file.") -(defvar termint--R-source-syntax "eval(parse(text = readr::read_file(\"{{file}}\")))" - "The syntax used to source code content into the R REPL.") +(defvar termint-R-source-syntax-template + "eval(parse(text = readr::read_file(\"{{file}}\")))" + "The template syntax used to source code content into the R REPL.") -(defvar termint--bash-source-syntax "source {{file}}" - "The syntax used to source code content into the Bash REPL.") +(defvar termint-bash-source-syntax-template "source {{file}}" + "The template syntax used to source code content into the Bash REPL.") (provide 'termint) ;;; termint.el ends here