Function: mpc-constraints-get-current

mpc-constraints-get-current is a byte-compiled function defined in mpc.el.gz.

Signature

(mpc-constraints-get-current &optional AVOID-BUF)

Documentation

Return currently selected set of constraints.

If AVOID-BUF is non-nil, it specifies a buffer which should be ignored when constructing the set of constraints.

Source Code

;; Defined in /usr/src/emacs/lisp/mpc.el.gz
(defun mpc-constraints-get-current (&optional avoid-buf)
  "Return currently selected set of constraints.
If AVOID-BUF is non-nil, it specifies a buffer which should be ignored
when constructing the set of constraints."
  (let ((constraints (if mpc--song-search `((Search ,mpc--song-search))))
        tag select)
    (dolist (buf (process-get (mpc-proc) 'buffers))
      (setq buf (cdr buf))
      (when (and (setq tag (buffer-local-value 'mpc-tag buf))
                 (not (eq buf avoid-buf))
                 (setq select
                       (with-current-buffer buf (mpc-select-get-selection))))
        (push (cons tag select) constraints)))
    constraints))