org-babel: Fix smart `replace-regexp-in-string' behavior during variable assignment

* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lilypond.el (org-babel-expand-body:lilypond):
* lisp/ob-org.el (org-babel-expand-body:org):
* lisp/ob-sql.el (org-babel-sql-expand-vars): Pass FIXEDCASE and
LITERAL arguments to `replace-regexp-in-string'.  This avoids changing
case and special handling of \N constructs in the replacement string.
This commit is contained in:
Ihor Radchenko 2024-03-07 15:49:07 +03:00
parent 0608ae1062
commit 0a6c881174
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
4 changed files with 6 additions and 6 deletions

View File

@ -136,7 +136,7 @@ exporting the literal LaTeX source."
(regexp-quote (format "%S" (car pair)))
(if (stringp (cdr pair))
(cdr pair) (format "%S" (cdr pair)))
body)))
body t t)))
(org-babel--get-vars params))
(let ((prologue (cdr (assq :prologue params)))
(epilogue (cdr (assq :epilogue params))))

View File

@ -142,7 +142,7 @@ blocks.")
(replace-regexp-in-string
(concat "$" (regexp-quote name))
(if (stringp value) value (format "%S" value))
body))))
body t t))))
vars)
(concat
(and prologue (concat prologue "\n"))

View File

@ -51,7 +51,7 @@ $VAR instances are replaced by VAR values defined in PARAMS."
(setq body (replace-regexp-in-string
(regexp-quote (format "$%s" (car var)))
(format "%s" (cdr var))
body nil 'literal)))
body 'fixedcase 'literal)))
(let ((prologue (cdr (assq :prologue params)))
(epilogue (cdr (assq :epilogue params))))

View File

@ -407,11 +407,11 @@ argument mechanism."
val (if sqlite
nil
'(:fmt (lambda (el) (if (stringp el)
el
(format "%S" el))))))))
el
(format "%S" el))))))))
data-file)
(if (stringp val) val (format "%S" val))))
body)))
body t t)))
vars)
body)