branch: externals/yaml commit 8903b6c7e46cae482da0c0395ff3f0559155f339 Author: Naoya Yamashita <con...@gmail.com> Commit: Naoya Yamashita <con...@gmail.com>
return plist key as a keyword as a default --- yaml.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/yaml.el b/yaml.el index a858a82d76..4fb3c77dd2 100644 --- a/yaml.el +++ b/yaml.el @@ -413,9 +413,12 @@ This flag is intended for development purposes.") (progn (let ((key (pop yaml--cache)) (table (car yaml--object-stack))) - (when (and (eql 'symbol yaml--parsing-object-key-type) - (stringp key)) - (setq key (intern key))) + (when (stringp key) + (cond + ((eql 'symbol yaml--parsing-object-key-type) + (setq key (intern key))) + ((eql 'keyword yaml--parsing-object-key-type) + (setq key (intern (format ":%s" key)))))) (puthash key value table)) (pop yaml--state-stack))) ((equal top-state :trail-comments) @@ -967,10 +970,14 @@ value. It defaults to the symbol :false." (cond ((or (not object-key-type) (equal 'string object-key-type)) - (setq yaml--parsing-object-key-type 'string)) + (if (equal 'plist yaml--parsing-object-type) + (setq yaml--parsing-object-key-type 'keyword) + (setq yaml--parsing-object-key-type 'string))) ((equal 'symbol object-key-type) (setq yaml--parsing-object-key-type 'symbol)) - (t (error "Invalid object-key-type. object-key-type must be string, or symbol"))) + ((equal 'keyword object-key-type) + (setq yaml--parsing-object-key-type 'keyword)) + (t (error "Invalid object-key-type. object-key-type must be string, keyword, or symbol"))) (cond ((or (not sequence-type) (equal sequence-type 'array))