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,13 +148,13 @@ 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)
(cons (pw-lib-object-value o "node.name") (pw-lib-object-id 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)
(cons (car d) (cdr (assoc (cdr d) nodes))))
(mapcar (lambda (d)
(cons (car d) (cdr (assoc (cdr d) nodes))))
defaults)))))
pw-lib--defaults)
@ -170,12 +170,12 @@ version, call `pw-lib-refresh' first."
(or pw-lib--bindings
(setq pw-lib--bindings
(apply #'nconc
(mapcar #'(lambda (o)
(let ((o-id (pw-lib-object-id o)))
(mapcar #'(lambda (p)
(cons o-id (cdr p)))
(cl-remove-if-not #'numberp (pw-lib--object-info o)
:key #'cdr))))
(mapcar (lambda (o)
(let ((o-id (pw-lib-object-id o)))
(mapcar (lambda (p)
(cons o-id (cdr p)))
(cl-remove-if-not #'numberp (pw-lib--object-info o)
:key #'cdr))))
(pw-lib-objects))))))
(defun pw-lib-children (id &optional type)
@ -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,9 +196,9 @@ 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)
(if-let ((name (pw-lib-object-value o "port.name")))
(string-match regexp name)))
(cl-delete-if-not (lambda (o)
(if-let ((name (pw-lib-object-value o "port.name")))
(string-match regexp name)))
ports)
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,14 +213,14 @@ The indicator is displayed only on graphical terminals."
(setq pw-ui--osd-timer
(run-with-timer
pipewire-osd-timeout nil
#'(lambda ()
(when pw-ui--osd-frame
(ignore-errors (delete-frame pw-ui--osd-frame)))
(when pw-ui--osd-buffer
(ignore-errors (kill-buffer pw-ui--osd-buffer)))
(setq pw-ui--osd-frame nil
pw-ui--osd-timer nil
pw-ui--osd-buffer nil)))))
(lambda ()
(when pw-ui--osd-frame
(ignore-errors (delete-frame pw-ui--osd-frame)))
(when pw-ui--osd-buffer
(ignore-errors (kill-buffer pw-ui--osd-buffer)))
(setq pw-ui--osd-frame nil
pw-ui--osd-timer nil
pw-ui--osd-buffer nil)))))
(defmacro pw-ui--osd (&rest body)
(declare (indent defun))
@ -349,10 +349,10 @@ 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)
(pw-lib-object-id 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)))
(pw-lib-get-object (cdr (assoc node-name node-mapping)))))))