chore: migrate conditional bindings for Emacs 31
This commit is contained in:
parent
db071d7768
commit
88b23b5f80
@ -163,7 +163,7 @@
|
|||||||
(defun ecss-schema-set-property (schemas id)
|
(defun ecss-schema-set-property (schemas id)
|
||||||
"Return a defensive copy of property ID from SCHEMAS, or nil."
|
"Return a defensive copy of property ID from SCHEMAS, or nil."
|
||||||
(ecss--schema-set-check schemas)
|
(ecss--schema-set-check schemas)
|
||||||
(when-let ((schema (gethash id (ecss--schema-set-table schemas))))
|
(when-let* ((schema (gethash id (ecss--schema-set-table schemas))))
|
||||||
(ecss--copy-property-schema schema)))
|
(ecss--copy-property-schema schema)))
|
||||||
|
|
||||||
(defun ecss-schema-set-property-ids (schemas)
|
(defun ecss-schema-set-property-ids (schemas)
|
||||||
@ -254,7 +254,7 @@
|
|||||||
"Expand one PROPERTY VALUE declaration using SCHEMAS."
|
"Expand one PROPERTY VALUE declaration using SCHEMAS."
|
||||||
(ecss--validate-declaration-property schemas property)
|
(ecss--validate-declaration-property schemas property)
|
||||||
(let ((schema (ecss--schema-for schemas property)))
|
(let ((schema (ecss--schema-for schemas property)))
|
||||||
(if-let ((expander (and schema
|
(if-let* ((expander (and schema
|
||||||
(ecss-property-schema-shorthand schema))))
|
(ecss-property-schema-shorthand schema))))
|
||||||
(pcase-let* ((`(,raw . ,important) (ecss--unwrap-important value))
|
(pcase-let* ((`(,raw . ,important) (ecss--unwrap-important value))
|
||||||
(expanded
|
(expanded
|
||||||
@ -320,7 +320,7 @@ the same expanded longhand, including explicit nil declarations."
|
|||||||
|
|
||||||
(defun ecss--set-origin-layers (stylesheet origin layers)
|
(defun ecss--set-origin-layers (stylesheet origin layers)
|
||||||
"Set STYLESHEET ORIGIN order to LAYERS."
|
"Set STYLESHEET ORIGIN order to LAYERS."
|
||||||
(if-let ((cell (assq origin (ecss--stylesheet-layers stylesheet))))
|
(if-let* ((cell (assq origin (ecss--stylesheet-layers stylesheet))))
|
||||||
(setcdr cell layers)
|
(setcdr cell layers)
|
||||||
(setf (ecss--stylesheet-layers stylesheet)
|
(setf (ecss--stylesheet-layers stylesheet)
|
||||||
(append (ecss--stylesheet-layers stylesheet)
|
(append (ecss--stylesheet-layers stylesheet)
|
||||||
@ -417,7 +417,7 @@ optional selector limiting the rule to a matching subject or ancestor."
|
|||||||
|
|
||||||
(defun ecss--rule-match-facts (rule subject adapter)
|
(defun ecss--rule-match-facts (rule subject adapter)
|
||||||
"Return RULE match facts for SUBJECT through ADAPTER, or nil."
|
"Return RULE match facts for SUBJECT through ADAPTER, or nil."
|
||||||
(when-let ((specificity
|
(when-let* ((specificity
|
||||||
(ecss--selector-matched-specificity
|
(ecss--selector-matched-specificity
|
||||||
(ecss-rule-selector rule) subject adapter)))
|
(ecss-rule-selector rule) subject adapter)))
|
||||||
(let ((distance (ecss--scope-distance
|
(let ((distance (ecss--scope-distance
|
||||||
@ -440,7 +440,7 @@ SPECIFICITY, DISTANCE, and DECLARATION-ORDER are the match precedence facts."
|
|||||||
|
|
||||||
(defun ecss--rule-candidates (rule subject adapter)
|
(defun ecss--rule-candidates (rule subject adapter)
|
||||||
"Return candidates from matching RULE for SUBJECT through ADAPTER."
|
"Return candidates from matching RULE for SUBJECT through ADAPTER."
|
||||||
(when-let ((facts (ecss--rule-match-facts rule subject adapter)))
|
(when-let* ((facts (ecss--rule-match-facts rule subject adapter)))
|
||||||
(cl-loop for (property value) on (ecss-rule-declarations rule) by #'cddr
|
(cl-loop for (property value) on (ecss-rule-declarations rule) by #'cddr
|
||||||
for declaration-order from 0
|
for declaration-order from 0
|
||||||
collect (ecss--candidate-from-rule
|
collect (ecss--candidate-from-rule
|
||||||
|
|||||||
@ -118,7 +118,7 @@ an alist. PARENT and CHILDREN establish its initial tree position."
|
|||||||
(setf (ecss-subject-parent old-child) nil)))
|
(setf (ecss-subject-parent old-child) nil)))
|
||||||
(setf (ecss-subject-children subject) (copy-sequence children))
|
(setf (ecss-subject-children subject) (copy-sequence children))
|
||||||
(dolist (child children)
|
(dolist (child children)
|
||||||
(when-let ((old-parent (ecss-subject-parent child)))
|
(when-let* ((old-parent (ecss-subject-parent child)))
|
||||||
(unless (eq old-parent subject)
|
(unless (eq old-parent subject)
|
||||||
(setf (ecss-subject-children old-parent)
|
(setf (ecss-subject-children old-parent)
|
||||||
(delq child (ecss-subject-children old-parent)))))
|
(delq child (ecss-subject-children old-parent)))))
|
||||||
@ -509,7 +509,7 @@ ancestors, children, or siblings return nil. Invalid selectors signal
|
|||||||
|
|
||||||
(defun ecss--subject-previous-siblings (subject adapter)
|
(defun ecss--subject-previous-siblings (subject adapter)
|
||||||
"Return SUBJECT's preceding siblings through ADAPTER."
|
"Return SUBJECT's preceding siblings through ADAPTER."
|
||||||
(when-let ((parent (ecss--subject-parent subject adapter)))
|
(when-let* ((parent (ecss--subject-parent subject adapter)))
|
||||||
(let ((siblings (ecss--subject-children parent adapter)) result)
|
(let ((siblings (ecss--subject-children parent adapter)) result)
|
||||||
(while (and siblings (not (eq (car siblings) subject)))
|
(while (and siblings (not (eq (car siblings) subject)))
|
||||||
(push (pop siblings) result))
|
(push (pop siblings) result))
|
||||||
@ -580,7 +580,7 @@ Compare without case when INSENSITIVE is non-nil."
|
|||||||
|
|
||||||
(defun ecss--subject-following-siblings (subject adapter)
|
(defun ecss--subject-following-siblings (subject adapter)
|
||||||
"Return siblings following SUBJECT through ADAPTER."
|
"Return siblings following SUBJECT through ADAPTER."
|
||||||
(when-let ((parent (ecss--subject-parent subject adapter)))
|
(when-let* ((parent (ecss--subject-parent subject adapter)))
|
||||||
(let ((siblings (ecss--subject-children parent adapter)))
|
(let ((siblings (ecss--subject-children parent adapter)))
|
||||||
(while (and siblings (not (eq (pop siblings) subject))))
|
(while (and siblings (not (eq (pop siblings) subject))))
|
||||||
siblings)))
|
siblings)))
|
||||||
@ -626,7 +626,7 @@ Compare without case when INSENSITIVE is non-nil."
|
|||||||
(:has (ecss--selector-match-has (cdr selector) subject adapter))
|
(:has (ecss--selector-match-has (cdr selector) subject adapter))
|
||||||
(:descendant (ecss--selector-match-descendant selector subject adapter))
|
(:descendant (ecss--selector-match-descendant selector subject adapter))
|
||||||
(:child (and (ecss-selector-match-p (nth 2 selector) subject adapter)
|
(:child (and (ecss-selector-match-p (nth 2 selector) subject adapter)
|
||||||
(when-let ((parent (ecss--subject-parent subject adapter)))
|
(when-let* ((parent (ecss--subject-parent subject adapter)))
|
||||||
(ecss-selector-match-p (nth 1 selector) parent adapter))))
|
(ecss-selector-match-p (nth 1 selector) parent adapter))))
|
||||||
(:adjacent (ecss--selector-match-adjacent selector subject adapter))
|
(:adjacent (ecss--selector-match-adjacent selector subject adapter))
|
||||||
(:sibling (ecss--selector-match-sibling selector subject adapter))))
|
(:sibling (ecss--selector-match-sibling selector subject adapter))))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user