Don’t prefix lambdas with #'

This commit is contained in:
Milan Zamazal 2022-06-28 21:27:49 +02:00
parent c31950cb30
commit 9425f7f359
2 changed files with 29 additions and 29 deletions

View File

@ -55,7 +55,7 @@ version, call `pw-lib-refresh' first."
(let ((objects pw-lib--objects))
(when type
(setq objects (cl-remove-if-not
#'(lambda (o) (string= (cdr (assq 'type (cdr o))) type))
(lambda (o) (string= (cdr (assq 'type (cdr o))) type))
objects)))
objects))
@ -148,12 +148,12 @@ Note that PipeWire data is cached, if you need its up-to-date
version, call `pw-lib-refresh' first."
(unless pw-lib--defaults
(let ((defaults (pw-access-defaults pw-lib--accessor))
(nodes (mapcar #'(lambda (o)
(nodes (mapcar (lambda (o)
(cons (pw-lib-object-value o "node.name") (pw-lib-object-id o)))
(pw-lib-objects "Node"))))
(setq pw-lib--defaults
(cl-remove-if-not #'cdr
(mapcar #'(lambda (d)
(mapcar (lambda (d)
(cons (car d) (cdr (assoc (cdr d) nodes))))
defaults)))))
pw-lib--defaults)
@ -170,9 +170,9 @@ version, call `pw-lib-refresh' first."
(or pw-lib--bindings
(setq pw-lib--bindings
(apply #'nconc
(mapcar #'(lambda (o)
(mapcar (lambda (o)
(let ((o-id (pw-lib-object-id o)))
(mapcar #'(lambda (p)
(mapcar (lambda (p)
(cons o-id (cdr p)))
(cl-remove-if-not #'numberp (pw-lib--object-info o)
:key #'cdr))))
@ -185,10 +185,10 @@ type are returned.
Note that PipeWire data is cached, if you need its up-to-date
version, call `pw-lib-refresh' first."
(let ((children (mapcar #'pw-lib-get-object
(mapcar #'car (cl-remove-if #'(lambda (b) (/= (cdr b) id))
(mapcar #'car (cl-remove-if (lambda (b) (/= (cdr b) id))
(pw-lib-bindings))))))
(when type
(setq children (cl-remove-if-not #'(lambda (o) (equal (pw-lib-object-type o) type))
(setq children (cl-remove-if-not (lambda (o) (equal (pw-lib-object-type o) type))
children)))
children))
@ -196,7 +196,7 @@ version, call `pw-lib-refresh' first."
(when node
(let ((ports (pw-lib-children (pw-lib-object-id node) "Port")))
(if regexp
(cl-delete-if-not #'(lambda (o)
(cl-delete-if-not (lambda (o)
(if-let ((name (pw-lib-object-value o "port.name")))
(string-match regexp name)))
ports)

View File

@ -101,10 +101,10 @@ The indicator is displayed only on graphical terminals."
(description-properties (if (equal type "Client")
'("application.name")
(let ((prefix (concat (downcase type) ".")))
(mapcar #'(lambda (suffix) (concat prefix suffix))
(mapcar (lambda (suffix) (concat prefix suffix))
'("description" "name"))))))
(or (cl-find-if #'identity
(mapcar #'(lambda (p) (pw-lib-object-value object p))
(mapcar (lambda (p) (pw-lib-object-value object p))
description-properties))
"")))
@ -213,7 +213,7 @@ The indicator is displayed only on graphical terminals."
(setq pw-ui--osd-timer
(run-with-timer
pipewire-osd-timeout nil
#'(lambda ()
(lambda ()
(when pw-ui--osd-frame
(ignore-errors (delete-frame pw-ui--osd-frame)))
(when pw-ui--osd-buffer
@ -349,9 +349,9 @@ Otherwise ask for the Node to set as the default Node."
(let ((object (or (pw-ui--current-object nil '("Device" "Node"))
(let* ((default-node-ids (mapcar #'cdr (pw-lib-default-nodes)))
(nodes (cl-remove-if
#'(lambda (n) (member (pw-lib-object-id n) default-node-ids))
(lambda (n) (member (pw-lib-object-id n) default-node-ids))
(pw-lib-objects "Node")))
(node-mapping (mapcar #'(lambda (n) (cons (pw-ui--object-name n)
(node-mapping (mapcar (lambda (n) (cons (pw-ui--object-name n)
(pw-lib-object-id n)))
nodes))
(node-name (completing-read "Default node: " node-mapping nil t)))