Ver Fonte

ob-exp: Use `user-error' over `error' when applicable

* lisp/ob-exp.el (org-babel-exp-process-buffer): Use `user-error'.
  Also keep lines within 80 characters.
Nicolas Goaziou há 10 anos atrás
pai
commit
ac12984ff6
1 ficheiros alterados com 7 adições e 5 exclusões
  1. 7 5
      lisp/ob-exp.el

+ 7 - 5
lisp/ob-exp.el

@@ -258,14 +258,16 @@ may make them unreachable."
 		 (let* ((match-start (copy-marker (match-beginning 0)))
 			(ind (org-get-indentation))
 			(lang (or (org-element-property :language element)
-				  (error "No language for src block: %s"
-					 (or (org-element-property :name element)
-					     "(unnamed)"))))
+				  (user-error
+				   "No language for src block: %s"
+				   (or (org-element-property :name element)
+				       "(unnamed)"))))
 			(headers
 			 (cons lang
 			       (let ((params
-				      (org-element-property :parameters element)))
-				 (and params (org-split-string params "[ \t]+"))))))
+				      (org-element-property
+				       :parameters element)))
+				 (and params (org-split-string params))))))
 		   ;; Take care of matched block: compute replacement
 		   ;; string.  In particular, a nil REPLACEMENT means
 		   ;; the block should be left as-is while an empty