From 5cc69a9ebfbb966a8e2a22f296b5d30827878ae5 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 6 Oct 2018 09:40:33 +0200 Subject: [PATCH] Deprecate `org-babel-strip-quotes' in favor of `org-strip-quotes' * lisp/ob-core.el (org-babel-strip-quotes): Remove function. * lisp/org-macs.el (org-strip-quotes): New function. * lisp/org-compat.el (org-babel-strip-quotes): Alias for new function. * lisp/ob-haskell.el (org-babel-execute:haskell): * lisp/ob-octave.el (org-babel-octave-evaluate-session): Use new function. --- lisp/ob-core.el | 4 ---- lisp/ob-haskell.el | 9 ++++----- lisp/ob-octave.el | 10 ++++------ lisp/org-compat.el | 3 +++ lisp/org-macs.el | 4 ++++ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 32de18e77..aae361740 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -3160,10 +3160,6 @@ Callers of this function will probably want to add an entry to (when (and sym (boundp sym)) (defvaralias (intern (concat "org-babel-" var ":" new)) sym))))) -(defun org-babel-strip-quotes (string) - "Strip \\\"s from around a string, if applicable." - (org-unbracket-string "\"" "\"" string)) - (provide 'ob-core) ;; Local variables: diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el index 8fd61990d..ff975f7f9 100644 --- a/lisp/ob-haskell.el +++ b/lisp/ob-haskell.el @@ -74,17 +74,16 @@ (org-babel-variable-assignments:haskell params))) (session (org-babel-haskell-initiate-session session params)) (comint-preoutput-filter-functions - (cons 'ansi-color-filter-apply comint-preoutput-filter-functions)) + (cons 'ansi-color-filter-apply comint-preoutput-filter-functions)) (raw (org-babel-comint-with-output (session org-babel-haskell-eoe t full-body) (insert (org-trim full-body)) (comint-send-input nil t) (insert org-babel-haskell-eoe) (comint-send-input nil t))) - (results (mapcar - #'org-babel-strip-quotes - (cdr (member org-babel-haskell-eoe - (reverse (mapcar #'org-trim raw))))))) + (results (mapcar #'org-strip-quotes + (cdr (member org-babel-haskell-eoe + (reverse (mapcar #'org-trim raw))))))) (org-babel-reassemble-table (let ((result (pcase result-type diff --git a/lisp/ob-octave.el b/lisp/ob-octave.el index 61492c758..bc3dc4c2f 100644 --- a/lisp/ob-octave.el +++ b/lisp/ob-octave.el @@ -237,13 +237,11 @@ value of the last statement in BODY, as elisp." (`output (setq results (if matlabp - (cdr (reverse (delq "" (mapcar - #'org-babel-strip-quotes - (mapcar #'org-trim raw))))) + (cdr (reverse (delq "" (mapcar #'org-strip-quotes + (mapcar #'org-trim raw))))) (cdr (member org-babel-octave-eoe-output - (reverse (mapcar - #'org-babel-strip-quotes - (mapcar #'org-trim raw))))))) + (reverse (mapcar #'org-strip-quotes + (mapcar #'org-trim raw))))))) (mapconcat #'identity (reverse results) "\n"))))) (defun org-babel-octave-import-elisp-from-file (file-name) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 714ad7848..f180f11da 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -460,6 +460,9 @@ use of this function is for the stuck project list." (debug (body))) `(with-silent-modifications ,@body)) +(define-obsolete-function-alias 'org-babel-strip-quotes + 'org-strip-quotes "Org 9.2") + ;;;; Obsolete link types (eval-after-load 'org diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 93c2140a0..fa052a9cf 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -882,6 +882,10 @@ removed." (substring string (length pre) (- (length post))) string)) +(defun org-strip-quotes (string) + "Strip double quotes from around a string, if applicable." + (org-unbracket-string "\"" "\"" string)) + (defsubst org-current-line-string (&optional to-here) (buffer-substring (point-at-bol) (if to-here (point) (point-at-eol))))