Function: mpc

mpc is an autoloaded, interactive and byte-compiled function defined in mpc.el.gz.

Signature

(mpc)

Documentation

Main entry point for MPC.

Probably introduced at or before Emacs version 23.2.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mpc.el.gz
;;;###autoload
(defun mpc ()
  "Main entry point for MPC."
  (interactive
   (progn
     (if current-prefix-arg
         ;; FIXME: We should provide some completion here, especially for the
         ;; case where the user specifies a local socket/file name.
         (setq mpc-host (read-string
                         (format-prompt "MPD host and port" mpc-host)
                         nil nil mpc-host)))
     nil))
  (let* ((song-buf (mpc-songs-buf))
         (song-win (get-buffer-window song-buf 0)))
    (if song-win
        (select-window song-win)
      (if (or (window-dedicated-p) (window-minibuffer-p))
          (ignore-errors (select-frame (make-frame mpc-frame-alist)))
        (with-current-buffer song-buf
          (setq-local mpc-previous-window-config
                      (current-window-configuration))))
      (let* ((win1 (selected-window))
             (win2 (split-window))
             (tags mpc-browser-tags))
        (unless tags (error "Need at least one entry in `mpc-browser-tags'"))
        (set-window-buffer win2 song-buf)
        (set-window-dedicated-p win2 'soft)
        (mpc-status-buffer-show)
        (while
            (progn
              (set-window-buffer win1 (mpc-tagbrowser-buf (pop tags)))
              (set-window-dedicated-p win1 'soft)
              tags)
          (setq win1 (split-window win1 nil 'horiz)))))
    (balance-windows-area))
  (mpc-songs-refresh)
  (mpc-status-refresh))