Rename spacemacs/mplist-get functions to be more descriptive

* spacemacs/mplist-get -> spacemacs/mplist-get-values
* spacemacs/plist-get -> spacemacs/mplist-get-value
* refactor spacemacs/mplist-get-value to be defined in terms of mplist-get-values

Ref #10803 See [comment]

[comment]: https://github.com/syl20bnr/spacemacs/pull/10803#issuecomment-395292606
This commit is contained in:
Benjamin Reynolds 2018-06-07 05:13:06 -05:00 committed by syl20bnr
parent 8754b24509
commit 594fdc8f05
11 changed files with 72 additions and 80 deletions

View File

@ -728,7 +728,7 @@ layer directory."
(defun configuration-layer//select-packages (layer-specs packages) (defun configuration-layer//select-packages (layer-specs packages)
"Return the selected packages of LAYER-SPECS from given PACKAGES list." "Return the selected packages of LAYER-SPECS from given PACKAGES list."
(let* ((value (when (listp layer-specs) (let* ((value (when (listp layer-specs)
(spacemacs/mplist-get layer-specs :packages))) (spacemacs/mplist-get-values layer-specs :packages)))
(selected-packages (if (and (not (null (car value))) (selected-packages (if (and (not (null (car value)))
(listp (car value))) (listp (car value)))
(car value) (car value)
@ -769,17 +769,17 @@ If USEDP or `configuration-layer--load-packages-files' is non-nil then the
layer-name) layer-name)
(let* ((dir (file-name-as-directory dir)) (let* ((dir (file-name-as-directory dir))
(disabled (when (listp layer-specs) (disabled (when (listp layer-specs)
(spacemacs/mplist-get layer-specs :disabled-for))) (spacemacs/mplist-get-values layer-specs :disabled-for)))
(enabled (if (and (listp layer-specs) (enabled (if (and (listp layer-specs)
(memq :enabled-for layer-specs)) (memq :enabled-for layer-specs))
(spacemacs/mplist-get layer-specs :enabled-for) (spacemacs/mplist-get-values layer-specs :enabled-for)
'unspecified)) 'unspecified))
(variables (when (listp layer-specs) (variables (when (listp layer-specs)
(spacemacs/mplist-get layer-specs :variables))) (spacemacs/mplist-get-values layer-specs :variables)))
(shadow (shadow
(if (and (listp layer-specs) (if (and (listp layer-specs)
(memq :can-shadow layer-specs)) (memq :can-shadow layer-specs))
(spacemacs/mplist-get layer-specs :can-shadow) (spacemacs/mplist-get-values layer-specs :can-shadow)
'unspecified)) 'unspecified))
(packages-file (concat dir "packages.el")) (packages-file (concat dir "packages.el"))
(packages (when (and (null packages) (packages (when (and (null packages)
@ -1239,7 +1239,7 @@ USEDP if non-nil indicates that made packages are used packages."
"Configure auto-installation of layer with name LAYER-NAME." "Configure auto-installation of layer with name LAYER-NAME."
(declare (indent 1)) (declare (indent 1))
(when (configuration-layer//lazy-install-p layer-name) (when (configuration-layer//lazy-install-p layer-name)
(let ((extensions (spacemacs/mplist-get props :extensions)) (let ((extensions (spacemacs/mplist-get-values props :extensions))
(interpreter (plist-get props :interpreter))) (interpreter (plist-get props :interpreter)))
(when (configuration-layer/layer-used-p layer-name) (when (configuration-layer/layer-used-p layer-name)
(let* ((layer (configuration-layer/get-layer layer-name)) (let* ((layer (configuration-layer/get-layer layer-name))

View File

@ -445,7 +445,7 @@ the symbol of an editing style and the cdr is a list of keyword arguments like
(cond (cond
((symbolp config) config) ((symbolp config) config)
((listp config) ((listp config)
(let ((variables (spacemacs/mplist-get config :variables))) (let ((variables (spacemacs/mplist-get-values config :variables)))
(while variables (while variables
(let ((var (pop variables))) (let ((var (pop variables)))
(if (consp variables) (if (consp variables)
@ -764,7 +764,7 @@ error recovery."
hybrid)) hybrid))
(and (listp x) (and (listp x)
(member (car x) '(vim emacs hybrid)) (member (car x) '(vim emacs hybrid))
(spacemacs/mplist-get x :variables)))) (spacemacs/mplist-get-values x :variables))))
'dotspacemacs-editing-style 'dotspacemacs-editing-style
"is \'vim, \'emacs or \'hybrid or and list with `:variables' keyword") "is \'vim, \'emacs or \'hybrid or and list with `:variables' keyword")
(spacemacs//test-var (spacemacs//test-var

View File

@ -30,7 +30,7 @@ values."
;; ns is returned instead of mac on Emacs 25+ ;; ns is returned instead of mac on Emacs 25+
(memq (window-system) '(mac ns))) (memq (window-system) '(mac ns)))
(defun spacemacs/mplist-get (plist prop) (defun spacemacs/mplist-get-values (plist prop)
"Get the values associated to PROP in PLIST, a modified plist. "Get the values associated to PROP in PLIST, a modified plist.
A modified plist is one where keys are keywords and values are A modified plist is one where keys are keywords and values are
@ -50,8 +50,8 @@ Currently this function infloops when the list is circular."
(push (pop tail) result)) (push (pop tail) result))
(nreverse result))) (nreverse result)))
(defun spacemacs/plist-get (plist prop) (defun spacemacs/mplist-get-value (plist prop)
"Get the value associated to PROP in PLIST, a modified plist. "Get a single value associated to PROP in PLIST, a modified plist.
You should always use this function instead of builtin `plist-get' You should always use this function instead of builtin `plist-get'
in Spacemacs. in Spacemacs.
@ -63,15 +63,7 @@ If there are multiple properties with the same keyword, only the first property
and its values is returned. and its values is returned.
Currently this function infloops when the list is circular." Currently this function infloops when the list is circular."
(let ((tail plist) (car (spacemacs/mplist-get-values plist prop)))
result)
(while (and (consp tail) (not (eq prop (car tail))))
(pop tail))
;; pop the found keyword
(pop tail)
(when (and (consp tail) (not (keywordp (car tail))))
(setq result (pop tail)))
result))
(defun spacemacs/mplist-remove (plist prop) (defun spacemacs/mplist-remove (plist prop)
"Return a copy of a modified PLIST without PROP and its values. "Return a copy of a modified PLIST without PROP and its values.
@ -130,10 +122,10 @@ Supported properties:
`:define-key CONS CELL' `:define-key CONS CELL'
One or several cons cells (MAP . KEY) where MAP is a mode map and KEY is a One or several cons cells (MAP . KEY) where MAP is a mode map and KEY is a
key sequence string to be set with `define-key'. " key sequence string to be set with `define-key'. "
(let ((evil-leader (spacemacs/mplist-get props :evil-leader)) (let ((evil-leader (spacemacs/mplist-get-values props :evil-leader))
(evil-leader-for-mode (spacemacs/mplist-get props :evil-leader-for-mode)) (evil-leader-for-mode (spacemacs/mplist-get-values props :evil-leader-for-mode))
(global-key (spacemacs/mplist-get props :global-key)) (global-key (spacemacs/mplist-get-values props :global-key))
(def-key (spacemacs/mplist-get props :define-key))) (def-key (spacemacs/mplist-get-values props :define-key)))
(append (append
(when evil-leader (when evil-leader
`((dolist (key ',evil-leader) `((dolist (key ',evil-leader)

View File

@ -98,16 +98,16 @@ All properties supported by `spacemacs//create-key-binding-form' can be
used." used."
(declare (indent 1)) (declare (indent 1))
(let* ((func (spacemacs//micro-state-func-name name)) (let* ((func (spacemacs//micro-state-func-name name))
(doc (spacemacs/mplist-get props :doc)) (doc (spacemacs/mplist-get-values props :doc))
(persistent (plist-get props :persistent)) (persistent (plist-get props :persistent))
(disable-leader (plist-get props :disable-evil-leader)) (disable-leader (plist-get props :disable-evil-leader))
(msg-func (if (plist-get props :use-minibuffer) (msg-func (if (plist-get props :use-minibuffer)
'message 'message
'lv-message)) 'lv-message))
(exec-binding (plist-get props :execute-binding-on-enter)) (exec-binding (plist-get props :execute-binding-on-enter))
(on-enter (spacemacs/mplist-get props :on-enter)) (on-enter (spacemacs/mplist-get-values props :on-enter))
(on-exit (spacemacs/mplist-get props :on-exit)) (on-exit (spacemacs/mplist-get-values props :on-exit))
(bindings (spacemacs/mplist-get props :bindings)) (bindings (spacemacs/mplist-get-values props :bindings))
(wrappers (spacemacs//micro-state-create-wrappers (wrappers (spacemacs//micro-state-create-wrappers
name doc msg-func disable-leader bindings)) name doc msg-func disable-leader bindings))
(keymap-body (spacemacs//micro-state-fill-map-sexps wrappers)) (keymap-body (spacemacs//micro-state-fill-map-sexps wrappers))
@ -159,9 +159,9 @@ used."
"Create a wrapper of FUNC and return a tuple (key wrapper BINDING)." "Create a wrapper of FUNC and return a tuple (key wrapper BINDING)."
(let* ((key (car binding)) (let* ((key (car binding))
(wrapped (cadr binding)) (wrapped (cadr binding))
(binding-doc (spacemacs/mplist-get binding :doc)) (binding-doc (spacemacs/mplist-get-values binding :doc))
(binding-pre (spacemacs/mplist-get binding :pre)) (binding-pre (spacemacs/mplist-get-values binding :pre))
(binding-post (spacemacs/mplist-get binding :post)) (binding-post (spacemacs/mplist-get-values binding :post))
(wrapper-name (intern (format "spacemacs//%S-%S-%s" name wrapped key))) (wrapper-name (intern (format "spacemacs//%S-%S-%s" name wrapped key)))
(doc-body (doc-body
`((let ((bdoc ,@binding-doc) `((let ((bdoc ,@binding-doc)

View File

@ -74,12 +74,12 @@ used."
(status (or mode (plist-get props :status))) (status (or mode (plist-get props :status)))
(condition (plist-get props :if)) (condition (plist-get props :if))
(doc (plist-get props :documentation)) (doc (plist-get props :documentation))
(on-body (if mode `((,mode)) (spacemacs/mplist-get props :on))) (on-body (if mode `((,mode)) (spacemacs/mplist-get-values props :on)))
(off-body (if mode `((,mode -1)) (spacemacs/mplist-get props :off))) (off-body (if mode `((,mode -1)) (spacemacs/mplist-get-values props :off)))
(prefix-arg-var (plist-get props :prefix)) (prefix-arg-var (plist-get props :prefix))
(on-message (plist-get props :on-message)) (on-message (plist-get props :on-message))
(off-message (plist-get props :off-message)) (off-message (plist-get props :off-message))
(evil-leader-for-mode (spacemacs/mplist-get props :evil-leader-for-mode)) (evil-leader-for-mode (spacemacs/mplist-get-values props :evil-leader-for-mode))
(supported-modes-string (mapconcat (lambda (x) (symbol-name (car x))) (supported-modes-string (mapconcat (lambda (x) (symbol-name (car x)))
evil-leader-for-mode ", ")) evil-leader-for-mode ", "))
(bindkeys (spacemacs//create-key-binding-form props wrapper-func)) (bindkeys (spacemacs//create-key-binding-form props wrapper-func))

View File

@ -166,7 +166,7 @@ used."
(body-func (spacemacs//transient-state-body-func-name name)) (body-func (spacemacs//transient-state-body-func-name name))
(add-bindings (spacemacs//transient-state-add-bindings-name name)) (add-bindings (spacemacs//transient-state-add-bindings-name name))
(remove-bindings (spacemacs//transient-state-remove-bindings-name name)) (remove-bindings (spacemacs//transient-state-remove-bindings-name name))
(bindings (spacemacs/mplist-get props :bindings)) (bindings (spacemacs/mplist-get-values props :bindings))
(doc (or (plist-get props :doc) "\n")) (doc (or (plist-get props :doc) "\n"))
(title (plist-get props :title)) (title (plist-get props :title))
(hint-var (intern (format "%s/hint" func))) (hint-var (intern (format "%s/hint" func)))
@ -176,7 +176,7 @@ used."
(hint (plist-get props :hint)) (hint (plist-get props :hint))
(hint-doc-p (plist-get props :hint-is-doc)) (hint-doc-p (plist-get props :hint-is-doc))
(dyn-hint (plist-get props :dynamic-hint)) (dyn-hint (plist-get props :dynamic-hint))
(additional-docs (spacemacs/mplist-get props :additional-docs)) (additional-docs (spacemacs/mplist-get-values props :additional-docs))
(foreign-keys (plist-get props :foreign-keys)) (foreign-keys (plist-get props :foreign-keys))
(bindkeys (spacemacs//create-key-binding-form props body-func))) (bindkeys (spacemacs//create-key-binding-form props body-func)))
`(progn `(progn

View File

@ -39,7 +39,7 @@ override lazy-loaded settings."
(let ((name-symbol (if (stringp name) (intern name) name)) (let ((name-symbol (if (stringp name) (intern name) name))
(expanded-forms '())) (expanded-forms '()))
(dolist (keyword spacemacs--use-package-add-hook-keywords) (dolist (keyword spacemacs--use-package-add-hook-keywords)
(let ((body (spacemacs/mplist-get plist keyword))) (let ((body (spacemacs/mplist-get-values plist keyword)))
(when body (when body
(let ((hook (intern (format "use-package--%S--%s-hook" (let ((hook (intern (format "use-package--%S--%s-hook"
name-symbol name-symbol

View File

@ -66,15 +66,15 @@ Available PROPS:
`:call-hooks BOOLEAN' `:call-hooks BOOLEAN'
if non-nil then hooked functions are called right away." if non-nil then hooked functions are called right away."
(declare (indent 0)) (declare (indent 0))
(let* ((backends (spacemacs/mplist-get props :backends)) (let* ((backends (spacemacs/mplist-get-values props :backends))
(modes (spacemacs/mplist-get props :modes)) (modes (spacemacs/mplist-get-values props :modes))
(variables (spacemacs/mplist-get props :variables)) (variables (spacemacs/mplist-get-values props :variables))
(from (spacemacs/plist-get props :from)) (from (spacemacs/mplist-get-value props :from))
(hooks (if (memq :append-hooks props) (hooks (if (memq :append-hooks props)
(spacemacs/plist-get props :append-hooks) (spacemacs/mplist-get-value props :append-hooks)
t)) t))
(call-hooks (when (memq :call-hooks props) (call-hooks (when (memq :call-hooks props)
(spacemacs/plist-get props :call-hooks))) (spacemacs/mplist-get-value props :call-hooks)))
(result '(progn))) (result '(progn)))
(dolist (mode modes) (dolist (mode modes)
(let ((backends-var-name (intern (format "company-backends-%S" mode))) (let ((backends-var-name (intern (format "company-backends-%S" mode)))

View File

@ -1301,7 +1301,7 @@ Decision is based on `dotspacemacs-line-numbers'."
Decision is based on `dotspacemacs-line-numbers'." Decision is based on `dotspacemacs-line-numbers'."
(or (eq dotspacemacs-line-numbers 'relative) (or (eq dotspacemacs-line-numbers 'relative)
(and (listp dotspacemacs-line-numbers) (and (listp dotspacemacs-line-numbers)
(car (spacemacs/mplist-get dotspacemacs-line-numbers :relative))))) (car (spacemacs/mplist-get-values dotspacemacs-line-numbers :relative)))))
(defun spacemacs//linum-on (origfunc &rest args) (defun spacemacs//linum-on (origfunc &rest args)
"Advice function to improve `linum-on' function." "Advice function to improve `linum-on' function."
@ -1335,9 +1335,9 @@ Decision is based on `dotspacemacs-line-numbers'."
(defun spacemacs//linum-curent-buffer-is-not-too-big () (defun spacemacs//linum-curent-buffer-is-not-too-big ()
"Return non-nil if buffer size is not too big." "Return non-nil if buffer size is not too big."
(not (and (listp dotspacemacs-line-numbers) (not (and (listp dotspacemacs-line-numbers)
(spacemacs/mplist-get dotspacemacs-line-numbers :size-limit-kb) (spacemacs/mplist-get-values dotspacemacs-line-numbers :size-limit-kb)
(> (buffer-size) (> (buffer-size)
(* 1000 (car (spacemacs/mplist-get dotspacemacs-line-numbers (* 1000 (car (spacemacs/mplist-get-values dotspacemacs-line-numbers
:size-limit-kb))))))) :size-limit-kb)))))))
;; see tests in tests/layers/+distribution/spacemacs-base/line-numbers-utest.el ;; see tests in tests/layers/+distribution/spacemacs-base/line-numbers-utest.el
@ -1347,10 +1347,10 @@ Decision is based on `dotspacemacs-line-numbers'."
;; default `enabled-for-modes' to '(prog-mode text-mode), because it is a more ;; default `enabled-for-modes' to '(prog-mode text-mode), because it is a more
;; sensible default than enabling in all buffers - including Magit buffers, ;; sensible default than enabling in all buffers - including Magit buffers,
;; terminal buffers, etc. ;; terminal buffers, etc.
(let* ((user-enabled-for-modes (spacemacs/mplist-get dotspacemacs-line-numbers (let* ((user-enabled-for-modes (spacemacs/mplist-get-values dotspacemacs-line-numbers
:enabled-for-modes)) :enabled-for-modes))
(enabled-for-modes (or user-enabled-for-modes '(prog-mode text-mode))) (enabled-for-modes (or user-enabled-for-modes '(prog-mode text-mode)))
(disabled-for-modes (spacemacs/mplist-get dotspacemacs-line-numbers (disabled-for-modes (spacemacs/mplist-get-values dotspacemacs-line-numbers
:disabled-for-modes)) :disabled-for-modes))
(enabled-for-parent (or (and (equal enabled-for-modes '(all)) 'all) (enabled-for-parent (or (and (equal enabled-for-modes '(all)) 'all)
(apply #'derived-mode-p enabled-for-modes))) (apply #'derived-mode-p enabled-for-modes)))

View File

@ -259,11 +259,11 @@ Available PROPS:
(symbol-value name) (symbol-value name)
name)) name))
(func (spacemacs//custom-layout-func-name name)) (func (spacemacs//custom-layout-func-name name))
(binding-prop (car (spacemacs/mplist-get props :binding))) (binding-prop (car (spacemacs/mplist-get-values props :binding)))
(binding (if (symbolp binding-prop) (binding (if (symbolp binding-prop)
(symbol-value binding-prop) (symbol-value binding-prop)
binding-prop)) binding-prop))
(body (spacemacs/mplist-get props :body)) (body (spacemacs/mplist-get-values props :body))
(already-defined? (cdr (assoc binding (already-defined? (cdr (assoc binding
spacemacs--custom-layout-alist)))) spacemacs--custom-layout-alist))))
`(progn `(progn

View File

@ -12,81 +12,81 @@
(require 'core-funcs) (require 'core-funcs)
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------
;; spacemacs/mplist-get ;; spacemacs/mplist-get-values
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------
(ert-deftest test-mplist-get--one-property () (ert-deftest test-mplist-get-values--one-property ()
(let* ((input '(dummy :property sym1 sym2 sym3)) (let* ((input '(dummy :property sym1 sym2 sym3))
(result (spacemacs/mplist-get input :property))) (result (spacemacs/mplist-get-values input :property)))
(should (equal '(sym1 sym2 sym3) result)))) (should (equal '(sym1 sym2 sym3) result))))
(ert-deftest test-mplist-get--multiple-properties-get-first () (ert-deftest test-mplist-get-values--multiple-properties-get-first ()
(let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6)) (let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6))
(result (spacemacs/mplist-get input :prop1))) (result (spacemacs/mplist-get-values input :prop1)))
(should (equal '(sym1 sym2 sym3) result)))) (should (equal '(sym1 sym2 sym3) result))))
(ert-deftest test-mplist-get--multiple-properties-get-middle () (ert-deftest test-mplist-get-values--multiple-properties-get-middle ()
(let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6)) (let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6))
(result (spacemacs/mplist-get input :prop2))) (result (spacemacs/mplist-get-values input :prop2)))
(should (equal '(sym4) result)))) (should (equal '(sym4) result))))
(ert-deftest test-mplist-get--multiple-properties-get-last () (ert-deftest test-mplist-get-values--multiple-properties-get-last ()
(let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6)) (let* ((input '(dummy :prop1 sym1 sym2 sym3 :prop2 sym4 :prop3 sym5 sym6))
(result (spacemacs/mplist-get input :prop3))) (result (spacemacs/mplist-get-values input :prop3)))
(should (equal '(sym5 sym6) result)))) (should (equal '(sym5 sym6) result))))
(ert-deftest test-mplist-get--one-property-no-value () (ert-deftest test-mplist-get-values--one-property-no-value ()
(let* ((input '(dummy :property)) (let* ((input '(dummy :property))
(result (spacemacs/mplist-get input :property))) (result (spacemacs/mplist-get-values input :property)))
(should (null result)))) (should (null result))))
(ert-deftest test-mplist-get--multiple-same-poperty-ignore-all-but-first () (ert-deftest test-mplist-get-values--multiple-same-poperty-ignore-all-but-first ()
(let* ((input '(dummy :property val1 :property val2)) (let* ((input '(dummy :property val1 :property val2))
(result (spacemacs/mplist-get input :property))) (result (spacemacs/mplist-get-values input :property)))
(should (equal '(val1) result)))) (should (equal '(val1) result))))
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------
;; spacemacs/plist-get ;; spacemacs/mplist-get-value
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------
(ert-deftest test-plist-get--one-property () (ert-deftest test-mplist-get-value--one-property ()
(let* ((input '(dummy :property sym1)) (let* ((input '(dummy :property sym1))
(result (spacemacs/plist-get input :property))) (result (spacemacs/mplist-get-value input :property)))
(should (equal 'sym1 result)))) (should (equal 'sym1 result))))
(ert-deftest test-plist-get--one-property-multiple-values-returns-first () (ert-deftest test-mplist-get-value--one-property-multiple-values-returns-first ()
(let* ((input '(dummy :property sym1 sym2 sym3)) (let* ((input '(dummy :property sym1 sym2 sym3))
(result (spacemacs/plist-get input :property))) (result (spacemacs/mplist-get-value input :property)))
(should (equal 'sym1 result)))) (should (equal 'sym1 result))))
(ert-deftest test-plist-get--multiple-properties-get-first () (ert-deftest test-mplist-get-value--multiple-properties-get-first ()
(let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5)) (let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5))
(result (spacemacs/plist-get input :prop1))) (result (spacemacs/mplist-get-value input :prop1)))
(should (equal 'sym1 result)))) (should (equal 'sym1 result))))
(ert-deftest test-plist-get--multiple-properties-get-middle () (ert-deftest test-mplist-get-value--multiple-properties-get-middle ()
(let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5)) (let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5))
(result (spacemacs/plist-get input :prop2))) (result (spacemacs/mplist-get-value input :prop2)))
(should (equal 'sym4 result)))) (should (equal 'sym4 result))))
(ert-deftest test-plist-get--multiple-properties-get-last () (ert-deftest test-mplist-get-value--multiple-properties-get-last ()
(let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5)) (let* ((input '(dummy :prop1 sym1 :prop2 sym4 :prop3 sym5))
(result (spacemacs/plist-get input :prop3))) (result (spacemacs/mplist-get-value input :prop3)))
(should (equal 'sym5 result)))) (should (equal 'sym5 result))))
(ert-deftest test-plist-get--one-property-no-value () (ert-deftest test-mplist-get-value--one-property-no-value ()
(let* ((input '(dummy :property)) (let* ((input '(dummy :property))
(result (spacemacs/plist-get input :property))) (result (spacemacs/mplist-get-value input :property)))
(should (null result)))) (should (null result))))
(ert-deftest test-plist-get--one-property-no-value-next-is-another-property () (ert-deftest test-mplist-get-value--one-property-no-value-next-is-another-property ()
(let* ((input '(dummy :property :property2 sym2)) (let* ((input '(dummy :property :property2 sym2))
(result (spacemacs/plist-get input :property))) (result (spacemacs/mplist-get-value input :property)))
(should (null result)))) (should (null result))))
(ert-deftest test-plist-get--multiple-same-poperty-ignore-all-but-first () (ert-deftest test-mplist-get-value--multiple-same-poperty-ignore-all-but-first ()
(let* ((input '(dummy :property val1 :property val2)) (let* ((input '(dummy :property val1 :property val2))
(result (spacemacs/plist-get input :property))) (result (spacemacs/mplist-get-value input :property)))
(should (equal 'val1 result)))) (should (equal 'val1 result))))
;; --------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------