From 9425f7f3591d4b77801d165783de4a2118063473 Mon Sep 17 00:00:00 2001 From: Milan Zamazal Date: Tue, 28 Jun 2022 21:27:49 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20prefix=20lambdas=20with=20#'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pw-lib.el | 32 ++++++++++++++++---------------- pw-ui.el | 26 +++++++++++++------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pw-lib.el b/pw-lib.el index b88b286..725b516 100644 --- a/pw-lib.el +++ b/pw-lib.el @@ -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)))) diff --git a/pw-ui.el b/pw-ui.el index a9205d5..4b6ba3e 100644 --- a/pw-ui.el +++ b/pw-ui.el @@ -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)))))))