Function: indent-bars--custom-inherit
indent-bars--custom-inherit is a natively compiled function defined in
indent-bars.el.
Signature
(indent-bars--custom-inherit OLD NEW)
Documentation
Inherit the values of NEW and OLD, which can be values or lists.
NEW and OLD must have the same form, composed of atoms
and (optionally) a final plist. The symbol unspecified in
NEW indicates that that value should be replaced by the
corresponding value in OLD. Any trailing PLIST in NEW and OLD
will be merged (with NEW taking precedence). The merged value is
returned.
Source Code
;; Defined in /nix/store/zkcdcnmcj3605fj09x584bf58d85brax-emacs-packages-deps/share/emacs/site-lisp/elpa/indent-bars-1.0.1/indent-bars.el
(defun indent-bars--custom-inherit (old new)
"Inherit the values of NEW and OLD, which can be values or lists.
NEW and OLD must have the same form, composed of atoms
and (optionally) a final plist. The symbol `unspecified' in
NEW indicates that that value should be replaced by the
corresponding value in OLD. Any trailing PLIST in NEW and OLD
will be merged (with NEW taking precedence). The merged value is
returned."
(cond
((and old (eq new 'unspecified))
old) ; fully inherited
((and (atom old) (atom new))
(if (eq new 'unspecified) old new))
((and (consp old) (consp new))
(let* ((old (copy-sequence old)) ; avoid editing old
(n new) (o old) last-o)
(while (and n o)
(if (and (plistp n) (plistp o) (keywordp (car o)))
(let ((m (map-merge 'plist o n)))
(if last-o (setcdr last-o m) (setq old m))
(setq o nil)) ; signify list complete
(unless (eq (car n) 'unspecified)
(setcar o (car n))))
(setq last-o o n (cdr n) o (cdr o)))
old))
(t new)))