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)))
|
(regexp-quote (format "%S" (car pair)))
|
||||||
(if (stringp (cdr pair))
|
(if (stringp (cdr pair))
|
||||||
(cdr pair) (format "%S" (cdr pair)))
|
(cdr pair) (format "%S" (cdr pair)))
|
||||||
body)))
|
body t t)))
|
||||||
(org-babel--get-vars params))
|
(org-babel--get-vars params))
|
||||||
(let ((prologue (cdr (assq :prologue params)))
|
(let ((prologue (cdr (assq :prologue params)))
|
||||||
(epilogue (cdr (assq :epilogue params))))
|
(epilogue (cdr (assq :epilogue params))))
|
||||||
|
|
|
@ -142,7 +142,7 @@ blocks.")
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
(concat "$" (regexp-quote name))
|
(concat "$" (regexp-quote name))
|
||||||
(if (stringp value) value (format "%S" value))
|
(if (stringp value) value (format "%S" value))
|
||||||
body))))
|
body t t))))
|
||||||
vars)
|
vars)
|
||||||
(concat
|
(concat
|
||||||
(and prologue (concat prologue "\n"))
|
(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
|
(setq body (replace-regexp-in-string
|
||||||
(regexp-quote (format "$%s" (car var)))
|
(regexp-quote (format "$%s" (car var)))
|
||||||
(format "%s" (cdr var))
|
(format "%s" (cdr var))
|
||||||
body nil 'literal)))
|
body 'fixedcase 'literal)))
|
||||||
|
|
||||||
(let ((prologue (cdr (assq :prologue params)))
|
(let ((prologue (cdr (assq :prologue params)))
|
||||||
(epilogue (cdr (assq :epilogue params))))
|
(epilogue (cdr (assq :epilogue params))))
|
||||||
|
|
|
@ -407,11 +407,11 @@ argument mechanism."
|
||||||
val (if sqlite
|
val (if sqlite
|
||||||
nil
|
nil
|
||||||
'(:fmt (lambda (el) (if (stringp el)
|
'(:fmt (lambda (el) (if (stringp el)
|
||||||
el
|
el
|
||||||
(format "%S" el))))))))
|
(format "%S" el))))))))
|
||||||
data-file)
|
data-file)
|
||||||
(if (stringp val) val (format "%S" val))))
|
(if (stringp val) val (format "%S" val))))
|
||||||
body)))
|
body t t)))
|
||||||
vars)
|
vars)
|
||||||
body)
|
body)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue