branch: externals/yaml commit f99ef76c80e6fc3fcf650c4fe34e10726594a4c4 Merge: 09e46d563f 3f1be7640b Author: Zachary Romero <zacrom...@posteo.net> Commit: GitHub <nore...@github.com>
Merge pull request #61 from ergopractice/control-encode-scalars-as-flow-seq Adds control for encoding scalars as flow sequences --- yaml.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yaml.el b/yaml.el index fe3c42f277..ae6084fd3d 100644 --- a/yaml.el +++ b/yaml.el @@ -45,6 +45,9 @@ (defconst yaml-parser-version "0.5.1") +(defvar yaml--encode-use-flow-sequence t + "Turn on encoding sequence of scalars as flow sequence.") + (defvar yaml--parse-debug nil "Turn on debugging messages when parsing YAML when non-nil. @@ -2672,7 +2675,8 @@ auto-detecting the indentation" (yaml--encode-hash-table ht indent auto-indent)) ((zerop (length l)) (insert "[]")) - ((seq-every-p #'yaml--scalarp l) + ((and yaml--encode-use-flow-sequence + (seq-every-p #'yaml--scalarp l)) (insert "[") (yaml--encode-object (car l) 0) (seq-do (lambda (object)