Browse Source

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.
Nicolas Goaziou 6 years ago
parent
commit
5cc69a9ebf
5 changed files with 15 additions and 15 deletions
  1. 0 4
      lisp/ob-core.el
  2. 4 5
      lisp/ob-haskell.el
  3. 4 6
      lisp/ob-octave.el
  4. 3 0
      lisp/org-compat.el
  5. 4 0
      lisp/org-macs.el

+ 0 - 4
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:

+ 4 - 5
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

+ 4 - 6
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)

+ 3 - 0
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

+ 4 - 0
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))))