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:
parent
0608ae1062
commit
0a6c881174
|
@ -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))))
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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))))
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue